diff options
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 54f94ce78c1..adc3d9d875a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -553,6 +553,13 @@ bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list) DBUG_ENTER("open_and_lock_for_insert_delayed"); #ifndef EMBEDDED_LIBRARY + /* INSERT DELAYED is not allowed in a read only transaction. */ + if (thd->tx_read_only) + { + my_error(ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION, MYF(0)); + DBUG_RETURN(true); + } + /* In order for the deadlock detector to be able to find any deadlocks caused by the handler thread waiting for GRL or this table, we acquire |