Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions third_party/mysql_client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased (Querya patch)

- Request `CLIENT_FOUND_ROWS` in the client handshake so `affectedRows` is the number of matched rows, not changed rows

## 0.0.27

- Add timeoutMs param to pool constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:mysql_client/mysql_protocol.dart';
import 'package:mysql_client/mysql_protocol_extension.dart';

const _supportedCapabitilies = mysqlCapFlagClientProtocol41 |
mysqlCapFlagClientFoundRows |
mysqlCapFlagClientSecureConnection |
mysqlCapFlagClientPluginAuth |
mysqlCapFlagClientPluginAuthLenEncClientData |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:buffer/buffer.dart';
import 'package:mysql_client/mysql_protocol.dart';

const _supportedCapabitilies = mysqlCapFlagClientProtocol41 |
mysqlCapFlagClientFoundRows |
mysqlCapFlagClientSecureConnection |
mysqlCapFlagClientPluginAuth |
mysqlCapFlagClientPluginAuthLenEncClientData |
Expand Down
30 changes: 30 additions & 0 deletions third_party/mysql_client/test/mysql_packet_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,36 @@ void main() {
);
});

test("client handshake requests CLIENT_FOUND_ROWS", () {
final handshake = MySQLPacket.decodeInitialHandshake(
Uint8List.fromList(
HEX.decode(
'4d0000000a352e372e33352d3338007b000000181e73526349597c00ffff080200ffc1150000000000000000000007317a2531721d587825181d006d7973716c5f6e61746976655f70617373776f726400',
),
),
).payload as MySQLPacketInitialHandshake;

final response = MySQLPacketHandshakeResponse41.createWithNativePassword(
username: 'root',
password: 'secret',
initialHandshakePayload: handshake,
);
final sslRequest = MySQLPacketSSLRequest.createDefault(
initialHandshakePayload: handshake,
connectWithDB: false,
);

// So UPDATE reports matched (not changed) rows, like PostgreSQL / SQLite.
expect(
response.capabilityFlags & mysqlCapFlagClientFoundRows,
mysqlCapFlagClientFoundRows,
);
expect(
sslRequest.capabilityFlags & mysqlCapFlagClientFoundRows,
mysqlCapFlagClientFoundRows,
);
});

test("testing response ok packet", () {
final buffer = Uint8List.fromList(HEX.decode('0700000200000002000000'));
final packet = MySQLPacket.decodeGenericPacket(buffer);
Expand Down
Loading