Skip to content
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

first call of a stored procedure that uses session user variable always return NULL #7068

Open
jennifersp opened this issue Nov 29, 2023 · 0 comments
Labels
bug Something isn't working sql server Issues related to the built in SQL server sql Issue with SQL

Comments

@jennifersp
Copy link
Contributor

Dolt server:

mysql>  CREATE PROCEDURE p1(x VARCHAR(20)) BEGIN SET @randomvar = (SELECT LENGTH(x)); SELECT @randomvar; END;#
mysql> delimiter ;
mysql> call p1('hi');
+------------+
| @randomvar |
+------------+
|       NULL |
+------------+
1 row in set (0.00 sec)

mysql> call p1('hi');
+------------+
| @randomvar |
+------------+
|          2 |
+------------+
1 row in set (0.00 sec)

MySQL:

mysql>  CREATE PROCEDURE p1(x VARCHAR(20)) BEGIN SET @randomvar = (SELECT LENGTH(x)); SELECT @randomvar; END;#
mysql> delimiter ;
mysql> call p1('hi');
+------------+
| @randomvar |
+------------+
|          2 |
+------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> call p1('hi');
+------------+
| @randomvar |
+------------+
|          2 |
+------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

@jennifersp jennifersp added bug Something isn't working sql Issue with SQL sql server Issues related to the built in SQL server labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql server Issues related to the built in SQL server sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

1 participant