diff --git a/lib/internal/connection/impl.dart b/lib/internal/connection/impl.dart index 4fc8bd4..a4e5648 100644 --- a/lib/internal/connection/impl.dart +++ b/lib/internal/connection/impl.dart @@ -68,7 +68,7 @@ class MySqlConnectionImpl implements MySqlConnection { Future prepare(String sql) async { PreparedQuery query = await _socket.execHandler(PrepareHandler(sql), _timeout); - return PreparedImpl._(this, query); + return PreparedImpl._(_socket, _timeout, this, query); } Future begin() => Transaction.begin(this); @@ -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 execute(Iterable values) => @@ -144,5 +146,8 @@ class PreparedImpl implements Prepared { } @override - Future deallocate() => throw UnimplementedError(); + Future deallocate() async { + await _socket.execHandlerNoResponse( + CloseStatementHandler(_query.statementHandlerId), _timeout); + } }