diff options
author | malff/marcsql@weblab.(none) <> | 2006-11-21 11:02:25 -0700 |
---|---|---|
committer | malff/marcsql@weblab.(none) <> | 2006-11-21 11:02:25 -0700 |
commit | bafbe2c7c7efe6daa03e836744a64820d07d0b99 (patch) | |
tree | e437af096a4f7090a046c2f2c474a1eebd401bf9 /sql/lock.cc | |
parent | 96ce9e798b1abfe907bd4a2607a01896ed117f1e (diff) | |
parent | 070f5ad497109dc7505c50b86f51ff684ebe993f (diff) | |
download | mariadb-git-bafbe2c7c7efe6daa03e836744a64820d07d0b99.tar.gz |
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.1-11733_topdown
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index f36ecf58620..9886149ba77 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -151,6 +151,19 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, } } + if (write_lock_used && opt_readonly) + { + /* + Someone has issued SET GLOBAL READ_ONLY=1 and we want a write lock. + We do not wait for READ_ONLY=0, and fail. + */ + reset_lock_data(sql_lock); + my_free((gptr) sql_lock, MYF(0)); + sql_lock=0; + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); + break; + } + thd->proc_info="System lock"; DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info)); if (lock_external(thd, tables, count)) |