-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stored Procedure Not Working #12
Comments
I do receive the result - however the trace happens and the connection is closed. |
The proc branch here might work better for you https://github.com/adamlofts/mysql1_dart/tree/proc |
i have a similar issue. I keep getting 'Bad state: Cannot write to socket, it is closed' |
When calling a stored procedure - the MySQL Protocol has the server sending an additional packet to the client that is not handled by the current dart driver. The current driver throws an exception because no handler is defined for the last packet (non data packet) and closes the socket. Subsequent calls on the same connection will give you the "Bad state: Cannot write to socket, it is closed" A quick work around until the protocol is handled correctly is to add the following in single_connection.dart Future _handleData(Buffer buffer) async { In my case - we have decided not to implement a dart server connecting to MySQL because this driver is not yet complete. It works great for simple queries, but I'm not able to count on this yet in a production environment. |
Thank you very much. I'll try it. I couldn't find a driver for MS SQL for flutter, that's why I think I'm stuck with this. |
@virtz Did you try the proc branch I mentioned above? |
no, sorry I'm new to github. Do you mind telling how to try it? |
I'm connecting to a AWS Aurora DB. Simple queries work fine. I've not been able to get a stored procedure call to work.
I've created your test case procedure p ( select a * b) and i'm attempting to call it. I'm receiving the following:
[WARNING] MySqlConnection: Ignoring error because no response NoSuchMethodError: The method 'processResponse' was called on null.
Receiver: null
Tried calling: processResponse(Instance of 'Buffer') #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1 ReqRespConnection._handleData (package:mysql1/src/single_connection.dart:329:31)
#2 ReqRespConnection._handleHeader (package:mysql1/src/single_connection.dart:298:13)
#3 ReqRespConnection._readPacket (package:mysql1/src/single_connection.dart:283:7)
#4 MySqlConnection.connect. (package:mysql1/src/single_connection.dart:120:13)
#5 BufferedSocket._onData (package:mysql1/src/buffered_socket.dart:93:11)
#6 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#7 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#8 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#9 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#10 _StreamController._add (dart:async/stream_controller.dart:640:7)
#11 _StreamController.add (dart:async/stream_controller.dart:586:5)
#12 new _RawSocket. (dart:io/runtime/binsocket_patch.dart:1323:33)
#13 _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:844:14)
#14 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#15 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#16 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#17 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
The text was updated successfully, but these errors were encountered: