summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-11-20 02:57:02 +0200
committerunknown <monty@donna.mysql.com>2000-11-20 02:57:02 +0200
commit89ee326c1d27f3bee4acba67060a475811ebd842 (patch)
treed3f52866508b583c2d4549b66887b4b50aa9fe22 /sql/sql_delete.cc
parent5dae19b394e3385c0e48d896fec1174437f2308a (diff)
downloadmariadb-git-89ee326c1d27f3bee4acba67060a475811ebd842.tar.gz
Bug fix for NATURAL JOIN, Split manual sections and more statistic variables
Docs/manual.texi: Split BDB into different sections Added MySQL developers section Changed an SQL to a SQL include/my_sys.h: More statistic variables libmysql/libmysql.c: Added option "interactive-timeout" mysys/mf_tempfile.c: More statistic variables mysys/my_static.c: More statistic variables sql-bench/crash-me.sh: Fixed bug in truncate table test sql-bench/limits/mysql-3.23.cfg: Updated to crash-me 1.51 sql-bench/limits/mysql.cfg: Updated to crash-me 1.51 sql/filesort.cc: More statistics sql/mysql_priv.h: More statistics sql/mysqld.cc: More statistics sql/sql_base.cc: Fix for NATURAL JOIN sql/sql_delete.cc: cleanup + Added logging if one doesn't use index sql/sql_parse.cc: Logging if one doesn't use index sql/sql_select.cc: Logging if one doesn't use index sql/sql_update.cc: cleanup + Added logging if one doesn't use index sql/structs.h: Fix for NATURAL JOIN support-files/my-huge.cnf.sh: Added interactive-timeout to [mysqlhotcopy] support-files/my-large.cnf.sh: Added interactive-timeout to [mysqlhotcopy] support-files/my-medium.cnf.sh: Added interactive-timeout to [mysqlhotcopy] support-files/my-small.cnf.sh: Added interactive-timeout to [mysqlhotcopy]
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 29526b4d7d5..4875be9be6c 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -35,21 +35,21 @@ int generate_table(THD *thd, TABLE_LIST *table_list,
thd->proc_info="generate_table";
if(global_read_lock)
+ {
+ if(thd->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);
+ 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 */
@@ -173,14 +173,16 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit,
}
/* If running in safe sql mode, don't allow updates without keys */
- if ((thd->options & OPTION_SAFE_UPDATES) && !table->quick_keys &&
- limit == HA_POS_ERROR)
+ if (!table->quick_keys)
{
- delete select;
- send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
- DBUG_RETURN(1);
+ thd->options|=OPTION_NO_INDEX_USED;
+ if ((thd->options & OPTION_SAFE_UPDATES) && limit == HA_POS_ERROR)
+ {
+ delete select;
+ send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
+ DBUG_RETURN(1);
+ }
}
-
(void) table->file->extra(HA_EXTRA_NO_READCHECK);
if (options & OPTION_QUICK)
(void) table->file->extra(HA_EXTRA_QUICK);