1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merging 4.1->5.0.

This commit is contained in:
pem@mysql.com
2003-11-19 15:19:46 +01:00
136 changed files with 12043 additions and 1194 deletions

View File

@@ -68,7 +68,7 @@ int mysql_update(THD *thd,
SQL_SELECT *select;
READ_RECORD info;
TABLE_LIST *update_table_list= ((TABLE_LIST*)
thd->lex.select_lex.table_list.first);
thd->lex->select_lex.table_list.first);
TABLE_LIST tables;
List<Item> all_fields;
DBUG_ENTER("mysql_update");
@@ -79,7 +79,7 @@ int mysql_update(THD *thd,
if ((open_and_lock_tables(thd, table_list)))
DBUG_RETURN(-1);
thd->proc_info="init";
fix_tables_pointers(thd->lex.all_selects_list);
fix_tables_pointers(thd->lex->all_selects_list);
table= table_list->table;
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
@@ -97,10 +97,10 @@ int mysql_update(THD *thd,
if (setup_tables(update_table_list) ||
setup_conds(thd,update_table_list,&conds) ||
thd->lex.select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex.select_lex.ref_pointer_array,
thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
&tables, all_fields, all_fields, order) ||
setup_ftfuncs(&thd->lex.select_lex))
setup_ftfuncs(&thd->lex->select_lex))
DBUG_RETURN(-1); /* purecov: inspected */
/* Check that we are not using table that we are updating in a sub select */
@@ -144,7 +144,7 @@ int mysql_update(THD *thd,
#endif
if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0))
{
free_underlaid_joins(thd, &thd->lex.select_lex);
free_underlaid_joins(thd, &thd->lex->select_lex);
DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -155,7 +155,7 @@ int mysql_update(THD *thd,
(select && select->check_quick(thd, safe_update, limit)) || !limit)
{
delete select;
free_underlaid_joins(thd, &thd->lex.select_lex);
free_underlaid_joins(thd, &thd->lex->select_lex);
if (error)
{
DBUG_RETURN(-1); // Error in where
@@ -166,7 +166,7 @@ int mysql_update(THD *thd,
/* If running in safe sql mode, don't allow updates without keys */
if (table->quick_keys.is_clear_all())
{
thd->lex.select_lex.options|=QUERY_NO_INDEX_USED;
thd->lex->select_lex.options|=QUERY_NO_INDEX_USED;
if (safe_update && !using_limit)
{
my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE,
@@ -174,7 +174,7 @@ int mysql_update(THD *thd,
goto err;
}
}
init_ftfuncs(thd, &thd->lex.select_lex, 1);
init_ftfuncs(thd, &thd->lex->select_lex, 1);
/* Check if we are modifying a key that we are used to search with */
if (select && select->quick)
used_key_is_modified= (!select->quick->unique_key_range() &&
@@ -349,7 +349,6 @@ int mysql_update(THD *thd,
log_delayed= (transactional_table || table->tmp_table);
if (updated && (error <= 0 || !transactional_table))
{
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
@@ -373,9 +372,9 @@ int mysql_update(THD *thd,
}
delete select;
free_underlaid_joins(thd, &thd->lex.select_lex);
free_underlaid_joins(thd, &thd->lex->select_lex);
if (error >= 0)
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); /* purecov: inspected */
send_error(thd,thd->killed_errno()); /* purecov: inspected */
else
{
char buff[80];
@@ -392,7 +391,7 @@ int mysql_update(THD *thd,
err:
delete select;
free_underlaid_joins(thd, &thd->lex.select_lex);
free_underlaid_joins(thd, &thd->lex->select_lex);
if (table->key_read)
{
table->key_read=0;
@@ -429,7 +428,7 @@ int mysql_multi_update(THD *thd,
#endif
if ((res=open_and_lock_tables(thd,table_list)))
DBUG_RETURN(res);
fix_tables_pointers(thd->lex.all_selects_list);
fix_tables_pointers(thd->lex->all_selects_list);
select_lex->select_limit= HA_POS_ERROR;
if (setup_fields(thd, 0, table_list, *fields, 1, 0, 0))
@@ -977,7 +976,6 @@ bool multi_update::send_eof()
if (updated && (local_error <= 0 || !trans_safe))
{
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,