-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
Connector/NET: A warning causes stack overflow #8440
Comments
Hi @tkovacs-dev, thanks for reporting this issue to us. I've been able to repro this behavior and look at the wire logs. This appears to happen because Dolt is not clearing the session warnings after a call to From a SQL shell connected to Dolt, you can see that when we call mysql> select 1/0;
+-----+
| 1/0 |
+-----+
| NULL |
+-----+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+---------------+
| Level | Code | Message |
+---------+------+---------------+
| Warning | 1365 | Division by 0 |
+---------+------+---------------+
1 row in set, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+---------------+
| Level | Code | Message |
+---------+------+---------------+
| Warning | 1365 | Division by 0 |
+---------+------+---------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+---------------+
| Level | Code | Message |
+---------+------+---------------+
| Warning | 1365 | Division by 0 |
+---------+------+---------------+
1 row in set, 1 warning (0.01 sec) The issue seems to be that the output of |
We dug into this some more and figured out what's going on. Our logic that manages clearing sessions warnings runs at the end of analysis, but these types of warnings only happen during the execution/evaluation phase, which is after analysis. That causes the warning status to be slightly out of sync and to not get cleared correctly until two statements have been executed successfully – they should be cleared on the first statement that is executed successfully. @jycor is going to take it from here to look at refactoring that logic in the analyzer. |
Hey @tkovacs-dev, thanks for reporting this issue. Let us know if it works for you! |
@jycor Works great, thank you! |
If the statement you execute issues a warning (like division by zero, or running DROP DATABASE IF EXISTS nonexistent_db) a stack overflow error occurs in the Connector/NET code.
How to reproduce:
dolt sql-server
The text was updated successfully, but these errors were encountered: