unknown
a914b5274f
Save and clear run context before executing a stored function or trigger and restore it afterwards.
...
This allows us to use statement replication with functions and triggers
The following things are fixed with this patch:
- NOW() and automatic timestamps takes the value from the main event for functions and triggers (which allows these to replicate with statement level logging)
- No side effects for triggers or functions with auto-increment values(), last_insert_id(), rand() or found_rows()
- Triggers can't return result sets
Fixes bugs:
#12480 : NOW() is not constant in a trigger
#12481 : Using NOW() in a stored function breaks statement based replication
#12482 : Triggers has side effects with auto_increment values
#11587 : trigger causes lost connection error
mysql-test/r/trigger.result:
Added test fpr big
mysql-test/t/sp-error.test:
Changed error message numbers
mysql-test/t/trigger.test:
Added test for trigger returning result (#11587 )
sql/item_func.cc:
Store the first used seed value for RAND() value.
(This makes rand() replicatable in functions and triggers)
Save and clear run context before executing a stored function and restore it afterwards.
This removes side effects of stored functions for RAND(), auto-increment values and NOW() and makes most stored function replicatable
sql/share/errmsg.txt:
Reuse error message also for triggers
sql/sp_head.cc:
If in function or trigger, don't change value of NOW()
(This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_class.cc:
Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_class.h:
Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_parse.cc:
If in function or trigger, don't change value of NOW()
(This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_trigger.cc:
Moved process_triggers function from sql_trigger.h
Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_trigger.h:
Moved process_triggers function from sql_trigger.h
Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_yacc.yy:
Give error message if trigger can return a result set (Bug #11587 )
tests/fork_big2.pl:
Removed return from end of lines
mysql-test/r/rpl_trigger.result:
New BitKeeper file ``mysql-test/r/rpl_trigger.result''
mysql-test/t/rpl_trigger.test:
New BitKeeper file ``mysql-test/t/rpl_trigger.test''
2005-08-15 18:15:12 +03:00
..
2005-06-27 13:12:10 +02:00
2005-08-08 17:46:06 +04:00
2005-02-21 19:20:05 +04:00
2005-06-03 17:13:43 +02:00
2005-03-15 09:29:54 +03:00
2005-07-10 18:19:37 -07:00
2005-06-06 20:41:52 +03:00
2005-02-24 23:33:42 +02:00
2005-06-16 10:09:05 +02:00
2005-04-26 19:46:52 +05:00
2005-08-11 18:42:22 +01:00
2005-03-16 23:12:27 +03:00
2005-05-05 14:20:53 +02:00
2005-06-23 19:05:36 +02:00
2005-06-15 08:39:00 -07:00
2005-05-07 12:17:54 +00:00
2005-06-27 12:25:15 +02:00
2005-02-01 16:27:08 +02:00
2005-03-15 03:46:19 +03:00
2005-05-30 03:32:50 +04:00
2005-08-07 21:21:30 +00:00
2005-08-02 14:27:52 +05:00
2005-04-11 15:11:52 +05:00
2005-07-06 17:16:22 +05:00
2005-06-06 21:22:23 +05:00
2005-03-30 14:10:27 +05:00
2005-07-18 13:38:56 -07:00
2005-07-22 21:06:02 +05:00
2005-05-05 21:13:57 +05:00
2005-07-21 16:05:19 +05:00
2005-05-06 18:41:41 +05:00
2005-01-14 17:09:35 -08:00
2005-01-21 16:55:17 +04:00
2005-07-06 17:16:22 +05:00
2005-01-15 14:09:45 +02:00
2005-06-06 16:54:15 +05:00
2005-04-04 16:34:24 -07:00
2005-07-15 19:46:42 +02:00
2005-07-20 13:40:18 +05:00
2005-07-22 14:47:13 +05:00
2005-07-20 06:55:51 +04:00
2005-06-01 17:36:21 +02:00
2005-08-01 17:00:03 -07:00
2005-05-30 20:48:40 +03:00
2005-02-22 15:47:00 +02:00
2005-06-08 20:35:37 +05:00
2005-03-02 17:52:38 +01:00
2005-04-27 14:31:04 +03:00
2005-03-20 14:38:51 +01:00
2005-08-05 17:22:53 -07:00
2005-07-19 03:04:51 +02:00
2005-04-12 23:08:19 +02:00
2005-08-03 02:01:27 +04:00
2005-08-08 00:10:07 +02:00
2005-02-17 02:59:39 +01:00
2005-08-07 21:30:46 +00:00
2005-08-02 12:09:49 -07:00
2005-06-20 12:09:00 +02:00
2005-06-14 17:50:24 +05:00
2005-07-07 11:49:44 -07:00
2005-06-27 20:31:02 +03:00
2005-06-27 20:31:00 +03:00
2005-02-09 02:50:45 +04:00
2005-07-28 21:28:20 -07:00
2005-07-28 21:39:24 +03:00
2005-06-13 11:45:29 -07:00
2005-07-16 18:06:34 -07:00
2005-08-01 19:21:56 -07:00
2005-08-11 18:58:22 -07:00
2005-05-06 01:01:39 +05:00
2005-04-18 15:58:58 +04:00
2005-02-19 18:58:27 +02:00
2005-08-11 12:18:53 +01:00
2005-03-28 12:34:00 +05:00
2005-02-03 23:08:43 +00:00
2005-06-24 14:04:48 +05:00
2005-05-13 12:08:08 +03:00
2005-08-05 20:26:55 +05:00
2005-04-05 19:45:34 -07:00
2005-03-23 19:18:25 +01:00
2005-05-18 13:54:36 -07:00
2005-08-08 19:04:11 +05:00
2005-08-07 22:10:05 +00:00
2005-06-14 12:52:44 +03:00
2005-03-22 16:10:39 -08:00
2005-05-05 10:36:17 -07:00
2005-03-03 14:15:37 +04:00
2005-02-01 14:37:51 +04:00
2005-01-20 18:36:40 -08:00
2005-07-22 21:06:02 +05:00
2005-05-08 22:56:58 +01:00
2005-06-15 10:12:49 +03:00
2005-04-12 12:04:43 +02:00
2005-06-24 19:47:19 +02:00
2005-08-09 11:21:45 +03:00
2005-01-14 17:09:35 -08:00
2005-06-20 08:56:37 +00:00
2005-02-22 18:30:44 +03:00
2005-05-13 12:08:08 +03:00
2005-06-20 11:05:38 +02:00
2005-08-05 11:01:29 +02:00
2005-05-20 16:39:28 +04:00
2005-08-09 11:43:55 +04:00
2005-05-27 04:17:33 +02:00
2005-06-07 22:43:25 +02:00
2005-04-07 19:24:14 +03:00
2005-04-06 16:52:41 +03:00
2005-08-09 22:05:07 +04:00
2005-04-04 12:43:58 -07:00
2005-07-03 14:17:52 +03:00
2005-08-10 22:17:53 +01:00
2005-08-05 16:43:35 -07:00
2005-06-15 02:02:25 -07:00
2005-08-07 20:39:17 +02:00
2005-06-22 12:46:21 -07:00
2005-04-11 22:36:07 +02:00
2005-04-05 19:45:34 -07:00
2005-03-16 12:13:35 +03:00
2005-06-03 15:29:05 +02:00
2005-05-24 15:52:48 +01:00
2005-07-05 17:27:37 +02:00
2005-02-14 18:23:10 +03:00
2005-02-17 18:07:14 -08:00
2005-05-24 00:31:28 +02:00
2005-03-28 15:13:31 +03:00
2005-05-18 13:54:36 -07:00
2005-05-06 01:01:39 +05:00
2005-04-04 12:43:58 -07:00
2005-02-17 11:48:44 -08:00
2005-08-04 16:36:14 +05:00
2005-06-03 15:29:05 +02:00
2005-02-23 19:59:25 +01:00
2005-03-16 04:32:47 +03:00
2005-07-30 09:24:51 +03:00
2005-03-15 10:46:43 -08:00
2005-07-31 12:49:55 +03:00
2005-04-08 12:34:52 +02:00
2005-07-12 11:49:57 +02:00
2005-05-19 20:38:48 +02:00
2005-03-15 15:03:25 +01:00
2005-02-21 11:45:51 +01:00
2005-02-04 10:56:53 +01:00
2005-01-09 11:00:37 +01:00
2005-07-31 21:33:46 +02:00
2005-07-26 09:06:37 +02:00
2005-04-22 15:28:23 +02:00
2005-01-26 14:38:13 +01:00
2005-02-16 21:19:42 +01:00
2005-04-01 15:04:50 +03:00
2005-06-17 14:45:54 +02:00
2005-04-27 18:17:41 +02:00
2005-05-04 10:16:03 +02:00
2005-06-09 15:39:14 +02:00
2005-04-01 22:14:30 +02:00
2005-04-21 10:59:21 +02:00
2005-07-27 13:45:06 +03:00
2005-06-17 18:07:46 +02:00
2005-07-31 04:29:34 -07:00
2005-05-13 12:08:08 +03:00
2005-07-19 03:01:25 +04:00
2005-04-01 00:03:26 +05:00
2005-04-05 19:45:34 -07:00
2005-05-14 16:24:36 +03:00
2005-05-13 12:08:08 +03:00
2005-08-01 17:54:57 -07:00
2005-07-19 19:59:34 -07:00
2005-07-19 19:59:34 -07:00
2005-07-19 19:59:34 -07:00
2005-07-19 19:59:34 -07:00
2005-07-19 19:59:34 -07:00
2005-07-19 19:59:34 -07:00
2005-07-28 21:39:24 +03:00
2005-07-16 13:45:32 +04:00
2005-08-11 13:07:08 +03:00
2005-08-11 18:42:22 +01:00
2005-07-16 08:19:20 -07:00
2005-02-24 23:33:42 +02:00
2005-04-05 13:17:49 +02:00
2005-04-06 15:51:24 +05:00
2005-03-16 14:28:54 +02:00
2005-04-05 19:45:34 -07:00
2005-03-16 15:57:57 +03:00
2005-03-16 04:32:47 +03:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-06-17 14:03:27 +02:00
2005-07-13 14:15:23 +02:00
2005-07-28 21:25:05 +03:00
2005-02-21 20:41:48 +02:00
2005-03-25 14:51:17 +01:00
2005-06-01 16:13:24 -07:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-07-05 13:55:54 +02:00
2005-02-24 17:25:06 +01:00
2005-03-16 04:32:47 +03:00
2005-03-16 04:32:47 +03:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-03-16 04:32:47 +03:00
2005-07-19 03:01:25 +04:00
2005-01-10 15:13:33 +01:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-01-31 13:18:36 +00:00
2005-06-22 17:12:02 +02:00
2005-08-10 13:30:53 -07:00
2005-03-25 14:51:17 +01:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-04-06 18:19:05 +02:00
2005-07-19 03:01:25 +04:00
2005-03-16 04:32:47 +03:00
2005-03-16 04:32:47 +03:00
2005-04-01 15:04:50 +03:00
2005-08-03 16:12:06 -04:00
2005-07-19 20:06:49 +04:00
2005-03-23 19:18:25 +01:00
2005-03-24 16:43:50 +01:00
2005-08-15 18:15:12 +03:00
2005-03-25 14:51:17 +01:00
2005-03-16 04:32:47 +03:00
2005-05-18 15:10:43 +05:00
2005-01-17 01:18:08 +02:00
2005-03-01 14:50:59 +02:00
2005-07-28 18:22:49 -07:00
2005-07-28 16:10:14 +03:00
2005-07-07 21:49:12 +05:00
2005-05-26 16:44:46 +02:00
2005-02-14 20:33:14 -08:00
2005-06-07 16:48:38 +02:00
2005-07-26 18:08:49 -07:00
2005-08-10 10:31:32 +04:00
2005-07-01 15:25:51 +02:00
2005-08-03 03:37:32 +00:00
2005-08-03 03:37:32 +00:00
2005-08-10 21:17:02 +00:00
2005-08-09 11:43:55 +04:00
2005-07-07 21:47:18 +05:00
2005-07-27 15:57:00 +05:00
2005-03-16 15:26:07 +02:00
2005-02-06 13:06:12 +02:00
2005-08-11 12:18:53 +01:00
2005-04-07 19:24:14 +03:00
2005-04-07 19:24:14 +03:00
2005-03-03 15:01:46 -08:00
2005-07-26 18:08:49 -07:00
2005-05-07 08:25:58 -07:00
2005-01-26 10:19:28 +01:00
2005-07-18 16:12:44 -07:00
2005-07-19 00:55:37 +04:00
2005-08-15 18:15:12 +03:00
2005-08-05 17:22:53 -07:00
2005-08-10 21:17:52 +00:00
2005-07-01 15:07:06 +05:00
2005-02-05 08:54:13 -08:00
2005-08-11 18:42:22 +01:00
2005-07-07 21:47:18 +05:00
2005-05-13 16:44:14 +05:00
2005-07-07 21:47:18 +05:00
2005-07-29 14:39:11 +05:00
2005-05-13 16:44:14 +05:00
2005-02-28 12:18:39 +02:00
2005-06-20 12:09:00 +02:00
2005-06-09 21:20:34 -07:00
2005-05-28 01:28:18 +02:00
2005-07-18 19:37:42 +04:00
2005-05-02 11:45:06 -07:00
2005-04-04 16:34:24 -07:00
2005-08-01 19:21:56 -07:00
2005-08-01 17:54:57 -07:00
2005-07-30 05:53:35 +04:00
2005-01-27 14:21:37 +02:00
2005-08-12 01:27:04 -07:00
2005-06-07 05:43:59 +03:00
2005-04-04 00:50:05 +02:00