mysql1_dart
mysql1_dart copied to clipboard
First query always return empty result
The code like this:
var proxy = getConnection(xxxx);
var result;
result = await proxy.query('select * from t_employee where id = 1');
trpc.logger.info('after query: $result');
result = await proxy.query('select * from t_employee where id = ?', [2]);
trpc.logger.info('after query: $result');
The result like this:
// result print of first query
trpc-dart - 2021-10-03 20:29:13.791456 - info - query: select * from t_employee where id = 1, args: [], result: ();
trpc-dart - 2021-10-03 20:29:13.810355 - info - query: select * from t_employee where id = ?, args: [2], result: (Fields: {id: 2, name: Tom, dept_id: 1, salary: 999.0});
// result print of second query
trpc-dart - 2021-10-03 20:29:19.250444 - info - query: select * from t_employee where id = 1, args: [], result: (Fields: {id: 1, name: David, dept_id: 1, salary: 999.0});
trpc-dart - 2021-10-03 20:29:19.253210 - info - query: select * from t_employee where id = ?, args: [2], result: (Fields: {id: 2, name: Tom, dept_id: 1, salary: 999.0});
https://github.com/adamlofts/mysql1_dart/issues/88#issuecomment-894639665 this is a bug but solved