-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Dolt Stored Procedures don't work with CALL
functionality in some connectors
#3424
Comments
I can't get this to reproduce with the python MySQL Connector. Here is the code:
Here is the output:
And here is the server log in trace mode indicating prepareds were used.
|
CALL
functionality in some connectors
Using
Code here:
|
The Python code is faulty. With From my limited research, it appears that the expected workflow for With that being said, I was unable to find a way to fail any stored procedure in Dolt that also did not fail MySQL, so whatever Java is doing is different than what Python is doing. I'm attempting to create a Java project that uses the I have three guesses about what could be their issue. The first guess is fairly simple: if they're getting a The second guess deals with what prepared statements are. I initially thought that prepared statements used The third guess is that Spring JDBC is running |
The bug has been found, and the PR fixing this issue has been linked. This is the Java code that ended up working: import java.sql.*;
public class Main {
public static void main(String[] args) throws SQLException {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3308/test_dolt_stored_w_prepareds", "root", "");
CallableStatement callableStatement = conn.prepareCall("{call dolt_checkout(?)}");
callableStatement.setString(1, "main");
callableStatement.execute();
ResultSet resultSet = callableStatement.getResultSet();
ResultSetMetaData metaData = resultSet.getMetaData();
int colCount = metaData.getColumnCount();
while (resultSet.next()) {
for (int i = 1; i <= colCount; i++) {
if (i > 1) {
System.out.print(", ");
}
System.out.print(metaData.getColumnName(i) + ": " + resultSet.getString(i));
}
System.out.println("");
}
}
} There were two issues. The first is that JDBC does a |
A customer reported this line in his Java code did not work:
CallableStatement callableStatement = connection.prepareCall("{call dolt_checkout(?)}");
It seems prepareds don't mix with Dolt stored procedures right now.
Will get a quick repro soon.
The text was updated successfully, but these errors were encountered: