DEFINER clause breaks replication

Bug #771572 reported by Joe Daly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Critical
Joe Daly

Bug Description

recent changes that added the access definer break replication, presumably this is missing something to allow this clause to be passed in

[New Thread 0x7fffdd2b5710 (LWP 25115)]
(SQLSTATE 00000) You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'DEFINER root' at line 1
Failure while executing:
COMMIT
CREATE SCHEMA `test1` COLLATE utf8_general_ci DEFINER root
UPDATE `sys_replication`.`applier_state` SET `last_applied_commit_id` = 2

Related branches

Joe Daly (skinny.moey)
Changed in drizzle:
status: New → Confirmed
importance: Undecided → Critical
Joe Daly (skinny.moey)
Changed in drizzle:
assignee: nobody → Joe Daly (skinny.moey)
Revision history for this message
Joe Daly (skinny.moey) wrote :

part of the problem is in transformCreateSchemaStatementToSql() there are no quotes for DEFINER value. But another problem is that the parser seems to choke on having multiple definitions:

drizzle> CREATE SCHEMA `test4` DEFINER 'jdaly';
Query OK, 1 row affected (0.001228 sec)

drizzle> CREATE SCHEMA `test5` COLLATE utf8_general_ci;
Query OK, 1 row affected (0.001069 sec)

drizzle> CREATE SCHEMA `test6` COLLATE utf8_general_ci DEFINER 'jdaly';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'DEFINER 'jdaly'' at line 1
drizzle>

The last statement is a combination of the first two, perhaps Im missing a secret identifier

Changed in drizzle:
assignee: Joe Daly (skinny.moey) → Brian Aker (brianaker)
Revision history for this message
Joe Daly (skinny.moey) wrote :

it looks like the new custom database options can not be used together

drizzle> CREATE SCHEMA `test11` DEFINER 'jdaly';
Query OK, 1 row affected (0.001072 sec)

drizzle> CREATE SCHEMA `test12` DEFINER 'jdaly' REPLICATE = FALSE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'REPLICATE = FALSE' at line 1
drizzle>

Revision history for this message
Joe Daly (skinny.moey) wrote :

Does this look like the correct fix for this? Admittedly I just hacked on this until I got something to work.

--- drizzled/sql_yacc.yy 2011-04-13 22:07:01 +0000
+++ drizzled/sql_yacc.yy 2011-04-27 19:47:37 +0000
@@ -980,12 +980,14 @@

 opt_create_database_options:
           /* empty */ {}
- | default_collation_schema {}
- | opt_database_custom_options {}
+ | default_collation_schema opt_database_custom_options
+ | default_collation_schema ',' opt_database_custom_options
+ | opt_database_custom_options
         ;

 opt_database_custom_options:
         custom_database_option
+ | custom_database_option opt_database_custom_options
         | custom_database_option ',' opt_database_custom_options
         ;

Changed in drizzle:
assignee: Brian Aker (brianaker) → Joe Daly (skinny.moey)
Joe Daly (skinny.moey)
Changed in drizzle:
status: Confirmed → Fix Committed
Joe Daly (skinny.moey)
Changed in drizzle:
status: Fix Committed → Fix Released
milestone: none → 2011-05-09
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.