WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
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
11 changes: 8 additions & 3 deletions lib/internal/connection/impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class MySqlConnectionImpl implements MySqlConnection {
Future<Prepared> prepare(String sql) async {
PreparedQuery query =
await _socket.execHandler(PrepareHandler(sql), _timeout);
return PreparedImpl._(this, query);
return PreparedImpl._(_socket, _timeout, this, query);
}

Future<Transaction> begin() => Transaction.begin(this);
Expand Down Expand Up @@ -120,8 +120,10 @@ class MySqlConnectionImpl implements MySqlConnection {
class PreparedImpl implements Prepared {
final MySqlConnectionImpl _conn;
final PreparedQuery _query;
final Comm _socket;
final Duration _timeout;

PreparedImpl._(this._conn, this._query);
PreparedImpl._(this._socket, this._timeout, this._conn, this._query);

@override
Future<StreamedResults> execute(Iterable values) =>
Expand All @@ -144,5 +146,8 @@ class PreparedImpl implements Prepared {
}

@override
Future<void> deallocate() => throw UnimplementedError();
Future<void> deallocate() async {
await _socket.execHandlerNoResponse(
CloseStatementHandler(_query.statementHandlerId), _timeout);
}
}