-
Notifications
You must be signed in to change notification settings - Fork 349
Description
UPD. Every time someone use escaped user defined variable names into query all parameter values become NULL;
Just add this to you query and all parameters become NULL:
SET @'example-variable-name':= 0;
OR
SET @`example-variable-name`:= 0;
OR
SET @"example-variable-name":= 0;
All of these commands executed in single transaction in both MySqlConnector and Oracle’s Connector/NET. Every time DbParameter name = foo, value=22, type=int64 is supplied:
SET @'var':=1;
SELECT @'var' as R
returns 1 for both providers
SELECT @foo as R
returns 22 for both providers
SET @'var':=1;
SELECT @foo+@'var' as R
returns 23 for Oracle, DbNull for MySqlConnector
SET @'var':=1;
SELECT @foo+1 as R
returns 23 for Oracle, DbNull for MySqlConnector
SET @'var':=@foo+1;
SELECT @'var' as R
returns 23 for Oracle, DbNull for MySqlConnector
please note this behavior differs only when I'm using ESCAPED variable names (using "" or '' etc) https://dev.mysql.com/doc/refman/8.0/en/user-variables.html
IE any times I mix BOTH parameters and user-defined variables WITH ESCAPED name I got nulls