1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

After merge fixes

config/ac-macros/character_sets.m4:
  Added latin1_spanish_ci
dbug/dbug_analyze.c:
  Remove compiler warnings
include/my_handler.h:
  Reorder structure arguments to be more optimal
innobase/dict/dict0load.c:
  Fixed wrong define tag (for MySQL 5.0)
innobase/fil/fil0fil.c:
  Fixed compiler warning
innobase/os/os0file.c:
  Fixed compiler warning
myisam/ft_boolean_search.c:
  Fixed compiler warning
myisam/ft_static.c:
  Update to use new HA_KEYSEG structure
myisam/mi_open.c:
  Simple optimization
myisammrg/myrg_static.c:
  Removed compiler warning
mysql-test/r/grant.result:
  Update results after merge
mysql-test/r/index_merge.result:
  Update results after merge
mysql-test/r/information_schema_inno.result:
  Add missing drop table
mysql-test/r/lowercase_table.result:
  safety fix
mysql-test/r/multi_update.result:
  safety fix
mysql-test/r/ps_1general.result:
  safety fix
mysql-test/r/ps_2myisam.result:
  Update results after merge
  (set is not anymore of binary type)
mysql-test/r/ps_3innodb.result:
  Update results after merge
mysql-test/r/ps_4heap.result:
  Update results after merge
mysql-test/r/ps_5merge.result:
  Update results after merge
mysql-test/r/ps_6bdb.result:
  Update results after merge
mysql-test/r/show_check.result:
  Update results after merge
mysql-test/r/subselect.result:
  Update results after merge
  (added missing quotes)
mysql-test/r/timezone2.result:
  Update results after merge
mysql-test/r/view.result:
  Update results after merge
  (note that INSERT IGNORE will work again after next merge from 4.1)
mysql-test/t/derived.test:
  Removed empty line
mysql-test/t/grant.test:
  Update results after merge
mysql-test/t/information_schema_inno.test:
  added missing drop table
mysql-test/t/lowercase_table.test:
  safety fix
mysql-test/t/multi_update.test:
  safety fix
mysql-test/t/ps_1general.test:
  safety fix
mysql-test/t/view.test:
  update error codes after merge
ndb/src/mgmsrv/main.cpp:
  after merge fix
ndb/tools/ndb_test_platform.cpp:
  removed compiler warnings
regex/main.c:
  remove compiler warnings
sql/field.cc:
  Remove compiler warning
sql/gen_lex_hash.cc:
  Added DBUG support
sql/ha_myisam.cc:
  Removed warning from valgrind
sql/ha_ndbcluster.cc:
  Remove compiler warning
sql/item_cmpfunc.cc:
  Better to use val_int() instead of val_real() as we don't want Item_func_nop_all to return different value than the original ref element
sql/mysqld.cc:
  Remove compiler warning
sql/sql_acl.cc:
  More debugging
sql/sql_lex.cc:
  Remove unnecessary 'else'
sql/sql_parse.cc:
  After merge fixes
  Simplify reset of thd->server_status for SQLCOM_CALL
sql/sql_prepare.cc:
  After merge fixes
  Removed possible core dump in mysql_stmt_fetch()
sql/sql_update.cc:
  After merge fixes (together with Sanja)
strings/ctype-czech.c:
  Remove compiler warning
strings/ctype-ucs2.c:
  Remove compiler warning
strings/ctype-win1250ch.c:
  Remove compiler warning
strings/xml.c:
  Remove compiler warning
tests/client_test.c:
  Fix test to work with 5.0
vio/test-sslserver.c:
  Portability fix
This commit is contained in:
unknown
2004-12-31 00:44:00 +02:00
parent bb2d3eaa30
commit 2e8d13c73e
64 changed files with 295 additions and 249 deletions

View File

@@ -180,6 +180,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
char *query= thd->query;
#endif
thr_lock_type lock_type = table_list->lock_type;
Item *unused_conds= 0;
DBUG_ENTER("mysql_insert");
/*
@@ -244,7 +245,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
values= its++;
if (mysql_prepare_insert(thd, table_list, table, fields, values,
update_fields, update_values, duplic))
update_fields, update_values, duplic, &unused_conds,
FALSE))
goto abort;
/* mysql_prepare_insert set table_list->table if it was not set */
@@ -651,6 +653,10 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
mysql_prepare_insert()
thd Thread handler
table_list Global/local table list
table Table to insert into (can be NULL if table should be taken from
table_list->table)
where Where clause (for insert ... select)
select_insert TRUE if INSERT ... SELECT statement
RETURN VALUE
FALSE OK
@@ -660,11 +666,11 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
List<Item> &fields, List_item *values,
List<Item> &update_fields, List<Item> &update_values,
enum_duplicates duplic)
enum_duplicates duplic,
COND **where, bool select_insert)
{
bool insert_into_view= (table_list->view != 0);
/* TODO: use this condition for 'WITH CHECK OPTION' */
Item *unused_conds= 0;
bool res;
DBUG_ENTER("mysql_prepare_insert");
DBUG_PRINT("enter", ("table_list 0x%lx, table 0x%lx, view %d",
@@ -675,11 +681,11 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
{
/* it should be allocated before Item::fix_fields() */
if (table_list->set_insert_values(thd->mem_root))
goto abort;
DBUG_RETURN(TRUE);
}
if (mysql_prepare_insert_check_table(thd, table_list, fields, &unused_conds,
FALSE))
if (mysql_prepare_insert_check_table(thd, table_list, fields, where,
select_insert))
DBUG_RETURN(TRUE);
if ((values && check_insert_fields(thd, table_list, fields, *values, 1,
@@ -799,7 +805,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
DBUG_ASSERT(table->insert_values != NULL);
store_record(table,insert_values);
restore_record(table,record[1]);
DBUG_ASSERT(info->update_fields->elements == info->update_values->elements);
DBUG_ASSERT(info->update_fields->elements ==
info->update_values->elements);
if (fill_record(thd, *info->update_fields, *info->update_values, 0))
goto err;
@@ -808,7 +815,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
(res= info->view->view_check_option(current_thd, info->ignore)) ==
VIEW_CHECK_SKIP)
break;
else if (res == VIEW_CHECK_ERROR)
if (res == VIEW_CHECK_ERROR)
goto err;
if ((error=table->file->update_row(table->record[1],table->record[0])))
@@ -1715,23 +1722,25 @@ bool delayed_insert::handle_inserts(void)
bool mysql_insert_select_prepare(THD *thd)
{
LEX *lex= thd->lex;
TABLE_LIST* first_select_table=
(TABLE_LIST*)lex->select_lex.table_list.first;
TABLE_LIST* first_select_leaf_table;
TABLE_LIST *first_select_table=
(TABLE_LIST*) lex->select_lex.table_list.first;
TABLE_LIST *first_select_leaf_table;
int res;
DBUG_ENTER("mysql_insert_select_prepare");
/*
SELECT_LEX do not belong to INSERT statement, so we can't add WHERE
clasue if table is VIEW
clause if table is VIEW
*/
lex->query_tables->no_where_clause= 1;
if (mysql_prepare_insert_check_table(thd, lex->query_tables,
lex->field_list,
&lex->select_lex.where,
TRUE))
if (mysql_prepare_insert(thd, lex->query_tables,
lex->query_tables->table, lex->field_list, 0,
lex->update_list, lex->value_list,
lex->duplicates,
&lex->select_lex.where, TRUE))
DBUG_RETURN(TRUE);
/*
setup was done in mysql_insert_select_prepare, but we have to mark
setup was done in mysql_prepare_insert_check_table, but we have to mark
first local table
*/
if (first_select_table)