diff options
author | unknown <sasha@mysql.sashanet.com> | 2000-11-04 13:58:07 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2000-11-04 13:58:07 -0700 |
commit | ee972a4d9fc276a6f47fdb540a7ca88532f018aa (patch) | |
tree | 262cd6aff2b96e2def09112c7fac8f243bbefbf9 /sql/sql_delete.cc | |
parent | 745f1197f64244e9937f6354891044b6b57e78dc (diff) | |
download | mariadb-git-ee972a4d9fc276a6f47fdb540a7ca88532f018aa.tar.gz |
fix for FLUSH TABLES WITH READ LOCK
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 9cd3c2f0e9b..2e6bea7239e 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -33,6 +33,25 @@ int generate_table(THD *thd, TABLE_LIST *table_list, DBUG_ENTER("generate_table"); thd->proc_info="generate_table"; + + if(global_read_lock) + { + if(thd->global_read_lock) + { + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,MYF(0), + table_list->real_name); + DBUG_RETURN(-1); + } + pthread_mutex_lock(&LOCK_open); + while (global_read_lock && ! thd->killed || + thd->version != refresh_version) + { + (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + } + pthread_mutex_unlock(&LOCK_open); + } + + /* If it is a temporary table, close and regenerate it */ if ((table_ptr=find_temporary_table(thd,table_list->db, table_list->real_name))) |