-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Exporting procedures with 'MODIFIES SQL DATA' generates a warning in OptionsArray.php #406
Comments
One other important piece I just noticed. The export of the CREATE PROCEDURE statement leaves out the word 'SQL' between 'MODIFIES' and 'DATA'. Here's the line from the export: CREATE DEFINER=`root`@`localhost` PROCEDURE `split_string` (IN `x` VARCHAR(255), IN `delim` VARCHAR(12), IN `id` CHAR(36)) DETERMINISTIC MODIFIES DATA BEGIN |
And that gave me the hint to find the error - in vendor/phpmyadmin/sql-parser/src/Statements/CreateStatement.php line 248 is 'expr', when it should be 'var' (to match the 'NO' and 'READS' function options). I don't know if I'll have time to put together a PR anytime soon, but there's the fix. |
This may already be fixed, maybe you can let us know by testing the latest 5.2 version in development (phpMyAdmin 5.2+snapshot) also available as a non official docker image? |
OK, it looks like this actually belongs in phpmyadmin/sql-parser, rather than here. I'll refile in the correct project (and not it's not fixed there). I didn't realize that multiple projects had been packaged in a single RPM for EL9. But no, it's not fixed in there. |
I am re-opening this one as I move it to the right project earlier |
How did you test this? |
I downloaded the code and looked at it. 'MODIFIES' is still set to 'expr' in the file src/Statements/CreateStatement.php on line 257. And sorry about the dup, I hadn't realized you moved it. |
thanks for taking the time to report back :) |
Fix phpmyadmin#406 Signed-off-by: Fawzi Abdulfattah <iifawzie@gmail.com>
Pull-request: #411 Signed-off-by: William Desportes <williamdes@wdes.fr>
I think you can download the code again now that I merged #411 |
Describe the bug
When you export a database with the 'Add CREATE PROCEDURE / FUNCTION / EVENT statement' option enabled, and the procedure definition includes 'MODIFIES SQL DATA', the parser generates the following message:
Dumping the value of $option just before that shows the following as the cause of the message:
To Reproduce
Create a procedure with 'MODIFIES SQL DATA' as the SQL data access option.
Click the Export tab for the database with said procedure.
Perform a custom export with the 'Add CREATE PROCEDURE / FUNCTION / EVENT statement'
See the warning and backtrace.
Expected behavior
No warning messages during the export.
Screenshots
Here's the full backtrace:
Server configuration
Client configuration
Additional context
This happens with multiple databases, each of witch have a stored procedure that modifies SQL data.
The text was updated successfully, but these errors were encountered: