1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix for conc-77: Backslash escaped quotes (', "") are not parsed correctly

This commit is contained in:
Georg Richter
2014-02-10 09:04:01 +01:00
parent 4f63028905
commit 2ceb2f7ffc
3 changed files with 8 additions and 5 deletions

View File

@@ -351,6 +351,12 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
case 's': case 's':
*ptr++= ' '; /* space */ *ptr++= ' '; /* space */
break; break;
case '\"':
*ptr++= '\"';
break;
case '\'':
*ptr++= '\'';
break;
case '\\': case '\\':
*ptr++= '\\'; *ptr++= '\\';
break; break;

View File

@@ -38,7 +38,7 @@ static int test_conc66(MYSQL *my)
fprintf(fp, "[conc-66]\n"); fprintf(fp, "[conc-66]\n");
fprintf(fp, "user=conc66\n"); fprintf(fp, "user=conc66\n");
fprintf(fp, "password='test;#test'\n"); fprintf(fp, "password='test\\\";#test'\n");
fclose(fp); fclose(fp);
@@ -47,7 +47,7 @@ static int test_conc66(MYSQL *my)
rc= mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "./my.cnf"); rc= mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "./my.cnf");
check_mysql_rc(rc, mysql); check_mysql_rc(rc, mysql);
rc= mysql_query(my, "GRANT ALL ON test.* TO 'conc66'@'localhost' IDENTIFIED BY 'test;#test'"); rc= mysql_query(my, "GRANT ALL ON test.* TO 'conc66'@'localhost' IDENTIFIED BY 'test\";#test'");
check_mysql_rc(rc, my); check_mysql_rc(rc, my);
rc= mysql_query(my, "FLUSH PRIVILEGES"); rc= mysql_query(my, "FLUSH PRIVILEGES");
check_mysql_rc(rc, my); check_mysql_rc(rc, my);

View File

@@ -1,3 +0,0 @@
[conc-66]
user=conc66
password='test;#test'