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
Edit routine UI incorrectly removes too many escape slashes #15370
Comments
|
Using command line, here are some things I identified. (Please note that I added a Using MariaDB [my_db]> show create procedure test_slash;
+------------+-------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation |
+------------+-------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| test_slash | STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`%` PROCEDURE `test_slash`()
NO SQL
SELECT REGEXP_REPLACE('Test: (Item)', 'Test: \\(([\\w]+)\\)', '\\1 \n') | utf8mb4 | utf8mb4_unicode_ci | latin1_swedish_ci |
+------------+-------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
1 row in set (0.001 sec)Using MariaDB [my_db]> select ROUTINE_DEFINITION from INFORMATION_SCHEMA.ROUTINES where SPECIFIC_NAME='test_slash';
+---------------------------------------------------------------------+
| ROUTINE_DEFINITION |
+---------------------------------------------------------------------+
| SELECT REGEXP_REPLACE('Test: (Item)', 'Test: \(([\w]+)\)', '\1 \n') |
+---------------------------------------------------------------------+
1 row in set (0.003 sec)So unfortunately, I think that relying on Nevertheless, the whole definition is retrieved from: $this->dbi->getDefinition(
$db,
$routine['ROUTINE_TYPE'],
$routine['SPECIFIC_NAME']
)So maybe we can extract the body from this. @Team, if you know a way to do it, would it be please possible to share it? Thank you. |
|
@Tithugues thank you for the research, I do not know how to fix it |
Signed-off-by: William Desportes <williamdes@wdes.fr>
|
Again thank you so much @Tithugues for the debug details, I could fix this quite quickly with 42165e4 Could you please test this fix @Donkie ? |
Describe the bug
When trying to edit a routine that contains a string with multiple consecutive backslashes (which is needed for for example regexp commands), one slash will be missing for each group of slashes.
For example, when exporting my routine, I get something like:
As it should be, but when editing the routine via the UI, I get:
Thus, when saving this the pattern string will become invalid and the routine breaks.
To Reproduce
Expected behavior
I expected the double backslashes to stick around
Server configuration
Client configuration
The text was updated successfully, but these errors were encountered: