From 44a20071110de15cdedf299c8f6697846ac8e84d Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Wed, 18 May 2005 17:30:11 +0500 Subject: [PATCH 01/22] a fix (bug #10539: When inserting out of range value in BIT, different engines behaves differently). --- mysql-test/r/type_bit.result | 8 ++++++++ mysql-test/t/type_bit.test | 9 +++++++++ sql/field.cc | 5 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index 64c9a11b3cd..4d9bc0c7fe1 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -458,3 +458,11 @@ select h from t1; h a drop table t1; +create table t1 (a bit(8)) engine=heap; +insert into t1 values ('1111100000'); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +select a+0 from t1; +a+0 +255 +drop table t1; diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 19d16f95990..2df5f0ed05d 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -162,3 +162,12 @@ create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), insert into t1 set a=1; select h from t1; drop table t1; + +# +# Bug #10539 +# + +create table t1 (a bit(8)) engine=heap; +insert into t1 values ('1111100000'); +select a+0 from t1; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 34c5210b43c..0b4445d45c2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7821,7 +7821,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) int Field_bit::store(double nr) { - return (Field_bit::store((longlong) nr)); + return store((longlong) nr); } @@ -8004,7 +8004,8 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) (delta == 0 && bits && (uint) (uchar) *from >= (uint) (1 << bits))) { memset(ptr, 0xff, field_length); - *ptr&= ((1 << bits) - 1); /* set first byte */ + if (bits) + *ptr&= ((1 << bits) - 1); /* set first byte */ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } From 7538ce70d52142201d75ef9dcc465e12c632f976 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 30 May 2005 20:48:40 +0300 Subject: [PATCH 02/22] Fixed bug in multiple-table-delete where some rows was not deleted --- mysql-test/r/delete.result | 22 +++++++++- mysql-test/t/delete.test | 19 +++++++- sql/item_subselect.cc | 3 +- sql/opt_range.cc | 8 ++-- sql/sql_class.h | 5 ++- sql/sql_delete.cc | 88 ++++++++++++++++++++++---------------- 6 files changed, 97 insertions(+), 48 deletions(-) diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 411cd52b4ca..ddfeeac77b5 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -1,4 +1,4 @@ -drop table if exists t1,t11,t12,t2; +drop table if exists t1,t2,t3,t11,t12; CREATE TABLE t1 (a tinyint(3), b tinyint(5)); INSERT INTO t1 VALUES (1,1); INSERT LOW_PRIORITY INTO t1 VALUES (1,2); @@ -172,3 +172,23 @@ a 0 2 DROP TABLE t1; +CREATE TABLE t1 (a int not null,b int not null); +CREATE TABLE t2 (a int not null, b int not null, primary key (a,b)); +CREATE TABLE t3 (a int not null, b int not null, primary key (a,b)); +insert into t1 values (1,1),(2,1),(1,3); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(1,3); +select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +a b a b a b +1 1 1 1 1 1 +2 1 2 2 2 1 +1 3 1 1 1 3 +explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index +1 SIMPLE t3 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index +delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +select * from t3; +a b +drop table t1,t2,t3; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index a6335d77a0c..265089adfa2 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1,t11,t12,t2; +drop table if exists t1,t2,t3,t11,t12; --enable_warnings CREATE TABLE t1 (a tinyint(3), b tinyint(5)); INSERT INTO t1 VALUES (1,1); @@ -152,3 +152,20 @@ INSERT INTO t1 VALUES (0),(1),(2); DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; SELECT * FROM t1; DROP TABLE t1; + +# +# Test of multi-delete where we are not scanning the first table +# + +CREATE TABLE t1 (a int not null,b int not null); +CREATE TABLE t2 (a int not null, b int not null, primary key (a,b)); +CREATE TABLE t3 (a int not null, b int not null, primary key (a,b)); +insert into t1 values (1,1),(2,1),(1,3); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(1,3); +select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +# This should be empty +select * from t3; +drop table t1,t2,t3; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 0fbcf32a83c..7f8f0d5d527 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -773,9 +773,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, Comp_creator *func) { Item_subselect::trans_res result= RES_ERROR; - DBUG_ENTER("Item_in_subselect::single_value_transformer"); - SELECT_LEX *select_lex= join->select_lex; + DBUG_ENTER("Item_in_subselect::single_value_transformer"); /* Check that the right part of the subselect contains no more than one diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 0aa0468fc36..7da2990180d 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7957,7 +7957,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat() max_used_key_length= real_prefix_len; if (min_max_ranges.elements > 0) { - QUICK_RANGE *cur_range= 0; + QUICK_RANGE *cur_range; if (have_min) { /* Check if the right-most range has a lower boundary. */ get_dynamic(&min_max_ranges, (gptr)&cur_range, @@ -7965,7 +7965,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat() if (!(cur_range->flag & NO_MIN_RANGE)) { max_used_key_length+= min_max_arg_len; - ++used_key_parts; + used_key_parts++; return; } } @@ -7975,7 +7975,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat() if (!(cur_range->flag & NO_MAX_RANGE)) { max_used_key_length+= min_max_arg_len; - ++used_key_parts; + used_key_parts++; return; } } @@ -7983,7 +7983,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat() else if (have_min && min_max_arg_part && min_max_arg_part->field->is_null()) { max_used_key_length+= min_max_arg_len; - ++used_key_parts; + used_key_parts++; } } diff --git a/sql/sql_class.h b/sql/sql_class.h index 47987f3a0c6..e7539aaa517 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1854,7 +1854,8 @@ class multi_delete :public select_result_interceptor ha_rows deleted, found; uint num_of_tables; int error; - bool do_delete, transactional_tables, normal_tables; + bool do_delete, transactional_tables, normal_tables, delete_while_scanning; + public: multi_delete(THD *thd, TABLE_LIST *dt, uint num_of_tables); ~multi_delete(); @@ -1862,7 +1863,7 @@ public: bool send_data(List &items); bool initialize_tables (JOIN *join); void send_error(uint errcode,const char *err); - int do_deletes (bool from_send_error); + int do_deletes(); bool send_eof(); }; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 97830f7ec8f..4c45d5d00a0 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -411,7 +411,7 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt, num_of_tables(num_of_tables_arg), error(0), do_delete(0), transactional_tables(0), normal_tables(0) { - tempfiles = (Unique **) sql_calloc(sizeof(Unique *) * (num_of_tables-1)); + tempfiles= (Unique **) sql_calloc(sizeof(Unique *) * num_of_tables); } @@ -441,6 +441,7 @@ multi_delete::initialize_tables(JOIN *join) tables_to_delete_from|= walk->table->map; walk= delete_tables; + delete_while_scanning= 1; for (JOIN_TAB *tab=join->join_tab, *end=join->join_tab+join->tables; tab < end; tab++) @@ -460,10 +461,25 @@ multi_delete::initialize_tables(JOIN *join) else normal_tables= 1; } + else if ((tab->type != JT_SYSTEM && tab->type != JT_CONST) && + walk == delete_tables) + { + /* + We are not deleting from the table we are scanning. In this + case send_data() shouldn't delete any rows a we may touch + the rows in the deleted table many times + */ + delete_while_scanning= 0; + } } walk= delete_tables; tempfiles_ptr= tempfiles; - for (walk= walk->next_local ;walk ;walk= walk->next_local) + if (delete_while_scanning) + { + table_being_deleted= delete_tables; + walk= walk->next_local; + } + for (;walk ;walk= walk->next_local) { TABLE *table=walk->table; *tempfiles_ptr++= new Unique (refpos_order_cmp, @@ -482,12 +498,12 @@ multi_delete::~multi_delete() table_being_deleted; table_being_deleted= table_being_deleted->next_local) { - TABLE *t=table_being_deleted->table; - free_io_cache(t); // Alloced by unique - t->no_keyread=0; + TABLE *table= table_being_deleted->table; + free_io_cache(table); // Alloced by unique + table->no_keyread=0; } - for (uint counter= 0; counter < num_of_tables-1; counter++) + for (uint counter= 0; counter < num_of_tables; counter++) { if (tempfiles[counter]) delete tempfiles[counter]; @@ -497,14 +513,15 @@ multi_delete::~multi_delete() bool multi_delete::send_data(List &values) { - int secure_counter= -1; + int secure_counter= delete_while_scanning ? -1 : 0; + TABLE_LIST *del_table; DBUG_ENTER("multi_delete::send_data"); - for (table_being_deleted= delete_tables; - table_being_deleted; - table_being_deleted= table_being_deleted->next_local, secure_counter++) + for (del_table= delete_tables; + del_table; + del_table= del_table->next_local, secure_counter++) { - TABLE *table=table_being_deleted->table; + TABLE *table= del_table->table; /* Check if we are using outer join and we didn't find the row */ if (table->status & (STATUS_NULL_ROW | STATUS_DELETED)) @@ -515,7 +532,8 @@ bool multi_delete::send_data(List &values) if (secure_counter < 0) { - /* If this is the table we are scanning */ + /* We are scanning the current table */ + DBUG_ASSERT(del_table == table_being_deleted); if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_DELETE, TRG_ACTION_BEFORE, FALSE)) @@ -529,8 +547,7 @@ bool multi_delete::send_data(List &values) TRG_ACTION_AFTER, FALSE)) DBUG_RETURN(1); } - else if (!table_being_deleted->next_local || - table_being_deleted->table->file->has_transactions()) + else { table->file->print_error(error,MYF(0)); DBUG_RETURN(1); @@ -541,7 +558,7 @@ bool multi_delete::send_data(List &values) error=tempfiles[secure_counter]->unique_add((char*) table->file->ref); if (error) { - error=-1; + error= 1; // Fatal error DBUG_RETURN(1); } } @@ -564,22 +581,24 @@ void multi_delete::send_error(uint errcode,const char *err) /* Something already deleted so we have to invalidate cache */ query_cache_invalidate3(thd, delete_tables, 1); - /* Below can happen when thread is killed early ... */ - if (!table_being_deleted) - table_being_deleted=delete_tables; - /* If rows from the first table only has been deleted and it is transactional, just do rollback. The same if all tables are transactional, regardless of where we are. In all other cases do attempt deletes ... */ - if ((table_being_deleted->table->file->has_transactions() && - table_being_deleted == delete_tables) || !normal_tables) + if ((table_being_deleted == delete_tables && + table_being_deleted->table->file->has_transactions()) || + !normal_tables) ha_rollback_stmt(thd); else if (do_delete) { - VOID(do_deletes(1)); + /* + We have to execute the recorded do_deletes() and write info into the + error log + */ + error= 1; + send_eof(); } DBUG_VOID_RETURN; } @@ -592,27 +611,20 @@ void multi_delete::send_error(uint errcode,const char *err) 1 error */ -int multi_delete::do_deletes(bool from_send_error) +int multi_delete::do_deletes() { int local_error= 0, counter= 0; DBUG_ENTER("do_deletes"); + DBUG_ASSERT(do_delete); - if (from_send_error) - { - /* Found out table number for 'table_being_deleted*/ - for (TABLE_LIST *aux= delete_tables; - aux != table_being_deleted; - aux= aux->next_local) - counter++; - } - else - table_being_deleted = delete_tables; - - do_delete= 0; + do_delete= 0; // Mark called if (!found) DBUG_RETURN(0); - for (table_being_deleted= table_being_deleted->next_local; - table_being_deleted; + + table_being_deleted= (delete_while_scanning ? delete_tables->next_local : + delete_tables); + + for (; table_being_deleted; table_being_deleted= table_being_deleted->next_local, counter++) { TABLE *table = table_being_deleted->table; @@ -674,7 +686,7 @@ bool multi_delete::send_eof() thd->proc_info="deleting from reference tables"; /* Does deletes for the last n - 1 tables, returns 0 if ok */ - int local_error= do_deletes(0); // returns 0 if success + int local_error= do_deletes(); // returns 0 if success /* reset used flags */ thd->proc_info="end"; From 086d81207b170b38a19c344923d9df46e406675e Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Wed, 1 Jun 2005 17:09:46 +0500 Subject: [PATCH 03/22] A fix (bug #10568: Function 'LAST_DAY(date)' does not return NULL for invalid argument). --- mysql-test/r/func_time.result | 15 +++++++++++++++ mysql-test/t/func_time.test | 8 ++++++++ sql/item_timefunc.cc | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 4293ef5bd85..58f9271dce9 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -688,3 +688,18 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2` +select last_day('2005-00-00'); +last_day('2005-00-00') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2005-00-00' +select last_day('2005-00-01'); +last_day('2005-00-01') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2005-00-01' +select last_day('2005-01-00'); +last_day('2005-01-00') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2005-01-00' diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 80ddb205110..b44215c97b1 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -336,3 +336,11 @@ DROP TABLE t1; explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1, timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2; + +# +# Bug #10568 +# + +select last_day('2005-00-00'); +select last_day('2005-00-01'); +select last_day('2005-01-00'); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3b6ca48fadd..16882e56d88 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3015,7 +3015,7 @@ String *Item_func_str_to_date::val_str(String *str) bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date) { - if (get_arg0_date(ltime,fuzzy_date)) + if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE)) return 1; uint month_idx= ltime->month-1; ltime->day= days_in_month[month_idx]; From a69f4321155fced6ef3a771e68b7dab1d2f119cc Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 1 Jun 2005 16:35:09 +0300 Subject: [PATCH 04/22] Code cleanups during code reviews Ensure we get error if INSERT IGNORE ... SELECT fails Fixed wrong key_part->key_length usage in index_merge --- client/mysql.cc | 31 +++---- mysql-test/r/information_schema.result | 1 + mysql-test/t/information_schema.test | 5 ++ sql/ha_ndbcluster.cc | 6 +- sql/item.cc | 10 +-- sql/item_subselect.cc | 2 +- sql/item_sum.cc | 8 +- sql/opt_range.cc | 112 +++++++++++++------------ sql/parse_file.cc | 4 +- sql/sql_base.cc | 2 +- sql/sql_bitmap.h | 2 +- sql/sql_insert.cc | 3 +- sql/sql_select.cc | 2 +- sql/sql_show.cc | 14 +++- sql/sql_update.cc | 2 +- sql/table.cc | 12 +-- sql/table.h | 3 - sql/uniques.cc | 2 +- strings/decimal.c | 36 +++++--- 19 files changed, 144 insertions(+), 113 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 9cdc270e8ed..9733089c324 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1657,11 +1657,12 @@ int mysql_real_query_for_lazy(const char *buf, int length) { for (uint retry=0;; retry++) { + int error; if (!mysql_real_query(&mysql,buf,length)) return 0; - int error= put_error(&mysql); + error= put_error(&mysql); if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 || - !opt_reconnect) + !opt_reconnect) return error; if (reconnect()) return error; @@ -2237,22 +2238,23 @@ print_table_data_vertically(MYSQL_RES *result) } } + /* print_warnings should be called right after executing a statement */ -static void -print_warnings() + +static void print_warnings() { - char query[30]; + const char *query; MYSQL_RES *result; MYSQL_ROW cur; + my_ulonglong num_rows; /* Get the warnings */ - strmov(query,"show warnings"); - mysql_real_query_for_lazy(query,strlen(query)); + query= "show warnings"; + mysql_real_query_for_lazy(query, strlen(query)); mysql_store_result_for_lazy(&result); /* Bail out when no warnings */ - my_ulonglong num_rows = mysql_num_rows(result); - if (num_rows == 0) + if (!(num_rows= mysql_num_rows(result))) { mysql_free_result(result); return; @@ -2266,13 +2268,12 @@ print_warnings() mysql_free_result(result); } -static const char -*array_value(const char **array, char key) + +static const char *array_value(const char **array, char key) { - int x; - for (x= 0; array[x]; x+= 2) - if (*array[x] == key) - return array[x + 1]; + for (; *array; array+= 2) + if (**array == key) + return array[1]; return 0; } diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 872d1f6ea7f..de1f265aedf 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t0,t1,t2; show variables where variable_name like "skip_show_database"; Variable_name Value skip_show_database OFF diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 05dfeb67ccc..1a6e41dba69 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -4,6 +4,11 @@ # Test for information_schema.schemata & # show databases +--disable_warnings +DROP TABLE IF EXISTS t0,t1,t2; +--enable_warnings + + show variables where variable_name like "skip_show_database"; grant select, update, execute on test.* to mysqltest_2@localhost; grant select, update on test.* to mysqltest_1@localhost; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 208c97ccd7f..058e39de631 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -5590,8 +5590,8 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, const NDBINDEX *idx= (NDBINDEX *) m_index[active_index].index; const NdbOperation* lastOp= m_active_trans->getLastDefinedOperation(); NdbIndexScanOperation* scanOp= 0; - for(; multi_range_currs->reclength; const NdbOperation* op= m_current_multi_operation; - for(;multi_range_curr < m_multi_range_defined; multi_range_curr++) + for (;multi_range_curr < m_multi_range_defined; multi_range_curr++) { if (multi_range_curr->range_flag & UNIQUE_RANGE) { diff --git a/sql/item.cc b/sql/item.cc index 52046b8eefb..ca8bbfa8067 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2246,9 +2246,8 @@ bool Item_param::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) SELECT_LEX_UNIT::item set only for subqueries, so test of it presence can be barrier to stop before derived table SELECT or very outer SELECT */ - for(; - cursel->master_unit()->item; - cursel= cursel->outer_select()) + for (; cursel->master_unit()->item; + cursel= cursel->outer_select()) { Item_subselect *subselect_item= cursel->master_unit()->item; subselect_item->used_tables_cache|= OUTER_REF_TABLE_BIT; @@ -2528,9 +2527,8 @@ void mark_select_range_as_dependent(THD *thd, resolving) */ SELECT_LEX *previous_select= current_sel; - for(; - previous_select->outer_select() != last_select; - previous_select= previous_select->outer_select()) + for (; previous_select->outer_select() != last_select; + previous_select= previous_select->outer_select()) { Item_subselect *prev_subselect_item= previous_select->master_unit()->item; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 5be9dbb8fb4..af5ec7eee61 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1646,7 +1646,7 @@ void subselect_uniquesubquery_engine::exclude() table_map subselect_engine::calc_const_tables(TABLE_LIST *table) { table_map map= 0; - for(; table; table= table->next_leaf) + for (; table; table= table->next_leaf) { TABLE *tbl= table->table; if (tbl && tbl->const_table) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b9f3cc49d64..9da915c8c2a 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -240,8 +240,12 @@ Item_sum_hybrid::Item_sum_hybrid(THD *thd, Item_sum_hybrid *item) case REAL_RESULT: sum= item->sum; break; - case STRING_RESULT: // This can happen with ROLLUP. Note that the value is already - break; // copied at function call. + case STRING_RESULT: + /* + This can happen with ROLLUP. Note that the value is already + copied at function call. + */ + break; case ROW_RESULT: default: DBUG_ASSERT(0); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index be8fa61f648..b3301d17655 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -396,7 +396,7 @@ TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree); static int get_index_merge_params(PARAM *param, key_map& needed_reg, SEL_IMERGE *imerge, double *read_time, ha_rows* imerge_rows); -inline double get_index_only_read_time(const PARAM* param, ha_rows records, +static double get_index_only_read_time(const PARAM* param, ha_rows records, int keynr); #ifndef DBUG_OFF @@ -1115,6 +1115,7 @@ int QUICK_ROR_UNION_SELECT::init() val1 First merged select val2 Second merged select */ + int QUICK_ROR_UNION_SELECT::queue_cmp(void *arg, byte *val1, byte *val2) { QUICK_ROR_UNION_SELECT *self= (QUICK_ROR_UNION_SELECT*)arg; @@ -1582,7 +1583,7 @@ static int fill_used_fields_bitmap(PARAM *param) KEY_PART_INFO *key_part= param->table->key_info[pk].key_part; KEY_PART_INFO *key_part_end= key_part + param->table->key_info[pk].key_parts; - for(;key_part != key_part_end; ++key_part) + for (;key_part != key_part_end; ++key_part) { bitmap_clear_bit(¶m->needed_fields, key_part->fieldnr); } @@ -1746,18 +1747,20 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, double best_read_time= read_time; if (cond) - tree= get_mm_tree(¶m,cond); - - if (tree && tree->type == SEL_TREE::IMPOSSIBLE) { - records=0L; /* Return -1 from this function. */ - read_time= (double) HA_POS_ERROR; - goto free_mem; + if ((tree= get_mm_tree(¶m,cond))) + { + if (tree->type == SEL_TREE::IMPOSSIBLE) + { + records=0L; /* Return -1 from this function. */ + read_time= (double) HA_POS_ERROR; + goto free_mem; + } + if (tree->type != SEL_TREE::KEY && + tree->type != SEL_TREE::KEY_SMALLER) + goto free_mem; + } } - else if (tree && tree->type != SEL_TREE::KEY && - tree->type != SEL_TREE::KEY_SMALLER) - goto free_mem; - /* Try to construct a QUICK_GROUP_MIN_MAX_SELECT. @@ -2248,7 +2251,7 @@ skip_to_ror_scan: clustered index) */ -inline double get_index_only_read_time(const PARAM* param, ha_rows records, +static double get_index_only_read_time(const PARAM* param, ha_rows records, int keynr) { double read_time; @@ -2294,6 +2297,7 @@ typedef struct st_ror_scan_info param Parameter from test_quick_select function idx Index of key in param->keys sel_arg Set of intervals for a given key + RETURN NULL - out of memory ROR scan structure containing a scan for {idx, sel_arg} @@ -2306,19 +2310,20 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg) uchar *bitmap_buf; uint keynr; DBUG_ENTER("make_ror_scan"); + if (!(ror_scan= (ROR_SCAN_INFO*)alloc_root(param->mem_root, sizeof(ROR_SCAN_INFO)))) DBUG_RETURN(NULL); ror_scan->idx= idx; ror_scan->keynr= keynr= param->real_keynr[idx]; - ror_scan->key_rec_length= param->table->key_info[keynr].key_length + - param->table->file->ref_length; + ror_scan->key_rec_length= (param->table->key_info[keynr].key_length + + param->table->file->ref_length); ror_scan->sel_arg= sel_arg; ror_scan->records= param->table->quick_rows[keynr]; if (!(bitmap_buf= (uchar*)alloc_root(param->mem_root, - param->fields_bitmap_size))) + param->fields_bitmap_size))) DBUG_RETURN(NULL); if (bitmap_init(&ror_scan->covered_fields, bitmap_buf, @@ -2329,14 +2334,10 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg) KEY_PART_INFO *key_part= param->table->key_info[keynr].key_part; KEY_PART_INFO *key_part_end= key_part + param->table->key_info[keynr].key_parts; - uint n_used_covered= 0; for (;key_part != key_part_end; ++key_part) { if (bitmap_is_set(¶m->needed_fields, key_part->fieldnr)) - { - n_used_covered++; bitmap_set_bit(&ror_scan->covered_fields, key_part->fieldnr); - } } ror_scan->index_read_cost= get_index_only_read_time(param, param->table->quick_rows[ror_scan->keynr], @@ -2357,6 +2358,7 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg) 0 a = b 1 a > b */ + static int cmp_ror_scan_info(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b) { double val1= rows2double((*a)->records) * (*a)->key_rec_length; @@ -2380,6 +2382,7 @@ static int cmp_ror_scan_info(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b) 0 a = b 1 a > b */ + static int cmp_ror_scan_info_covering(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b) { if ((*a)->used_fields_covered > (*b)->used_fields_covered) @@ -2397,6 +2400,7 @@ static int cmp_ror_scan_info_covering(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b) return 0; } + /* Auxiliary structure for incremental ROR-intersection creation */ typedef struct { @@ -2462,6 +2466,8 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) dst->index_scan_costs= src->index_scan_costs; dst->total_cost= src->total_cost; } + + /* Get selectivity of a ROR scan wrt ROR-intersection. @@ -2479,7 +2485,7 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) where k_ij may be the same as any k_pq (i.e. keys may have common parts). - A full row is retrieved iff entire cond holds. + A full row is retrieved if entire condition holds. The recursive procedure for finding P(cond) is as follows: @@ -2490,7 +2496,7 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) Here R may still contain condition(s) equivalent to k_11=c_11. Nevertheless, the following holds: - P(k_11=c_11 AND R) = P(k_11=c_11) * P(R|k_11=c_11). + P(k_11=c_11 AND R) = P(k_11=c_11) * P(R | k_11=c_11). Mark k_11 as fixed field (and satisfied condition) F, save P(F), save R to be cond and proceed to recursion step. @@ -2537,7 +2543,7 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) ( this is result of application of option b) of the recursion step for parts of a single key). Since it is reasonable to expect that most of the fields are not marked - as fixed, we calcualate (3) as + as fixed, we calculate (3) as n_{i1} n_{i_2} (3) = n_{max_key_part} / ( --------- * --------- * .... ) @@ -2571,33 +2577,32 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, max_range.key= (byte*) key_val; max_range.flag= HA_READ_AFTER_KEY; ha_rows prev_records= info->param->table->file->records; - int i; DBUG_ENTER("ror_intersect_selectivity"); - for(i= 0, sel_arg= scan->sel_arg; sel_arg; - i++, sel_arg= sel_arg->next_key_part) + + for (sel_arg= scan->sel_arg; sel_arg; + sel_arg= sel_arg->next_key_part) { DBUG_PRINT("info",("sel_arg step")); cur_covered= test(bitmap_is_set(&info->covered_fields, - (key_part + i)->fieldnr)); + key_part[sel_arg->part].fieldnr)); if (cur_covered != prev_covered) { /* create (part1val, ..., part{n-1}val) tuple. */ - { - if (!tuple_arg) - { - tuple_arg= scan->sel_arg; - tuple_arg->store_min(key_part->length, &key_ptr, 0); - } - while (tuple_arg->next_key_part != sel_arg) - { - tuple_arg= tuple_arg->next_key_part; - tuple_arg->store_min(key_part->length, &key_ptr, 0); - } - } ha_rows records; + if (!tuple_arg) + { + tuple_arg= scan->sel_arg; + /* Here we use the length of the first key part */ + tuple_arg->store_min(key_part->length, &key_ptr, 0); + } + while (tuple_arg->next_key_part != sel_arg) + { + tuple_arg= tuple_arg->next_key_part; + tuple_arg->store_min(key_part[tuple_arg->part].length, &key_ptr, 0); + } min_range.length= max_range.length= ((char*) key_ptr - (char*) key_val); - records= info->param->table->file-> - records_in_range(scan->keynr, &min_range, &max_range); + records= (info->param->table->file-> + records_in_range(scan->keynr, &min_range, &max_range)); if (cur_covered) { /* uncovered -> covered */ @@ -2625,6 +2630,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, DBUG_RETURN(selectivity_mult); } + /* Check if adding a ROR scan to a ROR-intersection reduces its cost of ROR-intersection and if yes, update parameters of ROR-intersection, @@ -2662,7 +2668,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, */ static bool ror_intersect_add(ROR_INTERSECT_INFO *info, - ROR_SCAN_INFO* ror_scan, bool is_cpk_scan) + ROR_SCAN_INFO* ror_scan, bool is_cpk_scan) { double selectivity_mult= 1.0; @@ -3218,11 +3224,11 @@ QUICK_SELECT_I *TRP_INDEX_MERGE::make_quick(PARAM *param, quick_imerge->records= records; quick_imerge->read_time= read_cost; - for(TRP_RANGE **range_scan= range_scans; range_scan != range_scans_end; - range_scan++) + for (TRP_RANGE **range_scan= range_scans; range_scan != range_scans_end; + range_scan++) { if (!(quick= (QUICK_RANGE_SELECT*) - ((*range_scan)->make_quick(param, FALSE, &quick_imerge->alloc)))|| + ((*range_scan)->make_quick(param, FALSE, &quick_imerge->alloc)))|| quick_imerge->push_quick_back(quick)) { delete quick; @@ -3251,7 +3257,7 @@ QUICK_SELECT_I *TRP_ROR_INTERSECT::make_quick(PARAM *param, "creating ROR-intersect", first_scan, last_scan);); alloc= parent_alloc? parent_alloc: &quick_intrsect->alloc; - for(; first_scan != last_scan;++first_scan) + for (; first_scan != last_scan;++first_scan) { if (!(quick= get_quick_select(param, (*first_scan)->idx, (*first_scan)->sel_arg, alloc)) || @@ -3293,7 +3299,7 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param, */ if ((quick_roru= new QUICK_ROR_UNION_SELECT(param->thd, param->table))) { - for(scan= first_ror; scan != last_ror; scan++) + for (scan= first_ror; scan != last_ror; scan++) { if (!(quick= (*scan)->make_quick(param, FALSE, &quick_roru->alloc)) || quick_roru->push_quick_back(quick)) @@ -4196,7 +4202,7 @@ key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) clone_flag=swap_clone_flag(clone_flag); } - // If one of the key is MAYBE_KEY then the found region may be smaller + /* If one of the key is MAYBE_KEY then the found region may be smaller */ if (key2->type == SEL_ARG::MAYBE_KEY) { if (key1->use_count > 1) @@ -5329,8 +5335,8 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts) KEY_PART_INFO *pk_part= param->table->key_info[pk_number].key_part; KEY_PART_INFO *pk_part_end= pk_part + param->table->key_info[pk_number].key_parts; - for(;(key_part!=key_part_end) && (pk_part != pk_part_end); - ++key_part, ++pk_part) + for (;(key_part!=key_part_end) && (pk_part != pk_part_end); + ++key_part, ++pk_part) { if ((key_part->field != pk_part->field) || (key_part->length != pk_part->length)) @@ -7323,8 +7329,8 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item, DESCRIPTION Test conditions (NGA1, NGA2) from get_best_group_min_max(). Namely, - for each keypart field NGF_i not in GROUP-BY, check that there is a constant - equality predicate among conds with the form (NGF_i = const_ci) or + for each keypart field NGF_i not in GROUP-BY, check that there is a + constant equality predicate among conds with the form (NGF_i = const_ci) or (const_ci = NGF_i). Thus all the NGF_i attributes must fill the 'gap' between the last group-by attribute and the MIN/MAX attribute in the index (if present). If these @@ -8689,7 +8695,7 @@ static void print_ror_scans_arr(TABLE *table, const char *msg, char buff[1024]; String tmp(buff,sizeof(buff),&my_charset_bin); tmp.length(0); - for(;start != end; start++) + for (;start != end; start++) { if (tmp.length()) tmp.append(','); diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 6c3a81384a6..7cc563901d2 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -475,7 +475,7 @@ read_escaped_string(char *ptr, char *eol, LEX_STRING *str) { char *write_pos= str->str; - for(; ptr < eol; ptr++, write_pos++) + for (; ptr < eol; ptr++, write_pos++) { char c= *ptr; if (c == '\\') @@ -635,7 +635,7 @@ File_parser::parse(gptr base, MEM_ROOT *mem_root, File_option *parameter= parameters+first_param, *parameters_end= parameters+required; int len= 0; - for(; parameter < parameters_end; parameter++) + for (; parameter < parameters_end; parameter++) { len= parameter->name.length; // check length diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8fbe5bbfcb7..24e7a44c394 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -753,7 +753,7 @@ TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list) t_name= table->table_name; DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name)); - for(;;) + for (;;) { if (!(res= find_table_in_global_list(table_list, d_name, t_name)) || (!res->table || res->table != table->table) && diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 2fd603d9381..d8e93f1fd14 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -82,7 +82,7 @@ public: if (sizeof(buffer) >= 8) return uint8korr(buffer); DBUG_ASSERT(sizeof(buffer) >= 4); - uint4korr(buffer); + return (ulonglong) uint4korr(buffer); } }; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 5d87a4ca30b..3665699ae07 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -128,7 +128,7 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list, /* it is join view => we need to find table for update */ List_iterator_fast it(fields); Item *item; - TABLE_LIST *tbl= 0; + TABLE_LIST *tbl= 0; // reset for call to check_single_table() table_map map= 0; while ((item= it++)) @@ -1012,6 +1012,7 @@ ok_or_after_trg_err: err: info->last_errno= error; + thd->lex->current_select->no_error= 0; // Give error table->file->print_error(error,MYF(0)); before_trg_err: diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e8644d614f6..1e340caaa38 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13520,7 +13520,7 @@ static void print_join(THD *thd, String *str, List *tables) (*table)->print(thd, str); TABLE_LIST **end= table + tables->elements; - for(TABLE_LIST **tbl= table + 1; tbl < end; tbl++) + for (TABLE_LIST **tbl= table + 1; tbl < end; tbl++) { TABLE_LIST *curr= *tbl; if (curr->outer_join) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 32ad85b88f7..1e34f32184a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1265,7 +1265,7 @@ static bool show_status_array(THD *thd, const char *wild, name_buffer, wild))) { char *value=variables->value; - const char *pos, *end; + const char *pos, *end; // We assign a lot of const's long nr; if (show_type == SHOW_SYS) { @@ -1336,8 +1336,8 @@ static bool show_status_array(THD *thd, const char *wild, case SHOW_SLAVE_RETRIED_TRANS: { /* - TODO: in 5.1 with multimaster, have one such counter per line in SHOW - SLAVE STATUS, and have the sum over all lines here. + TODO: in 5.1 with multimaster, have one such counter per line in + SHOW SLAVE STATUS, and have the sum over all lines here. */ pthread_mutex_lock(&LOCK_active_mi); pthread_mutex_lock(&active_mi->rli.data_lock); @@ -1359,7 +1359,11 @@ static bool show_status_array(THD *thd, const char *wild, } else { - for (int i= 1; i < MAX_SLAVE_ERROR; i++) + /* 10 is enough assuming errors are max 4 digits */ + int i; + for (i= 1; + i < MAX_SLAVE_ERROR && (uint) (end-buff) < sizeof(buff)-10; + i++) { if (bitmap_is_set(bitmap, i)) { @@ -1369,6 +1373,8 @@ static bool show_status_array(THD *thd, const char *wild, } if (end != buff) end--; // Remove last ',' + if (i < MAX_SLAVE_ERROR) + end= strmov((char*) end, "..."); // Couldn't show all errors } break; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 0d00c38f638..6b9a8ddfcb6 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -710,7 +710,7 @@ bool mysql_multi_update_prepare(THD *thd) tl->table->reginfo.lock_type= tl->lock_type; } } - for(tl= table_list; tl; tl= tl->next_local) + for (tl= table_list; tl; tl= tl->next_local) { /* Check access privileges for table */ if (!tl->derived) diff --git a/sql/table.cc b/sql/table.cc index eb4dbe5a1f3..33cee79eb61 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2164,16 +2164,12 @@ bool st_table_list::check_single_table(st_table_list **table, table_map map, { if (*table) return TRUE; - else - { - *table= tbl; - tbl->check_option= view->check_option; - } + *table= tbl; + tbl->check_option= view->check_option; } } - else - if (tbl->check_single_table(table, map, view)) - return TRUE; + else if (tbl->check_single_table(table, map, view)) + return TRUE; } return FALSE; } diff --git a/sql/table.h b/sql/table.h index 8043429999b..8bc4e01852f 100644 --- a/sql/table.h +++ b/sql/table.h @@ -436,10 +436,7 @@ typedef struct st_table_list bool skip_temporary; /* this table shouldn't be temporary */ /* TRUE if this merged view contain auto_increment field */ bool contain_auto_increment; -#if 0 -#else bool multitable_view; /* TRUE iff this is multitable view */ -#endif /* FRMTYPE_ERROR if any type is acceptable */ enum frm_type_enum required_type; char timestamp_buffer[20]; /* buffer for timestamp (19+1) */ diff --git a/sql/uniques.cc b/sql/uniques.cc index b08727705e4..367aed2d113 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -178,7 +178,7 @@ static double get_merge_many_buffs_cost(uint *buffer, Set initial state: first maxbuffer sequences contain max_n_elems elements each, last sequence contains last_n_elems elements. */ - for(i = 0; i < (int)maxbuffer; i++) + for (i = 0; i < (int)maxbuffer; i++) buff_elems[i]= max_n_elems; buff_elems[maxbuffer]= last_n_elems; diff --git a/strings/decimal.c b/strings/decimal.c index 1e62333ee66..787d00dcb46 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1549,15 +1549,19 @@ decimal_round(decimal_t *from, decimal_t *to, int scale, } else { - while (unlikely(*buf1 == 0) && buf1 >= to->buf) - buf1--; - if (buf1 < to->buf) + for (;;) { - decimal_make_zero(to); - return E_DEC_OK; + if (likely(*buf1)) + break; + if (buf1-- == to->buf) + { + decimal_make_zero(to); + return E_DEC_OK; + } } } - if (scale<0) scale=0; + if (scale<0) + scale=0; done: to->frac=scale; @@ -1727,11 +1731,14 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2) buf1++, buf2++; if (buf1 <= end1) + { if (buf2 <= end2) carry= *buf2 > *buf1; else carry= 0; + } else + { if (buf2 <= end2) carry=1; else /* short-circuit everything: from1 == from2 */ @@ -1741,6 +1748,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) decimal_make_zero(to); return E_DEC_OK; } + } } if (to == 0) /* decimal_cmp() */ @@ -1937,10 +1945,18 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) { dec1 *buf= to->buf; dec1 *end= to->buf + intg0 + frac0; - for (; (buf Date: Fri, 3 Jun 2005 18:20:25 +0200 Subject: [PATCH 05/22] - include/config-win.h: removed double HAVE_CHARSET_cp932 #define - mysql-test/Makefile.am: added a pattern match for t/*.sql (t/mysql_delimiter.sql was missing from the source distribution) --- include/config-win.h | 1 - mysql-test/Makefile.am | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config-win.h b/include/config-win.h index b17e4df4e26..f6c72a85a60 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -392,7 +392,6 @@ inline double ulonglong2double(ulonglong value) /* #undef HAVE_CHARSET_armscii8 */ /* #undef HAVE_CHARSET_ascii */ #define HAVE_CHARSET_big5 1 -#define HAVE_CHARSET_cp932 #define HAVE_CHARSET_cp1250 1 /* #undef HAVE_CHARSET_cp1251 */ /* #undef HAVE_CHARSET_cp1256 */ diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 9963074daf5..a5e3f7977ee 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -48,6 +48,7 @@ dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ $(distdir)/std_data $(distdir)/lib $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include From 25a2c4a71eccb94b0311b9af60acbf8e85ad3db7 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Sun, 5 Jun 2005 17:01:20 +0300 Subject: [PATCH 06/22] Cleanup during review Simple optimization for 2 argument usage to function of variable arguments Fix stack overrun when using 1+1+1+1+1+1+1+.... Update crash-me results for 5.0 Don't call post_open if pre_open() fails (optimization) --- libmysql/libmysql.c | 2 +- mysql-test/mysql-test-run.sh | 2 +- mysql-test/t/type_newdecimal.test | 2 + mysys/my_alloc.c | 10 +- mysys/thr_lock.c | 6 +- sql-bench/limits/mysql-4.1.cfg | 7056 +++++++++++++++++++++++++++++ sql-bench/limits/mysql.cfg | 6047 +----------------------- sql/item.h | 2 + sql/item_func.cc | 7 +- sql/mysql_priv.h | 2 +- sql/sp_head.cc | 10 +- sql/sp_rcontext.cc | 37 +- sql/sql_parse.cc | 7 +- sql/sql_select.cc | 58 +- 14 files changed, 7199 insertions(+), 6049 deletions(-) create mode 100644 sql-bench/limits/mysql-4.1.cfg diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index c87728ab783..dc12ecb6519 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1738,7 +1738,7 @@ myodbc_remove_escape(MYSQL *mysql,char *name) /* Default number of rows fetched per one COM_FETCH command. */ -#define DEFAULT_PREFETCH_ROWS 1UL +#define DEFAULT_PREFETCH_ROWS (ulong) 1 /* These functions are called by function pointer MYSQL_STMT::read_row_func. diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 45b1e948ac2..bdd92e7941b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -887,7 +887,7 @@ report_stats () { found_error=0 # Find errors - for i in "^Warning:" "^Error:" "^==.* at 0x" + for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" do if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings then diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 9b09c415379..0f7d20ed977 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -911,7 +911,9 @@ DROP TABLE t1; # Bug #10465 # +--disable_warnings CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; +--enable_warnings INSERT INTO t1 (GRADE) VALUES (151),(252),(343); SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; SELECT GRADE FROM t1 WHERE GRADE= 151; diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index e0d6288f76b..072fc09cd12 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -39,10 +39,11 @@ DESCRIPTION This function prepares memory root for further use, sets initial size of chunk for memory allocation and pre-allocates first block if specified. - Altough error can happen during execution of this function if pre_alloc_size - is non-0 it won't be reported. Instead it will be reported as error in first - alloc_root() on this memory root. + Altough error can happen during execution of this function if + pre_alloc_size is non-0 it won't be reported. Instead it will be + reported as error in first alloc_root() on this memory root. */ + void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) { @@ -71,6 +72,7 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, DBUG_VOID_RETURN; } + /* SYNOPSIS reset_root_defaults() @@ -86,7 +88,7 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, reuse one of existing blocks as prealloc block, or malloc new one of requested size. If no blocks can be reused, all unused blocks are freed before allocation. - */ +*/ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 7761d2a9fc8..85a2b34b851 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -684,8 +684,10 @@ void thr_unlock(THR_LOCK_DATA *data) lock->read.last=data->prev; else if (lock_type == TL_WRITE_DELAYED && data->cond) { - /* This only happens in extreme circumstances when a - write delayed lock that is waiting for a lock */ + /* + This only happens in extreme circumstances when a + write delayed lock that is waiting for a lock + */ lock->write_wait.last=data->prev; /* Put it on wait queue */ } else diff --git a/sql-bench/limits/mysql-4.1.cfg b/sql-bench/limits/mysql-4.1.cfg new file mode 100644 index 00000000000..64f91f07363 --- /dev/null +++ b/sql-bench/limits/mysql-4.1.cfg @@ -0,0 +1,7056 @@ +#This file is automaticly generated by crash-me 1.61 + +NEG=yes # update of column= -column + ###< create table crash_q (a integer) + ###> OK + ###< insert into crash_q values(10) + ###> OK + ###< update crash_q set a=-a + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +Need_cast_for_null=no # Need to cast NULL for arithmetic + ### Check if numeric_null (NULL) is 'NULL' +alter_add_col=yes # Alter table add column + ###< alter table crash_q add d integer + ###> OK + ### + ###As far as all queries returned OK, result is YES +alter_add_constraint=yes # Alter table add constraint + ###< alter table crash_q add constraint c2 check(a > b) + ###> OK + ### + ###As far as all queries returned OK, result is YES +alter_add_foreign_key=no # Alter table add foreign key + ###< alter table crash_q add constraint f1 foreign key(c1) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + ###< references crash_q1(c1) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'references crash_q1(c1)' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +alter_add_multi_col=yes # Alter table add many columns + ###< alter table crash_q add (f integer,g integer) + ###> OK +alter_add_primary_key=with constraint # Alter table add primary key + ###< alter table crash_q1 add constraint p1 primary key(c1) + ###> OK +alter_add_unique=yes # Alter table add unique + ###< alter table crash_q add constraint u1 unique(c1) + ###> OK + ### + ###As far as all queries returned OK, result is YES +alter_alter_col=yes # Alter table alter column default + ###< alter table crash_q alter b set default 10 + ###> OK + ### + ###As far as all queries returned OK, result is YES +alter_change_col=yes # Alter table change column + ###< alter table crash_q change a e char(50) + ###> OK + ### + ###As far as all queries returned OK, result is YES +alter_drop_col=yes # Alter table drop column + ###< alter table crash_q drop column b + ###> OK +alter_drop_constraint=no # Alter table drop constraint + ###< alter table crash_q drop constraint c2 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint c2' at line 1 + ### + ###< alter table crash_q drop constraint c2 restrict + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint c2 restrict' at line 1 +alter_drop_foreign_key=with drop foreign key # Alter table drop foreign key + ###< alter table crash_q drop constraint f1 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint f1' at line 1 + ### + ###< alter table crash_q drop constraint f1 restrict + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint f1 restrict' at line 1 + ### + ###< alter table crash_q drop foreign key f1 + ###> OK +alter_drop_primary_key=drop primary key # Alter table drop primary key + ###< alter table crash_q1 drop constraint p1 restrict + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint p1 restrict' at line 1 + ### + ###< alter table crash_q1 drop primary key + ###> OK +alter_drop_unique=with drop key # Alter table drop unique + ###< alter table crash_q drop constraint u1 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint u1' at line 1 + ### + ###< alter table crash_q drop constraint u1 restrict + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint u1 restrict' at line 1 + ### + ###< alter table crash_q drop key u1 + ###> OK +alter_modify_col=yes # Alter table modify column + ###< alter table crash_q modify c1 CHAR(20) + ###> OK +alter_rename_table=yes # Alter table rename table + ###< alter table crash_q rename to crash_q1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +atomic_updates=no # atomic updates + ###< create table crash_q (a integer not null,primary key (a)) + ###> OK + ###< insert into crash_q values (2) + ###> OK + ###< insert into crash_q values (3) + ###> OK + ###< insert into crash_q values (1) + ###> OK + ###< update crash_q set a=a+1 + ###> execute error:Duplicate entry '3' for key 1 + ###< drop table crash_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +automatic_rowid=_rowid # Automatic row id + ###< create table crash_q (a int not null, primary key(a)) + ###> OK + ###< insert into crash_q values (1) + ###> OK + ###< select _rowid from crash_q + ###> OK + ###< drop table crash_q + ###> OK +binary_numbers=no # binary numbers (0b1001) + ###< select 0b1001 + ###> execute error:Unknown column '0b1001' in 'field list' + ### + ###As far as some queries didnt return OK, result is NO +binary_strings=no # binary strings (b'0110') + ###< select b'0110' + ###> execute error:Unknown column 'b' in 'field list' + ### + ###As far as some queries didnt return OK, result is NO +case_insensitive_strings=yes # Case insensitive compare + ### + ###aa + ###We expected 'a a ' but got 'aa' +column_alias=yes # Column alias + ###< select a as ab from crash_me + ###> OK + ### + ###As far as all queries returned OK, result is YES +columns_in_group_by=+64 # number of columns in group by + ###We are trying (example with N=5): + ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer) + ###insert into crash_q values(1,1,1,1,1) + ###insert into crash_q values(1,1,1,1,1) + ###select q1,q2,q3,q4,q5 from crash_q group by q1,q2,q3,q4,q5 +columns_in_order_by=+64 # number of columns in order by + ###We are trying (example with N=5): + ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer) + ###insert into crash_q values(1,1,1,1,1) + ###insert into crash_q values(1,1,1,1,1) + ###select * from crash_q order by q1,q2,q3,q4,q5 +comment_#=yes # # as comment + ###< select * from crash_me # Testing of comments + ###> OK + ### + ###As far as all queries returned OK, result is YES +comment_--=yes # -- as comment (ANSI) + ###< select * from crash_me -- Testing of comments + ###> OK + ### + ###As far as all queries returned OK, result is YES +comment_/**/=yes # /* */ as comment + ###< select * from crash_me /* Testing of comments */ + ###> OK + ### + ###As far as all queries returned OK, result is YES +comment_//=no # // as comment + ###< select * from crash_me // Testing of comments + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '// Testing of comments' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +compute=no # Compute + ###< select a from crash_me order by a compute sum(a) by a + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'compute sum(a) by a' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +connections=101 # Simultaneous connections (installation default) +constraint_check=syntax only # Column constraints + ###< create table crash_q (a int check (a>0)) + ###> OK + ### + ###< insert into crash_q values(0) + ###> OK + ### + ###< drop table crash_q + ###> OK +constraint_check_named=syntax only # Named constraints + ###< create table crash_q (a int ,b int, constraint abc check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK +constraint_check_table=syntax only # Table constraints + ###< create table crash_q (a int ,b int, check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK +constraint_null=yes # NULL constraint (SyBase style) + ###< create table crash_q (a int null) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +crash_me_safe=yes # crash me safe +crash_me_version=1.61 # crash me version +create_default=yes # default value for column + ###< create table crash_q (q integer default 10 not null) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +create_default_func=no # default value function for column + ###< create table crash_q (q integer not null,q1 integer default (1+1)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1+1))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +create_if_not_exists=yes # create table if not exists + ###< create table crash_q (q integer) + ###> OK + ###< create table if not exists crash_q (q integer) + ###> OK + ### + ###As far as all queries returned OK, result is YES +create_index=yes # create index + ###< create index crash_q on crash_me (a) + ###> OK +create_schema=no # Create SCHEMA + ###< create schema crash_schema create table crash_q (a int) create table crash_q2(b int) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema crash_schema create table crash_q (a int) create table c + ###< drop schema crash_schema cascade + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema crash_schema cascade' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +create_table_select=yes # create table from select + ###< create table crash_q SELECT * from crash_me + ###> OK +cross_join=yes # cross join (same as from a,b) + ###< select crash_me.a from crash_me cross join crash_me3 + ###> OK + ### + ###As far as all queries returned OK, result is YES +date_as_string=yes # String functions on date columns + ###< create table crash_me2 (a date not null) + ###> OK + ###< insert into crash_me2 values ('1998-03-03') + ###> OK + ### + ###0000-00-00 + ###We expected '1963-08-16' but got '0000-00-00' + ### + ###< delete from crash_me_d + ###> OK +date_format_EUR_with_date=error # Supports DATE 'DD.MM.YYYY' (EUR) format + ###< insert into crash_me_d(a) values (DATE '16.08.1963') + ###> OK + ### + ###1963-08-16 + ### + ###< delete from crash_me_d + ###> OK +date_format_ISO_with_date=yes # Supports DATE 'YYYY-MM-DD' (ISO) format + ###< insert into crash_me_d(a) values (DATE '1963-08-16') + ###> OK + ### + ###0000-00-00 + ###We expected '1963-08-16' but got '0000-00-00' + ### + ###< delete from crash_me_d + ###> OK +date_format_USA_with_date=error # Supports DATE 'MM/DD/YYYY' format + ###< insert into crash_me_d(a) values (DATE '08/16/1963') + ###> OK + ### + ###1963-08-16 + ### + ###< delete from crash_me_d + ###> OK +date_format_YYYYMMDD_with_date=yes # Supports DATE 'YYYYMMDD' format + ###< insert into crash_me_d(a) values (DATE '19630816') + ###> OK + ### + ###0000-00-00 + ###We expected 'infinity' but got '0000-00-00' + ### + ###< drop table crash_me2 + ###> OK +date_last=yes # Supports 9999-12-31 dates + ###< create table crash_me2 (a date not null) + ###> OK + ###< insert into crash_me2 values ('9999-12-31') + ###> OK + ### + ###0001-01-01 + ### + ###< drop table crash_me2 + ###> OK +date_with_YY=yes # Supports YY-MM-DD 2000 compilant dates + ###< create table crash_me2 (a date not null) + ###> OK + ###< insert into crash_me2 values ('98-03-03') + ###> OK + ### + ###2010-03-03 + ### + ###< drop table crash_me2 + ###> OK +date_zero=yes # Supports 0000-00-00 dates + ###< create table crash_me2 (a date not null) + ###> OK + ###< insert into crash_me2 values ('0000-00-00') + ###> OK + ### + ###Walker's +drop_if_exists=yes # drop table if exists + ###< create table crash_q (q integer) + ###> OK + ###< drop table if exists crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +drop_index=with 'ON' # drop index + ###< drop index crash_q + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + ### + ###< drop index crash_q from crash_me + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'from crash_me' at line 1 + ### + ###< drop index crash_q on crash_me + ###> OK +drop_requires_cascade=no # drop table require cascade/restrict + ###< create table crash_me (a integer not null) + ###> OK + ###< drop table crash_me + ###> OK +drop_restrict=yes # drop table with cascade/restrict + ###< create table crash_q (a int) + ###> OK + ###< drop table crash_q restrict + ###> OK + ### + ###As far as all queries returned OK, result is YES +end_colon=yes # allows end ';' + ###< select * from crash_me; + ###> OK + ### + ###As far as all queries returned OK, result is YES +except=no # except + ###< select * from crash_me except select * from crash_me3 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me3' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +except_all=no # except all + ###< select * from crash_me except all select * from crash_me3 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me3' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +except_all_incompat=no # except all (incompatible lists) + ###< select * from crash_me except all select * from crash_me2 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me2' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +except_incompat=no # except (incompatible lists) + ###< select * from crash_me except select * from crash_me2 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me2' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +field_name_case=yes # case independent field names + ###< create table crash_q (q integer) + ###> OK + ###< insert into crash_q(Q) values (1) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +float_int_expr=yes # mixing of integer and float in expression + ###< select 1+1.0 + ###> OK + ### + ###As far as all queries returned OK, result is YES +foreign_key=syntax only # foreign keys + ###< create table crash_me_qf (a integer not null,primary key (a)) + ###> OK + ### + ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) + ###> OK + ### + ###< insert into crash_me_qf values (1) + ###> OK + ### + ###< insert into crash_me_qf2 values (2) + ###> OK + ### + ###< drop table crash_me_qf2 + ###> OK + ### + ###< drop table crash_me_qf + ###> OK +full_outer_join=no # full outer join + ###< select crash_me.a from crash_me full join crash_me2 ON + ### crash_me.a=crash_me2.a + ###> execute error:Unknown table 'crash_me' in field list + ### + ###As far as some queries didnt return OK, result is NO +func_extra_!=yes # Function NOT as '!' in SELECT + ### + ###3 +func_extra_&=yes # Function & (bitwise and) + ### + ###1 +func_extra_<>=yes # Function <> in SELECT + ### + ###1 +func_extra_add_months=no # Function ADD_MONTHS + ### + ###2002-12-04 +func_extra_addtime=yes # Function ADDTIME + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('Aâ',2)' at line 1 +func_extra_and_or=yes # Function AND and OR in SELECT + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(65)' at line 1 +func_extra_ascii_code=no # Function ASCII_CODE + ### + ###97 + ###We expected 'a' but got '97' +func_extra_atn2=no # Function ATN2 + ### + ###a2 +func_extra_auto_string2num=yes # Function automatic string->num convert + ### + ###1 +func_extra_binary_shifts=yes # Function << and >> (bitwise shifts) + ### + ###2 +func_extra_ceil=yes # Function CEIL + ### + ### execute failed:Unknown column 'EUR' in 'field list' +func_extra_charindex=no # Function CHARINDEX + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(65)' at line 1 +func_extra_chr_str=no # Function CHR (any type to string) + ### + ###0 + ###We expected 'abcdef' but got '0' +func_extra_concat_list=yes # Function CONCAT(list) + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '5)' at line 1 +func_extra_cosh=no # Function COSH + ### + ###1963-08-16 +func_extra_date_format=yes # Function DATE_FORMAT + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(day,3,'1997-11-30') from crash_me_d' at line 1 +func_extra_datediff=no # Function DATEDIFF + ### + ###3 +func_extra_datename=no # Function DATENAME + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(month,'July 20 1997') from crash_me_d' at line 1 +func_extra_day=yes # Function DAY + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1,'S-103',2,'Leopard',3)' at line 1 +func_extra_ebcdic_string=no # Function EBCDIC in string cast + ### + ###TWO +func_extra_encrypt=yes # Function ENCRYPT + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abcd',6)' at line 1 +func_extra_field=yes # Function FIELD + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(222.6666,10,2)' at line 1 +func_extra_float=no # Function FLOAT + ### + ###1,234.56 +func_extra_from_days=yes # Function FROM_DAYS + ### + ###1970-01-01 02:00:00 +func_extra_getdate=no # Function GETDATE + ### + ###HARRY +func_extra_hex=yes # Function HEX + ### + ###6 +func_extra_in_num=yes # Function IN on numbers in SELECT + ### + ###1 +func_extra_index=no # Function INDEX + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('the soap')' at line 1 +func_extra_instr=yes # Function LOCATE as INSTR + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '3,2)' at line 1 +func_extra_instrb=no # Function INSTRB + ### + ###5 +func_extra_last_day=yes # Function LAST_DAY + ### + ###0 +func_extra_least=yes # Function LEAST + ### + ###1 + ###We expected '2' but got '1' +func_extra_lengthb=no # Function LENGTHB + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abcd','.',6)' at line 1 +func_extra_like=yes # Function LIKE in SELECT + ### + ###1 +func_extra_ln=yes # Function LN + ### + ###2.000000 +func_extra_logn=no # Function LOGN + ### + ###??hi +func_extra_ltrim2arg=no # Function LTRIM (2 arg) + ### + ###1963-08-16 +func_extra_maketime=yes # Function MAKETIME + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('Aâ')' at line 1 +func_extra_mdy=no # Function MDY + ### + ###110000 +func_extra_mid=yes # Function SUBSTRING as MID + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('1997-02-02','1997-01-01') from crash_me_d' at line 1 +func_extra_noround=no # Function NOROUND + ###< select noround(22.6) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 +func_extra_not=yes # Function NOT in SELECT + ### + ###0 +func_extra_not_like=yes # Function NOT LIKE in SELECT + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('2123')' at line 1 +func_extra_odbc_convert=no # Function ODBC CONVERT + ### + ###*6B4F89A54E2D27ECD7E8DA05B4AB8FD9D1D8B119 +func_extra_paste=no # Function PASTE + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('%a%','crash')' at line 1 +func_extra_period_add=yes # Function PERIOD_ADD + ### + ###13 +func_extra_pow=yes # Function POW + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a)' at line 1 +func_extra_regexp=yes # Function REGEXP in SELECT + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +func_extra_replicate=no # Function REPLICATE + ### + ###dcba +func_extra_rfill3arg=no # Function RFILL (3 arg) + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(4)' at line 1 +func_extra_round1=yes # Function ROUND(1 arg) + ### + ###hi?? +func_extra_rpad4arg=no # Function RPAD (4 arg) + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''.')' at line 1 +func_extra_sec_to_time=yes # Function SEC_TO_TIME + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1)' at line 1 +func_extra_str=no # Function STR + ### + ###-1 +func_extra_stuff=no # Function STUFF + ### + ###2002-12-01 +func_extra_substr2arg=yes # Function SUBSTR (2 arg) + ### + ###bc +func_extra_substrb=no # Function SUBSTRB + ### + ###tcx.se +func_extra_subtime=yes # Function SUBTIME + ### + ###2004-04-06 13:49:05 +func_extra_tail=no # Function TAIL + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1)' at line 1 +func_extra_time=yes # Function TIME + ### + ###5001 +func_extra_timediff=yes # Function TIMEDIFF + ### + ###1963-08-16 20:02:12 + ###We expected '19630816200212000000' but got '1963-08-16 20:02:12' +func_extra_to_days=yes # Function TO_DAYS + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc','bc','de')' at line 1 +func_extra_trim1arg=yes # Function TRIM (1 arg) + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''.')' at line 1 +func_extra_trim_many_char=error # Function TRIM; Many char extension + ### + ###abc +func_extra_trunc=no # Function TRUNC + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(222.6)' at line 1 +func_extra_uid=no # Function UID + ### + ###1081248545 +func_extra_userenv=no # Function USERENV + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(NULL,'WALRUS')' at line 1 +func_extra_version=yes # Function VERSION + ### + ###5 +func_extra_weekofyear=yes # Function WEEKOFYEAR + ### + ###3 +func_extra_||=yes # Function OR as '||' + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '~* 'HI'' at line 1 +func_odbc_abs=yes # Function ABS + ### + ###1.570796 +func_odbc_ascii=yes # Function ASCII + ### + ###1.570796 +func_odbc_atan=yes # Function ATAN + ### + ###1.570796 +func_odbc_ceiling=yes # Function CEILING + ### + ###A +func_odbc_concat=yes # Function CONCAT(2 arg) + ### + ###1.000000 +func_odbc_cot=yes # Function COT + ### + ###2004-04-06 +func_odbc_curtime=yes # Function CURTIME + ### + ###test +func_odbc_dayname=yes # Function DAYNAME + ###< insert into crash_me_d values('1997-02-01') + ### + ###1 +func_odbc_dayofweek=yes # Function DAYOFWEEK + ###< insert into crash_me_d values('1997-02-01') + ### + ###32 +func_odbc_degrees=yes # Function DEGREES + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc','abe')' at line 1 + ### + ###2.718282 +func_odbc_floor=yes # Function FLOOR + ### + ###c +func_odbc_hour=yes # Function HOUR + ###< insert into crash_me_t values(20:08:16) + ### + ###12 +func_odbc_ifnull=yes # Function IFNULL + ### + ###aefd +func_odbc_lcase=yes # Function LCASE + ### + ###ab +func_odbc_length=yes # Function REAL LENGTH + ### + ###5 + ###We expected '4' but got '5' + ### + ###2 +func_odbc_locate_3=yes # Function LOCATE(3 arg) + ### + ###0.693147 +func_odbc_log10=yes # Function LOG10 + ### + ###abcd +func_odbc_minute=yes # Function MINUTE + ###< insert into crash_me_t values(20:08:16) + ### + ###4 +func_odbc_month=yes # Function MONTH + ###< insert into crash_me_d values('1997-02-01') + ### + ###February +func_odbc_now=yes # Function NOW + ### + ###3.141593 +func_odbc_power=yes # Function POWER + ### + ###1 +func_odbc_radians=yes # Function RADIANS + ### + ###0.40540353712198 +func_odbc_repeat=yes # Function REPEAT + ### + ###bababa +func_odbc_right=yes # Function RIGHT + ### + ###5.63 +func_odbc_rtrim=yes # Function RTRIM + ### + ###14 +func_odbc_sign=yes # Function SIGN + ### + ###0.841471 +func_odbc_soundex=yes # Function SOUNDEX + ### + ### +func_odbc_sqrt=yes # Function SQRT + ### + ###cd +func_odbc_tan=yes # Function TAN + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')' at line 1 + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(SQL_TSI_SECOND,'1997-01-01 00:00:02', '1997-01-01 00:00:01')' + ### + ###10 +func_odbc_ucase=yes # Function UCASE + ### + ###monty@localhost +func_odbc_week=USA # WEEK + ###1997 +func_sql_+=yes # Function +, -, * and / + ### + ###24 +func_sql_cast=yes # Function CAST + ### + ###1 + ###We expected '10' but got '1' +func_sql_char_length(constant)=yes # Function CHAR_LENGTH(constant) + ### + ###4 +func_sql_coalesce=yes # Function COALESCE + ### + ###0 + ###We expected 'abcdef' but got '0' +func_sql_current_date=yes # Function CURRENT_DATE + ### + ###13:49:04 +func_sql_current_timestamp=yes # Function CURRENT_TIMESTAMP + ### + ###43 +func_sql_localtime=yes # Function LOCALTIME + ### + ###2004-04-06 13:49:04 +func_sql_lower=yes # Function LOWER + ### + ### +func_sql_nullif_string=yes # Function NULLIF with strings + ### + ###3 +func_sql_position=yes # Function POSITION + ### + ### 2 then 'false' when 2 > 1 then 'true' end + ###>true +func_sql_session_user=with_parenthesis # SESSION_USER + ###< select SESSION_USER + ###> execute error:Unknown column 'SESSION_USER' in 'field list' + ### + ###< select SESSION_USER() + ###> OK +func_sql_simple_case=yes # Function simple CASE + ### + ###bc +func_sql_system_user=with_parenthesis # SYSTEM_USER + ###< select SYSTEM_USER + ###> execute error:Unknown column 'SYSTEM_USER' in 'field list' + ### + ###< select SYSTEM_USER() + ###> OK +func_sql_trim=yes # Function TRIM + ### + ###ABC +func_sql_user=with_parenthesis # USER + ###< select USER + ###> execute error:Unknown column 'USER' in 'field list' + ### + ###< select USER() + ###> OK +func_where_between=yes # Function BETWEEN + ### + ###1 +func_where_eq_any=yes # Function = ANY + ### + ###1 +func_where_exists=yes # Function EXISTS + ### + ###1 +func_where_like=yes # Function LIKE + ### + ###1 +func_where_match=no # Function MATCH + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'match unique (select a from crash_me)' at line 1 +func_where_matches=no # Function MATCHES + ### + ###1 +func_where_not_exists=yes # Function NOT EXISTS + ### + ###1 +func_where_not_unique=no # Function NOT UNIQUE + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique (select * from crash_me)' at line 1 +functions=yes # Functions + ###< select 1+1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +group_by=yes # Group by + ###< select a from crash_me group by a + ###> OK + ### + ###As far as all queries returned OK, result is YES +group_by_alias=yes # Group by alias + ###< select a as ab from crash_me group by ab + ###> OK + ### + ###As far as all queries returned OK, result is YES +group_by_null=yes # Group on column with null values + ###< create table crash_q (s char(10)) + ###> OK + ###< insert into crash_q values(null) + ###> OK + ###< insert into crash_q values(null) + ###> OK + ### + ###1 +group_func_extra_bit_or=yes # Group function BIT_OR + ### + ###1 +group_func_extra_std=yes # Group function STD + ### + ###0.0000 +group_func_extra_variance=yes # Group function VARIANCE + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a),a from crash_me group by a' at line 1 +group_func_sql_avg=yes # Group function AVG + ### + ###1 +group_func_sql_count_column=yes # Group function COUNT column name + ### + ###1 +group_func_sql_every=no # Group function EVERY + ### + ###1 +group_func_sql_max_str=yes # Group function MAX on strings + ### + ###1 +group_func_sql_min_str=yes # Group function MIN on strings + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a),a from crash_me group by a' at line 1 +group_func_sql_sum=yes # Group function SUM + ### + ### 0 + ###>1 + ### + ###a +index_in_create=yes # index in create table + ###< create table crash_q (q integer not null,index (q)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +index_namespace=yes # different namespace for index + ###< create index crash_me on crash_me (b) + ###> OK + ###< drop index crash_me on crash_me + ###> OK + ### + ###As far as all queries returned OK, result is YES +index_parts=yes # index on column part (extension) + ###< create index crash_q on crash_me (b(5)) + ###> OK + ###< drop index crash_q on crash_me + ###> OK + ### + ###As far as all queries returned OK, result is YES +inner_join=yes # inner join + ###< select crash_me.a from crash_me inner join crash_me2 ON crash_me.a=crash_me2.a + ###> OK + ### + ###As far as all queries returned OK, result is YES +insert_default_values=no # INSERT DEFAULT VALUES + ###< create table crash_me_q (a int) + ###> OK + ###< insert into crash_me_q DEFAULT VALUES + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1 + ###< drop table crash_me_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +insert_empty_string=yes # insert empty string + ###< create table crash_q (a char(10) not null,b char(10)) + ###> OK + ###< insert into crash_q values ('','') + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +insert_multi_value=yes # INSERT with Value lists + ###< create table crash_q (s char(10)) + ###> OK + ###< insert into crash_q values ('a'),('b') + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +insert_select=yes # insert INTO ... SELECT ... + ###< create table crash_q (a int) + ###> OK + ###< insert into crash_q (a) SELECT crash_me.a from crash_me + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +insert_with_default=yes # INSERT with DEFAULT + ###< create table crash_me_q (a int) + ###> OK + ###< insert into crash_me_q (a) values (DEFAULT) + ###> OK + ###< drop table crash_me_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +insert_with_empty_value_list=no # INSERT with empty value list + ###< create table crash_me_q (a int) + ###> OK + ###< insert into crash_me_q (a) values () + ###> execute error:Column count doesn't match value count at row 1 + ###< drop table crash_me_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +insert_with_set=yes # INSERT with set syntax + ###< create table crash_q (a integer) + ###> OK + ###< insert into crash_q SET a=1 + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +intersect=no # intersect + ###< select * from crash_me intersect select * from crash_me3 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me3' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +intersect_all=no # intersect all + ###< select * from crash_me intersect all select * from crash_me3 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me3' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +intersect_all_incompat=no # intersect all (incompatible lists) + ###< select * from crash_me intersect all select * from crash_me2 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me2' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +intersect_incompat=no # intersect (incompatible lists) + ###< select * from crash_me intersect select * from crash_me2 + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me2' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +join_tables=61 # tables in join + ###We are trying (example with N=5): + ###select crash_me.a,t0.a,t1.a,t2.a,t3.a,t4.a from crash_me,crash_me t0,crash_me t1,crash_me t2,crash_me t3,crash_me t4 + ### 32:OK 48:OK 56:OK 60:OK 62:FAIL 61:FAIL +left_outer_join=yes # left outer join + ###< select crash_me.a from crash_me left join crash_me2 ON crash_me.a=crash_me2.a + ###> OK + ### + ###As far as all queries returned OK, result is YES +left_outer_join_using=yes # left outer join using + ###< select c1 from crash_me left join crash_me2 using (a) + ###> OK + ### + ###As far as all queries returned OK, result is YES +length_of_varchar_field=actual length # CHARACTER_LENGTH(varchar_field) + ###< CREATE TABLE crash_me1 (S1 VARCHAR(100)) + ###> OK + ###< INSERT INTO crash_me1 VALUES ('X') + ###> OK + ### + ###< SELECT CHARACTER_LENGTH(S1) FROM crash_me1 + ### > 1 + ###< drop table crash_me1 + ###> OK +like_with_column=yes # column LIKE column + ###< create table crash_q (a char(10),b char(10)) + ###> OK + ###< insert into crash_q values('abc','abc') + ###> OK + ###< select * from crash_q where a like b + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +like_with_number=yes # LIKE on numbers + ###< create table crash_q (a int,b int) + ###> OK + ###< insert into crash_q values(10,10) + ###> OK + ###< select * from crash_q where a like '10' + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +lock_tables=yes # lock table + ###< lock table crash_me READ + ###> OK + ###< unlock tables + ###> OK + ### + ###As far as all queries returned OK, result is YES +logical_value=1 # Value of logical operation (1=1) + ###2 +multi_drop=yes # many tables to drop table + ###< create table crash_q (a int) + ###> OK + ###< create table crash_q2 (a int) + ###> OK + ###< drop table crash_q,crash_q2 + ###> OK + ### + ###As far as all queries returned OK, result is YES +multi_null_in_unique=yes # null in unique index + ###< create table crash_q (q integer, x integer,unique (q)) + ###> OK + ###< insert into crash_q(x) values(1) + ###> OK + ###< insert into crash_q(x) values(2) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +multi_strings=yes # Multiple line strings + ### + ###a + ### + ###< drop table crash_q + ###> OK +natural_join=yes # natural join + ###< select * from crash_me natural join crash_me3 + ###> OK + ### + ###As far as all queries returned OK, result is YES +natural_join_incompat=yes # natural join (incompatible lists) + ###< select c1 from crash_me natural join crash_me2 + ###> OK + ### + ###As far as all queries returned OK, result is YES +natural_left_outer_join=yes # natural left outer join + ###< select c1 from crash_me natural left join crash_me2 + ###> OK + ### + ###As far as all queries returned OK, result is YES +no_primary_key=yes # Tables without primary key + ###< create table crash_me (a integer not null,b char(10) not null) + ###> OK + ###< insert into crash_me (a,b) values (1,'a') + ###> OK +not_id_between=no # NOT ID BETWEEN interprets as ID NOT BETWEEN + ###< create table crash_me_b (i int) + ###> OK + ###< insert into crash_me_b values(2) + ###> OK + ###< insert into crash_me_b values(5) + ###> OK + ### + ### +null_in_index=yes # null in index + ###< create table crash_q (a char(10),index (a)) + ###> OK + ###< insert into crash_q values (NULL) + ###> OK + ### + ### +nulls_in_unique=yes # null combination in unique index + ###< create table crash_q (q integer,q1 integer,unique (q,q1)) + ###> OK + ###< insert into crash_q (q,q1) values(1,NULL) + ###> OK + ###< insert into crash_q (q,q1) values(1,NULL) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +odbc_left_outer_join=yes # left outer join odbc style + ###< select crash_me.a from { oj crash_me left outer join crash_me2 ON crash_me.a=crash_me2.a } + ###> OK + ### + ###As far as all queries returned OK, result is YES +operating_system=Linux 2.4.21-199-smp4G i686 # crash-me tested on +order_by=yes # Order by + ###< select a from crash_me order by a + ###> OK + ### + ###As far as all queries returned OK, result is YES +order_by_alias=yes # Order by alias + ###< select a as ab from crash_me order by ab + ###> OK + ### + ###As far as all queries returned OK, result is YES +order_by_function=yes # Order by function + ###< select a from crash_me order by a+1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +order_by_position=yes # Order by position + ###< select a from crash_me order by 1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +order_on_unused=yes # Order by on unused column + ###< select b from crash_me order by a + ###> OK + ### + ###As far as all queries returned OK, result is YES +position_of_null=first # Where is null values in sorted recordset + ###< insert into crash_me_n (i) values(1) + ###> OK + ###< insert into crash_me_n values(2,2) + ###> OK + ###< insert into crash_me_n values(3,3) + ###> OK + ###< insert into crash_me_n values(4,4) + ###> OK + ###< insert into crash_me_n (i) values(5) + ###> OK + ### + ###< select r from crash_me_n order by r + ###> + ###> + ###> 2 + ###> 3 + ###> 4 +position_of_null_desc=last # Where is null values in sorted recordset (DESC) + ###< select r from crash_me_n order by r desc + ###> 4 + ###> 3 + ###> 2 + ###> + ###> +primary_key_in_create=yes # primary key in create table + ###< create table crash_q (q integer not null,primary key (q)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +psm_functions=no # PSM functions (ANSI SQL) + ###< create table crash_q (a int) + ###> OK + ###< create function crash_func(in a1 int, in b1 int) returns int language sql deterministic contains sql begin return a1 * b1; end + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(in a1 int, in b1 int) returns int language sql deterministic c + ###< insert into crash_q values(crash_func(2,4)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(2,4))' at line 1 + ###< select a,crash_func(a,2) from crash_q + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a,2) from crash_q' at line 1 + ###< drop function crash_func cascade + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade' at line 1 + ###< drop table crash_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +psm_modules=no # PSM modules (ANSI SQL) + ###< create table crash_q (a int,b int) + ###> OK + ###< create module crash_m declare procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end; declare procedure crash_proc2(INOUT a int, in b int) contains sql set a = b + 10; end module + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'module crash_m declare procedure crash_proc(in a1 int, in b1 in + ###< call crash_proc(1,10) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'call crash_proc(1,10)' at line 1 + ###< drop module crash_m cascade + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'module crash_m cascade' at line 1 + ###< drop table crash_q cascade + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +psm_procedures=no # PSM procedures (ANSI SQL) + ###< create table crash_q (a int,b int) + ###> OK + ###< create procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure crash_proc(in a1 int, in b1 int) language sql modifie + ###< call crash_proc(1,10) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'call crash_proc(1,10)' at line 1 + ###< drop procedure crash_proc + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure crash_proc' at line 1 + ###< drop table crash_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +psm_trigger=no # Triggers (ANSI SQL) + ###< create table crash_q (a int ,b int) + ###> OK + ###< create trigger crash_trigger after insert on crash_q referencing new table as new_a when (localtime > time '18:00:00') begin atomic end + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger crash_trigger after insert on crash_q referencing new t + ###< insert into crash_q values(1,2) + ###> OK + ###< drop trigger crash_trigger + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger crash_trigger' at line 1 + ###< drop table crash_q + ###> OK + ### + ###As far as some queries didnt return OK, result is NO +query_size=1048574 # query size +quote_ident_with_"=error # " as identifier quote (ANSI SQL) + ### + ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '[A] from crash_me' at line 1 +quote_ident_with_`=yes # ` as identifier quote + ### + ###hello + ###We expected 'hello ' but got 'hello' + ### + ###< drop table crash_q + ###> OK +remember_end_space_varchar=no # Remembers end space in varchar() + ###< create table crash_q (a varchar(10)) + ###> OK + ###< insert into crash_q values('hello ') + ###> OK + ### + ###0 + ###We expected '1' but got '0' +select_constants=yes # Select constants + ###< select 1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +select_limit=with LIMIT # LIMIT number of rows + ###< select * from crash_me limit 1 + ###> OK +select_limit2=yes # SELECT with LIMIT #,# + ###< select * from crash_me limit 1,1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +select_limit3=yes # SELECT with LIMIT # OFFSET # + ###< select * from crash_me limit 1 offset 1 + ###> OK + ### + ###As far as all queries returned OK, result is YES +select_string_size=1048565 # constant string size in SELECT + ###We are trying (example with N=5): + ###select 'aaaaa' +select_table_update=yes # Update with sub select + ###< create table crash_q (a integer,b char(10)) + ###> OK + ###< insert into crash_q values(1,'c') + ###> OK + ###< update crash_q set b= (select b from crash_me where crash_q.a = crash_me.a) + ###> OK + ### + ###1.1 + ### + ###< drop table crash_q + ###> OK + ### + ###< create table crash_q (q1 float(4,1)) + ###> OK + ###< insert into crash_q values(1.16) + ###> OK + ### + ###1.1 + ### + ###< drop table crash_q + ###> OK + ### + ###< create table crash_q (q1 float(4,1)) + ###> OK + ###< insert into crash_q values(1.16) + ###> OK + ### + ###00:00:20 + ###We expected '20:08:16' but got '00:00:20' + ### + ###< delete from crash_me_t + ###> OK +time_format_HHHHMMSS=yes # Supports HHHHmmSS time format + ###< insert into crash_me_t(a) values ('00200816') + ###> OK + ### + ###20:08:16 + ### + ###< delete from crash_me_t + ###> OK +time_format_USA=error # Supports HH:MM:SS (AM|PM) time format + ###< insert into crash_me_t(a) values ('08:08:16 PM') + ###> OK + ### + ###1 + ###We expected '' but got '1' +truncate_table=yes # truncate + ###< create table crash_q (a integer, b integer,c1 CHAR(10)) + ###> OK + ###< truncate table crash_q + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_abstime=no # Type abstime + ###< create table crash_q (q abstime) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'abstime)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_bfile=no # Type bfile + ###< create table crash_q (q bfile) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'bfile)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_blob=yes # Type blob + ###< create table crash_q (q blob) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_bool=yes # Type bool + ###< create table crash_q (q bool) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_box=no # Type box + ###< create table crash_q (q box) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'box)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_byte=no # Type byte + ###< create table crash_q (q byte) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'byte)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_char(1_arg)_binary=yes # Type char(1 arg) binary + ###< create table crash_q (q char(10) binary) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_cidr=no # Type cidr + ###< create table crash_q (q cidr) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'cidr)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_circle=no # Type circle + ###< create table crash_q (q circle) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'circle)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_clob=no # Type clob + ###< create table crash_q (q clob) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'clob)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_datetime=yes # Type datetime + ###< create table crash_q (q datetime) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_double=yes # Type double + ###< create table crash_q (q double) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_enum(1_arg)=yes # Type enum(1 arg) + ###< create table crash_q (q enum('red')) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_float(2_arg)=yes # Type float(2 arg) + ###< create table crash_q (q float(6,2)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_float4=yes # Type float4 + ###< create table crash_q (q float4) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_float8=yes # Type float8 + ###< create table crash_q (q float8) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_image=no # Type image + ###< create table crash_q (q image) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'image)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_inet=no # Type inet + ###< create table crash_q (q inet) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_int(1_arg)_zerofill=yes # Type int(1 arg) zerofill + ###< create table crash_q (q int(5) zerofill) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int1=yes # Type int1 + ###< create table crash_q (q int1) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int2=yes # Type int2 + ###< create table crash_q (q int2) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int3=yes # Type int3 + ###< create table crash_q (q int3) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int4=yes # Type int4 + ###< create table crash_q (q int4) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int8=yes # Type int8 + ###< create table crash_q (q int8) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int_auto_increment=yes # Type int not null auto_increment + ###< create table crash_q (q int not null auto_increment,unique(q)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_int_identity=no # Type int not null identity + ###< create table crash_q (q int not null identity,unique(q)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'identity,unique(q))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_int_unsigned=yes # Type int unsigned + ###< create table crash_q (q int unsigned) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_interval=no # Type interval + ###< create table crash_q (q interval) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_line=no # Type line + ###< create table crash_q (q line) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'line)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_long=yes # Type long + ###< create table crash_q (q long) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_long_raw=no # Type long raw + ###< create table crash_q (q long raw) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'raw)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_long_varbinary=yes # Type long varbinary + ###< create table crash_q (q long varbinary) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_long_varchar(1_arg)=no # Type long varchar(1 arg) + ###< create table crash_q (q long varchar(1)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_lseg=no # Type lseg + ###< create table crash_q (q lseg) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'lseg)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_macaddr=no # Type macaddr + ###< create table crash_q (q macaddr) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'macaddr)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_mediumint=yes # Type mediumint + ###< create table crash_q (q mediumint) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_mediumtext=yes # Type mediumtext + ###< create table crash_q (q mediumtext) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_middleint=yes # Type middleint + ###< create table crash_q (q middleint) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_mlslabel=no # Type mlslabel + ###< create table crash_q (q mlslabel) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mlslabel)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_money=no # Type money + ###< create table crash_q (q money) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'money)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_nclob=no # Type nclob + ###< create table crash_q (q nclob) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'nclob)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_number=no # Type number + ###< create table crash_q (q number) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_number(1_arg)=no # Type number(1 arg) + ###< create table crash_q (q number(9)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number(9))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_number(2_arg)=no # Type number(2 arg) + ###< create table crash_q (q number(9,2)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number(9,2))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_nvarchar2(1_arg)=no # Type nvarchar2(1 arg) + ###< create table crash_q (q nvarchar2(16)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'nvarchar2(16))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_path=no # Type path + ###< create table crash_q (q path) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'path)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_point=yes # Type point + ###< create table crash_q (q point) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_polygon=yes # Type polygon + ###< create table crash_q (q polygon) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_raw(1_arg)=no # Type raw(1 arg) + ###< create table crash_q (q raw(16)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'raw(16))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_reltime=no # Type reltime + ###< create table crash_q (q reltime) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'reltime)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_rowid=no # Type rowid + ###< create table crash_q (q rowid) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'rowid)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_serial=yes # Type serial + ###< create table crash_q (q serial) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_set(1_arg)=yes # Type set(1 arg) + ###< create table crash_q (q set('red')) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_smalldatetime=no # Type smalldatetime + ###< create table crash_q (q smalldatetime) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smalldatetime)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_smallfloat=no # Type smallfloat + ###< create table crash_q (q smallfloat) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallfloat)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_smallmoney=no # Type smallmoney + ###< create table crash_q (q smallmoney) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallmoney)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_text=yes # Type text + ###< create table crash_q (q text) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_text(1_arg)=yes # Type text(1 arg) + ###< create table crash_q (q text(10)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_extra_timespan=no # Type timespan + ###< create table crash_q (q timespan) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'timespan)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_uint=no # Type uint + ###< create table crash_q (q uint) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'uint)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_varchar2(1_arg)=no # Type varchar2(1 arg) + ###< create table crash_q (q varchar2(257)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar2(257))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_extra_year=yes # Type year + ###< create table crash_q (q year) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_odbc_bigint=yes # Type bigint + ###< create table crash_q (q bigint) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_odbc_binary(1_arg)=yes # Type binary(1 arg) + ###< create table crash_q (q binary(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_odbc_datetime=yes # Type datetime + ###< create table crash_q (q datetime) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_odbc_tinyint=yes # Type tinyint + ###< create table crash_q (q tinyint) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_odbc_varbinary(1_arg)=yes # Type varbinary(1 arg) + ###< create table crash_q (q varbinary(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_bit=yes # Type bit + ###< create table crash_q (q bit) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_bit(1_arg)=yes # Type bit(1 arg) + ###< create table crash_q (q bit(2)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg) + ###< create table crash_q (q bit varying(2)) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying(2))' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_boolean=yes # Type boolean + ###< create table crash_q (q boolean) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_char(1_arg)=yes # Type char(1 arg) + ###< create table crash_q (q char(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_char_varying(1_arg)=yes # Type char varying(1 arg) + ###< create table crash_q (q char varying(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_character(1_arg)=yes # Type character(1 arg) + ###< create table crash_q (q character(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_character_varying(1_arg)=yes # Type character varying(1 arg) + ###< create table crash_q (q character varying(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_date=yes # Type date + ###< create table crash_q (q date) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_dec(2_arg)=yes # Type dec(2 arg) + ###< create table crash_q (q dec(6,2)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_decimal(2_arg)=yes # Type decimal(2 arg) + ###< create table crash_q (q decimal(6,2)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_double_precision=yes # Type double precision + ###< create table crash_q (q double precision) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_float=yes # Type float + ###< create table crash_q (q float) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_float(1_arg)=yes # Type float(1 arg) + ###< create table crash_q (q float(8)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_int=yes # Type int + ###< create table crash_q (q int) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_integer=yes # Type integer + ###< create table crash_q (q integer) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_interval_day=no # Type interval day + ###< create table crash_q (q interval day) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_day_to_hour=no # Type interval day to hour + ###< create table crash_q (q interval day to hour) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to hour)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_day_to_minute=no # Type interval day to minute + ###< create table crash_q (q interval day to minute) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to minute)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_day_to_second=no # Type interval day to second + ###< create table crash_q (q interval day to second) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to second)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_hour=no # Type interval hour + ###< create table crash_q (q interval hour) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_hour_to_minute=no # Type interval hour to minute + ###< create table crash_q (q interval hour to minute) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour to minute)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_hour_to_second=no # Type interval hour to second + ###< create table crash_q (q interval hour to second) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour to second)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_minute=no # Type interval minute + ###< create table crash_q (q interval minute) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval minute)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_minute_to_second=no # Type interval minute to second + ###< create table crash_q (q interval minute to second) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval minute to second)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_month=no # Type interval month + ###< create table crash_q (q interval month) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval month)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_second=no # Type interval second + ###< create table crash_q (q interval second) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval second)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_year=no # Type interval year + ###< create table crash_q (q interval year) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval year)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_interval_year_to_month=no # Type interval year to month + ###< create table crash_q (q interval year to month) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval year to month)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_national_char_varying(1_arg)=yes # Type national char varying(1 arg) + ###< create table crash_q (q national char varying(20)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_national_character(1_arg)=yes # Type national character(1 arg) + ###< create table crash_q (q national character(20)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_national_character_varying(1_arg)=yes # Type national character varying(1 arg) + ###< create table crash_q (q national character varying(20)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_nchar(1_arg)=yes # Type nchar(1 arg) + ###< create table crash_q (q nchar(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_nchar_varying(1_arg)=yes # Type nchar varying(1 arg) + ###< create table crash_q (q nchar varying(20)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_numeric(2_arg)=yes # Type numeric(2 arg) + ###< create table crash_q (q numeric(9,2)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_real=yes # Type real + ###< create table crash_q (q real) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_smallint=yes # Type smallint + ###< create table crash_q (q smallint) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_time=yes # Type time + ###< create table crash_q (q time) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_timestamp=yes # Type timestamp + ###< create table crash_q (q timestamp) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +type_sql_timestamp_with_time_zone=no # Type timestamp with time zone + ###< create table crash_q (q timestamp with time zone) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'with time zone)' at line 1 + ###< drop table crash_q + ###> execute error:Unknown table 'crash_q' + ### + ###As far as some queries didnt return OK, result is NO +type_sql_varchar(1_arg)=yes # Type varchar(1 arg) + ###< create table crash_q (q varchar(1)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +union=yes # union + ###< select * from crash_me union select a,b from crash_me3 + ###> OK + ### + ###As far as all queries returned OK, result is YES +union_all=yes # union all + ###< select * from crash_me union all select a,b from crash_me3 + ###> OK + ### + ###As far as all queries returned OK, result is YES +union_all_incompat=yes # union all (incompatible lists) + ###< select * from crash_me union all select a,b from crash_me2 + ###> OK + ### + ###As far as all queries returned OK, result is YES +union_incompat=yes # union (incompatible lists) + ###< select * from crash_me union select a,b from crash_me2 + ###> OK + ### + ###As far as all queries returned OK, result is YES +unique_in_create=yes # unique in create table + ###< create table crash_q (q integer not null,unique (q)) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +unique_null_in_create=yes # unique null in create + ###< create table crash_q (q integer,unique (q)) + ###> OK + ###< insert into crash_q (q) values (NULL) + ###> OK + ###< insert into crash_q (q) values (NULL) + ###> OK + ###< insert into crash_q (q) values (1) + ###> OK + ###< drop table crash_q + ###> OK + ### + ###As far as all queries returned OK, result is YES +value_of_false=0 # Value of FALSE + ###1 +views=no # views + ###< create view crash_q as select a from crash_me + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'view crash_q as select a from crash_me' at line 1 + ###< drop view crash_q + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'view crash_q' at line 1 + ### + ###As far as some queries didnt return OK, result is NO +where_string_size=1048539 # constant string size in where + ###We are trying (example with N=5): + ###select a from crash_me where b >='11111' diff --git a/sql-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg index 64f91f07363..76565cb16ff 100644 --- a/sql-bench/limits/mysql.cfg +++ b/sql-bench/limits/mysql.cfg @@ -1,7056 +1,1119 @@ #This file is automaticly generated by crash-me 1.61 NEG=yes # update of column= -column - ###< create table crash_q (a integer) - ###> OK - ###< insert into crash_q values(10) - ###> OK - ###< update crash_q set a=-a - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES Need_cast_for_null=no # Need to cast NULL for arithmetic - ### Check if numeric_null (NULL) is 'NULL' alter_add_col=yes # Alter table add column - ###< alter table crash_q add d integer - ###> OK - ### - ###As far as all queries returned OK, result is YES alter_add_constraint=yes # Alter table add constraint - ###< alter table crash_q add constraint c2 check(a > b) - ###> OK - ### - ###As far as all queries returned OK, result is YES -alter_add_foreign_key=no # Alter table add foreign key - ###< alter table crash_q add constraint f1 foreign key(c1) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 - ###< references crash_q1(c1) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'references crash_q1(c1)' at line 1 - ### - ###As far as some queries didnt return OK, result is NO +alter_add_foreign_key=yes # Alter table add foreign key alter_add_multi_col=yes # Alter table add many columns - ###< alter table crash_q add (f integer,g integer) - ###> OK alter_add_primary_key=with constraint # Alter table add primary key - ###< alter table crash_q1 add constraint p1 primary key(c1) - ###> OK alter_add_unique=yes # Alter table add unique - ###< alter table crash_q add constraint u1 unique(c1) - ###> OK - ### - ###As far as all queries returned OK, result is YES alter_alter_col=yes # Alter table alter column default - ###< alter table crash_q alter b set default 10 - ###> OK - ### - ###As far as all queries returned OK, result is YES alter_change_col=yes # Alter table change column - ###< alter table crash_q change a e char(50) - ###> OK - ### - ###As far as all queries returned OK, result is YES alter_drop_col=yes # Alter table drop column - ###< alter table crash_q drop column b - ###> OK alter_drop_constraint=no # Alter table drop constraint - ###< alter table crash_q drop constraint c2 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint c2' at line 1 - ### - ###< alter table crash_q drop constraint c2 restrict - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint c2 restrict' at line 1 alter_drop_foreign_key=with drop foreign key # Alter table drop foreign key - ###< alter table crash_q drop constraint f1 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint f1' at line 1 - ### - ###< alter table crash_q drop constraint f1 restrict - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint f1 restrict' at line 1 - ### - ###< alter table crash_q drop foreign key f1 - ###> OK alter_drop_primary_key=drop primary key # Alter table drop primary key - ###< alter table crash_q1 drop constraint p1 restrict - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint p1 restrict' at line 1 - ### - ###< alter table crash_q1 drop primary key - ###> OK alter_drop_unique=with drop key # Alter table drop unique - ###< alter table crash_q drop constraint u1 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint u1' at line 1 - ### - ###< alter table crash_q drop constraint u1 restrict - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint u1 restrict' at line 1 - ### - ###< alter table crash_q drop key u1 - ###> OK alter_modify_col=yes # Alter table modify column - ###< alter table crash_q modify c1 CHAR(20) - ###> OK alter_rename_table=yes # Alter table rename table - ###< alter table crash_q rename to crash_q1 - ###> OK - ### - ###As far as all queries returned OK, result is YES atomic_updates=no # atomic updates - ###< create table crash_q (a integer not null,primary key (a)) - ###> OK - ###< insert into crash_q values (2) - ###> OK - ###< insert into crash_q values (3) - ###> OK - ###< insert into crash_q values (1) - ###> OK - ###< update crash_q set a=a+1 - ###> execute error:Duplicate entry '3' for key 1 - ###< drop table crash_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO automatic_rowid=_rowid # Automatic row id - ###< create table crash_q (a int not null, primary key(a)) - ###> OK - ###< insert into crash_q values (1) - ###> OK - ###< select _rowid from crash_q - ###> OK - ###< drop table crash_q - ###> OK -binary_numbers=no # binary numbers (0b1001) - ###< select 0b1001 - ###> execute error:Unknown column '0b1001' in 'field list' - ### - ###As far as some queries didnt return OK, result is NO -binary_strings=no # binary strings (b'0110') - ###< select b'0110' - ###> execute error:Unknown column 'b' in 'field list' - ### - ###As far as some queries didnt return OK, result is NO +binary_numbers=yes # binary numbers (0b1001) +binary_strings=yes # binary strings (b'0110') case_insensitive_strings=yes # Case insensitive compare - ### - ###aa - ###We expected 'a a ' but got 'aa' column_alias=yes # Column alias - ###< select a as ab from crash_me - ###> OK - ### - ###As far as all queries returned OK, result is YES columns_in_group_by=+64 # number of columns in group by - ###We are trying (example with N=5): - ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer) - ###insert into crash_q values(1,1,1,1,1) - ###insert into crash_q values(1,1,1,1,1) - ###select q1,q2,q3,q4,q5 from crash_q group by q1,q2,q3,q4,q5 columns_in_order_by=+64 # number of columns in order by - ###We are trying (example with N=5): - ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer) - ###insert into crash_q values(1,1,1,1,1) - ###insert into crash_q values(1,1,1,1,1) - ###select * from crash_q order by q1,q2,q3,q4,q5 comment_#=yes # # as comment - ###< select * from crash_me # Testing of comments - ###> OK - ### - ###As far as all queries returned OK, result is YES comment_--=yes # -- as comment (ANSI) - ###< select * from crash_me -- Testing of comments - ###> OK - ### - ###As far as all queries returned OK, result is YES comment_/**/=yes # /* */ as comment - ###< select * from crash_me /* Testing of comments */ - ###> OK - ### - ###As far as all queries returned OK, result is YES comment_//=no # // as comment - ###< select * from crash_me // Testing of comments - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '// Testing of comments' at line 1 - ### - ###As far as some queries didnt return OK, result is NO compute=no # Compute - ###< select a from crash_me order by a compute sum(a) by a - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'compute sum(a) by a' at line 1 - ### - ###As far as some queries didnt return OK, result is NO connections=101 # Simultaneous connections (installation default) constraint_check=syntax only # Column constraints - ###< create table crash_q (a int check (a>0)) - ###> OK - ### - ###< insert into crash_q values(0) - ###> OK - ### - ###< drop table crash_q - ###> OK constraint_check_named=syntax only # Named constraints - ###< create table crash_q (a int ,b int, constraint abc check (a>b)) - ###> OK - ### - ###< insert into crash_q values(0,0) - ###> OK - ### - ###< drop table crash_q - ###> OK constraint_check_table=syntax only # Table constraints - ###< create table crash_q (a int ,b int, check (a>b)) - ###> OK - ### - ###< insert into crash_q values(0,0) - ###> OK - ### - ###< drop table crash_q - ###> OK constraint_null=yes # NULL constraint (SyBase style) - ###< create table crash_q (a int null) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES crash_me_safe=yes # crash me safe crash_me_version=1.61 # crash me version create_default=yes # default value for column - ###< create table crash_q (q integer default 10 not null) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES create_default_func=no # default value function for column - ###< create table crash_q (q integer not null,q1 integer default (1+1)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1+1))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO create_if_not_exists=yes # create table if not exists - ###< create table crash_q (q integer) - ###> OK - ###< create table if not exists crash_q (q integer) - ###> OK - ### - ###As far as all queries returned OK, result is YES create_index=yes # create index - ###< create index crash_q on crash_me (a) - ###> OK create_schema=no # Create SCHEMA - ###< create schema crash_schema create table crash_q (a int) create table crash_q2(b int) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema crash_schema create table crash_q (a int) create table c - ###< drop schema crash_schema cascade - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema crash_schema cascade' at line 1 - ### - ###As far as some queries didnt return OK, result is NO create_table_select=yes # create table from select - ###< create table crash_q SELECT * from crash_me - ###> OK cross_join=yes # cross join (same as from a,b) - ###< select crash_me.a from crash_me cross join crash_me3 - ###> OK - ### - ###As far as all queries returned OK, result is YES date_as_string=yes # String functions on date columns - ###< create table crash_me2 (a date not null) - ###> OK - ###< insert into crash_me2 values ('1998-03-03') - ###> OK - ### - ###0000-00-00 - ###We expected '1963-08-16' but got '0000-00-00' - ### - ###< delete from crash_me_d - ###> OK date_format_EUR_with_date=error # Supports DATE 'DD.MM.YYYY' (EUR) format - ###< insert into crash_me_d(a) values (DATE '16.08.1963') - ###> OK - ### - ###1963-08-16 - ### - ###< delete from crash_me_d - ###> OK date_format_ISO_with_date=yes # Supports DATE 'YYYY-MM-DD' (ISO) format - ###< insert into crash_me_d(a) values (DATE '1963-08-16') - ###> OK - ### - ###0000-00-00 - ###We expected '1963-08-16' but got '0000-00-00' - ### - ###< delete from crash_me_d - ###> OK date_format_USA_with_date=error # Supports DATE 'MM/DD/YYYY' format - ###< insert into crash_me_d(a) values (DATE '08/16/1963') - ###> OK - ### - ###1963-08-16 - ### - ###< delete from crash_me_d - ###> OK date_format_YYYYMMDD_with_date=yes # Supports DATE 'YYYYMMDD' format - ###< insert into crash_me_d(a) values (DATE '19630816') - ###> OK - ### - ###0000-00-00 - ###We expected 'infinity' but got '0000-00-00' - ### - ###< drop table crash_me2 - ###> OK date_last=yes # Supports 9999-12-31 dates - ###< create table crash_me2 (a date not null) - ###> OK - ###< insert into crash_me2 values ('9999-12-31') - ###> OK - ### - ###0001-01-01 - ### - ###< drop table crash_me2 - ###> OK date_with_YY=yes # Supports YY-MM-DD 2000 compilant dates - ###< create table crash_me2 (a date not null) - ###> OK - ###< insert into crash_me2 values ('98-03-03') - ###> OK - ### - ###2010-03-03 - ### - ###< drop table crash_me2 - ###> OK date_zero=yes # Supports 0000-00-00 dates - ###< create table crash_me2 (a date not null) - ###> OK - ###< insert into crash_me2 values ('0000-00-00') - ###> OK - ### - ###Walker's drop_if_exists=yes # drop table if exists - ###< create table crash_q (q integer) - ###> OK - ###< drop table if exists crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES drop_index=with 'ON' # drop index - ###< drop index crash_q - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 - ### - ###< drop index crash_q from crash_me - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'from crash_me' at line 1 - ### - ###< drop index crash_q on crash_me - ###> OK drop_requires_cascade=no # drop table require cascade/restrict - ###< create table crash_me (a integer not null) - ###> OK - ###< drop table crash_me - ###> OK drop_restrict=yes # drop table with cascade/restrict - ###< create table crash_q (a int) - ###> OK - ###< drop table crash_q restrict - ###> OK - ### - ###As far as all queries returned OK, result is YES end_colon=yes # allows end ';' - ###< select * from crash_me; - ###> OK - ### - ###As far as all queries returned OK, result is YES except=no # except - ###< select * from crash_me except select * from crash_me3 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me3' at line 1 - ### - ###As far as some queries didnt return OK, result is NO except_all=no # except all - ###< select * from crash_me except all select * from crash_me3 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me3' at line 1 - ### - ###As far as some queries didnt return OK, result is NO except_all_incompat=no # except all (incompatible lists) - ###< select * from crash_me except all select * from crash_me2 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me2' at line 1 - ### - ###As far as some queries didnt return OK, result is NO except_incompat=no # except (incompatible lists) - ###< select * from crash_me except select * from crash_me2 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me2' at line 1 - ### - ###As far as some queries didnt return OK, result is NO field_name_case=yes # case independent field names - ###< create table crash_q (q integer) - ###> OK - ###< insert into crash_q(Q) values (1) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES float_int_expr=yes # mixing of integer and float in expression - ###< select 1+1.0 - ###> OK - ### - ###As far as all queries returned OK, result is YES foreign_key=syntax only # foreign keys - ###< create table crash_me_qf (a integer not null,primary key (a)) - ###> OK - ### - ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) - ###> OK - ### - ###< insert into crash_me_qf values (1) - ###> OK - ### - ###< insert into crash_me_qf2 values (2) - ###> OK - ### - ###< drop table crash_me_qf2 - ###> OK - ### - ###< drop table crash_me_qf - ###> OK full_outer_join=no # full outer join - ###< select crash_me.a from crash_me full join crash_me2 ON - ### crash_me.a=crash_me2.a - ###> execute error:Unknown table 'crash_me' in field list - ### - ###As far as some queries didnt return OK, result is NO func_extra_!=yes # Function NOT as '!' in SELECT - ### - ###3 func_extra_&=yes # Function & (bitwise and) - ### - ###1 func_extra_<>=yes # Function <> in SELECT - ### - ###1 func_extra_add_months=no # Function ADD_MONTHS - ### - ###2002-12-04 func_extra_addtime=yes # Function ADDTIME - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('Aâ',2)' at line 1 func_extra_and_or=yes # Function AND and OR in SELECT - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(65)' at line 1 func_extra_ascii_code=no # Function ASCII_CODE - ### - ###97 - ###We expected 'a' but got '97' func_extra_atn2=no # Function ATN2 - ### - ###a2 func_extra_auto_string2num=yes # Function automatic string->num convert - ### - ###1 func_extra_binary_shifts=yes # Function << and >> (bitwise shifts) - ### - ###2 func_extra_ceil=yes # Function CEIL - ### - ### execute failed:Unknown column 'EUR' in 'field list' func_extra_charindex=no # Function CHARINDEX - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(65)' at line 1 func_extra_chr_str=no # Function CHR (any type to string) - ### - ###0 - ###We expected 'abcdef' but got '0' func_extra_concat_list=yes # Function CONCAT(list) - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '5)' at line 1 func_extra_cosh=no # Function COSH - ### - ###1963-08-16 func_extra_date_format=yes # Function DATE_FORMAT - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(day,3,'1997-11-30') from crash_me_d' at line 1 func_extra_datediff=no # Function DATEDIFF - ### - ###3 func_extra_datename=no # Function DATENAME - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(month,'July 20 1997') from crash_me_d' at line 1 func_extra_day=yes # Function DAY - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1,'S-103',2,'Leopard',3)' at line 1 func_extra_ebcdic_string=no # Function EBCDIC in string cast - ### - ###TWO func_extra_encrypt=yes # Function ENCRYPT - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abcd',6)' at line 1 func_extra_field=yes # Function FIELD - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(222.6666,10,2)' at line 1 func_extra_float=no # Function FLOAT - ### - ###1,234.56 func_extra_from_days=yes # Function FROM_DAYS - ### - ###1970-01-01 02:00:00 func_extra_getdate=no # Function GETDATE - ### - ###HARRY func_extra_hex=yes # Function HEX - ### - ###6 func_extra_in_num=yes # Function IN on numbers in SELECT - ### - ###1 func_extra_index=no # Function INDEX - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('the soap')' at line 1 func_extra_instr=yes # Function LOCATE as INSTR - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '3,2)' at line 1 func_extra_instrb=no # Function INSTRB - ### - ###5 func_extra_last_day=yes # Function LAST_DAY - ### - ###0 func_extra_least=yes # Function LEAST - ### - ###1 - ###We expected '2' but got '1' func_extra_lengthb=no # Function LENGTHB - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abcd','.',6)' at line 1 func_extra_like=yes # Function LIKE in SELECT - ### - ###1 func_extra_ln=yes # Function LN - ### - ###2.000000 func_extra_logn=no # Function LOGN - ### - ###??hi func_extra_ltrim2arg=no # Function LTRIM (2 arg) - ### - ###1963-08-16 func_extra_maketime=yes # Function MAKETIME - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('Aâ')' at line 1 func_extra_mdy=no # Function MDY - ### - ###110000 func_extra_mid=yes # Function SUBSTRING as MID - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('1997-02-02','1997-01-01') from crash_me_d' at line 1 func_extra_noround=no # Function NOROUND - ###< select noround(22.6) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 func_extra_not=yes # Function NOT in SELECT - ### - ###0 func_extra_not_like=yes # Function NOT LIKE in SELECT - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('2123')' at line 1 func_extra_odbc_convert=no # Function ODBC CONVERT - ### - ###*6B4F89A54E2D27ECD7E8DA05B4AB8FD9D1D8B119 func_extra_paste=no # Function PASTE - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('%a%','crash')' at line 1 func_extra_period_add=yes # Function PERIOD_ADD - ### - ###13 func_extra_pow=yes # Function POW - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a)' at line 1 func_extra_regexp=yes # Function REGEXP in SELECT - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 func_extra_replicate=no # Function REPLICATE - ### - ###dcba func_extra_rfill3arg=no # Function RFILL (3 arg) - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(4)' at line 1 func_extra_round1=yes # Function ROUND(1 arg) - ### - ###hi?? func_extra_rpad4arg=no # Function RPAD (4 arg) - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''.')' at line 1 func_extra_sec_to_time=yes # Function SEC_TO_TIME - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1)' at line 1 func_extra_str=no # Function STR - ### - ###-1 func_extra_stuff=no # Function STUFF - ### - ###2002-12-01 func_extra_substr2arg=yes # Function SUBSTR (2 arg) - ### - ###bc func_extra_substrb=no # Function SUBSTRB - ### - ###tcx.se func_extra_subtime=yes # Function SUBTIME - ### - ###2004-04-06 13:49:05 func_extra_tail=no # Function TAIL - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1)' at line 1 func_extra_time=yes # Function TIME - ### - ###5001 func_extra_timediff=yes # Function TIMEDIFF - ### - ###1963-08-16 20:02:12 - ###We expected '19630816200212000000' but got '1963-08-16 20:02:12' func_extra_to_days=yes # Function TO_DAYS - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc','bc','de')' at line 1 func_extra_trim1arg=yes # Function TRIM (1 arg) - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''.')' at line 1 func_extra_trim_many_char=error # Function TRIM; Many char extension - ### - ###abc func_extra_trunc=no # Function TRUNC - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(222.6)' at line 1 func_extra_uid=no # Function UID - ### - ###1081248545 func_extra_userenv=no # Function USERENV - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(NULL,'WALRUS')' at line 1 func_extra_version=yes # Function VERSION - ### - ###5 func_extra_weekofyear=yes # Function WEEKOFYEAR - ### - ###3 func_extra_||=yes # Function OR as '||' - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '~* 'HI'' at line 1 func_odbc_abs=yes # Function ABS - ### - ###1.570796 func_odbc_ascii=yes # Function ASCII - ### - ###1.570796 func_odbc_atan=yes # Function ATAN - ### - ###1.570796 func_odbc_ceiling=yes # Function CEILING - ### - ###A func_odbc_concat=yes # Function CONCAT(2 arg) - ### - ###1.000000 func_odbc_cot=yes # Function COT - ### - ###2004-04-06 func_odbc_curtime=yes # Function CURTIME - ### - ###test func_odbc_dayname=yes # Function DAYNAME - ###< insert into crash_me_d values('1997-02-01') - ### - ###1 func_odbc_dayofweek=yes # Function DAYOFWEEK - ###< insert into crash_me_d values('1997-02-01') - ### - ###32 func_odbc_degrees=yes # Function DEGREES - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('abc','abe')' at line 1 - ### - ###2.718282 func_odbc_floor=yes # Function FLOOR - ### - ###c func_odbc_hour=yes # Function HOUR - ###< insert into crash_me_t values(20:08:16) - ### - ###12 func_odbc_ifnull=yes # Function IFNULL - ### - ###aefd func_odbc_lcase=yes # Function LCASE - ### - ###ab func_odbc_length=yes # Function REAL LENGTH - ### - ###5 - ###We expected '4' but got '5' - ### - ###2 func_odbc_locate_3=yes # Function LOCATE(3 arg) - ### - ###0.693147 func_odbc_log10=yes # Function LOG10 - ### - ###abcd func_odbc_minute=yes # Function MINUTE - ###< insert into crash_me_t values(20:08:16) - ### - ###4 func_odbc_month=yes # Function MONTH - ###< insert into crash_me_d values('1997-02-01') - ### - ###February func_odbc_now=yes # Function NOW - ### - ###3.141593 func_odbc_power=yes # Function POWER - ### - ###1 func_odbc_radians=yes # Function RADIANS - ### - ###0.40540353712198 func_odbc_repeat=yes # Function REPEAT - ### - ###bababa func_odbc_right=yes # Function RIGHT - ### - ###5.63 func_odbc_rtrim=yes # Function RTRIM - ### - ###14 func_odbc_sign=yes # Function SIGN - ### - ###0.841471 func_odbc_soundex=yes # Function SOUNDEX - ### - ### func_odbc_sqrt=yes # Function SQRT - ### - ###cd func_odbc_tan=yes # Function TAN - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')' at line 1 - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(SQL_TSI_SECOND,'1997-01-01 00:00:02', '1997-01-01 00:00:01')' - ### - ###10 func_odbc_ucase=yes # Function UCASE - ### - ###monty@localhost func_odbc_week=USA # WEEK - ###1997 func_sql_+=yes # Function +, -, * and / - ### - ###24 func_sql_cast=yes # Function CAST - ### - ###1 - ###We expected '10' but got '1' func_sql_char_length(constant)=yes # Function CHAR_LENGTH(constant) - ### - ###4 func_sql_coalesce=yes # Function COALESCE - ### - ###0 - ###We expected 'abcdef' but got '0' func_sql_current_date=yes # Function CURRENT_DATE - ### - ###13:49:04 func_sql_current_timestamp=yes # Function CURRENT_TIMESTAMP - ### - ###43 func_sql_localtime=yes # Function LOCALTIME - ### - ###2004-04-06 13:49:04 func_sql_lower=yes # Function LOWER - ### - ### func_sql_nullif_string=yes # Function NULLIF with strings - ### - ###3 func_sql_position=yes # Function POSITION - ### - ### 2 then 'false' when 2 > 1 then 'true' end - ###>true func_sql_session_user=with_parenthesis # SESSION_USER - ###< select SESSION_USER - ###> execute error:Unknown column 'SESSION_USER' in 'field list' - ### - ###< select SESSION_USER() - ###> OK func_sql_simple_case=yes # Function simple CASE - ### - ###bc func_sql_system_user=with_parenthesis # SYSTEM_USER - ###< select SYSTEM_USER - ###> execute error:Unknown column 'SYSTEM_USER' in 'field list' - ### - ###< select SYSTEM_USER() - ###> OK func_sql_trim=yes # Function TRIM - ### - ###ABC func_sql_user=with_parenthesis # USER - ###< select USER - ###> execute error:Unknown column 'USER' in 'field list' - ### - ###< select USER() - ###> OK func_where_between=yes # Function BETWEEN - ### - ###1 func_where_eq_any=yes # Function = ANY - ### - ###1 func_where_exists=yes # Function EXISTS - ### - ###1 func_where_like=yes # Function LIKE - ### - ###1 func_where_match=no # Function MATCH - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'match unique (select a from crash_me)' at line 1 func_where_matches=no # Function MATCHES - ### - ###1 func_where_not_exists=yes # Function NOT EXISTS - ### - ###1 func_where_not_unique=no # Function NOT UNIQUE - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'unique (select * from crash_me)' at line 1 functions=yes # Functions - ###< select 1+1 - ###> OK - ### - ###As far as all queries returned OK, result is YES group_by=yes # Group by - ###< select a from crash_me group by a - ###> OK - ### - ###As far as all queries returned OK, result is YES group_by_alias=yes # Group by alias - ###< select a as ab from crash_me group by ab - ###> OK - ### - ###As far as all queries returned OK, result is YES group_by_null=yes # Group on column with null values - ###< create table crash_q (s char(10)) - ###> OK - ###< insert into crash_q values(null) - ###> OK - ###< insert into crash_q values(null) - ###> OK - ### - ###1 group_func_extra_bit_or=yes # Group function BIT_OR - ### - ###1 group_func_extra_std=yes # Group function STD - ### - ###0.0000 group_func_extra_variance=yes # Group function VARIANCE - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a),a from crash_me group by a' at line 1 group_func_sql_avg=yes # Group function AVG - ### - ###1 group_func_sql_count_column=yes # Group function COUNT column name - ### - ###1 group_func_sql_every=no # Group function EVERY - ### - ###1 group_func_sql_max_str=yes # Group function MAX on strings - ### - ###1 group_func_sql_min_str=yes # Group function MIN on strings - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a),a from crash_me group by a' at line 1 group_func_sql_sum=yes # Group function SUM - ### - ### 0 - ###>1 - ### - ###a index_in_create=yes # index in create table - ###< create table crash_q (q integer not null,index (q)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES index_namespace=yes # different namespace for index - ###< create index crash_me on crash_me (b) - ###> OK - ###< drop index crash_me on crash_me - ###> OK - ### - ###As far as all queries returned OK, result is YES index_parts=yes # index on column part (extension) - ###< create index crash_q on crash_me (b(5)) - ###> OK - ###< drop index crash_q on crash_me - ###> OK - ### - ###As far as all queries returned OK, result is YES inner_join=yes # inner join - ###< select crash_me.a from crash_me inner join crash_me2 ON crash_me.a=crash_me2.a - ###> OK - ### - ###As far as all queries returned OK, result is YES insert_default_values=no # INSERT DEFAULT VALUES - ###< create table crash_me_q (a int) - ###> OK - ###< insert into crash_me_q DEFAULT VALUES - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1 - ###< drop table crash_me_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO insert_empty_string=yes # insert empty string - ###< create table crash_q (a char(10) not null,b char(10)) - ###> OK - ###< insert into crash_q values ('','') - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES insert_multi_value=yes # INSERT with Value lists - ###< create table crash_q (s char(10)) - ###> OK - ###< insert into crash_q values ('a'),('b') - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES insert_select=yes # insert INTO ... SELECT ... - ###< create table crash_q (a int) - ###> OK - ###< insert into crash_q (a) SELECT crash_me.a from crash_me - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES insert_with_default=yes # INSERT with DEFAULT - ###< create table crash_me_q (a int) - ###> OK - ###< insert into crash_me_q (a) values (DEFAULT) - ###> OK - ###< drop table crash_me_q - ###> OK - ### - ###As far as all queries returned OK, result is YES insert_with_empty_value_list=no # INSERT with empty value list - ###< create table crash_me_q (a int) - ###> OK - ###< insert into crash_me_q (a) values () - ###> execute error:Column count doesn't match value count at row 1 - ###< drop table crash_me_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO insert_with_set=yes # INSERT with set syntax - ###< create table crash_q (a integer) - ###> OK - ###< insert into crash_q SET a=1 - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES intersect=no # intersect - ###< select * from crash_me intersect select * from crash_me3 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me3' at line 1 - ### - ###As far as some queries didnt return OK, result is NO intersect_all=no # intersect all - ###< select * from crash_me intersect all select * from crash_me3 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me3' at line 1 - ### - ###As far as some queries didnt return OK, result is NO intersect_all_incompat=no # intersect all (incompatible lists) - ###< select * from crash_me intersect all select * from crash_me2 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'all select * from crash_me2' at line 1 - ### - ###As far as some queries didnt return OK, result is NO intersect_incompat=no # intersect (incompatible lists) - ###< select * from crash_me intersect select * from crash_me2 - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from crash_me2' at line 1 - ### - ###As far as some queries didnt return OK, result is NO join_tables=61 # tables in join - ###We are trying (example with N=5): - ###select crash_me.a,t0.a,t1.a,t2.a,t3.a,t4.a from crash_me,crash_me t0,crash_me t1,crash_me t2,crash_me t3,crash_me t4 - ### 32:OK 48:OK 56:OK 60:OK 62:FAIL 61:FAIL left_outer_join=yes # left outer join - ###< select crash_me.a from crash_me left join crash_me2 ON crash_me.a=crash_me2.a - ###> OK - ### - ###As far as all queries returned OK, result is YES left_outer_join_using=yes # left outer join using - ###< select c1 from crash_me left join crash_me2 using (a) - ###> OK - ### - ###As far as all queries returned OK, result is YES length_of_varchar_field=actual length # CHARACTER_LENGTH(varchar_field) - ###< CREATE TABLE crash_me1 (S1 VARCHAR(100)) - ###> OK - ###< INSERT INTO crash_me1 VALUES ('X') - ###> OK - ### - ###< SELECT CHARACTER_LENGTH(S1) FROM crash_me1 - ### > 1 - ###< drop table crash_me1 - ###> OK like_with_column=yes # column LIKE column - ###< create table crash_q (a char(10),b char(10)) - ###> OK - ###< insert into crash_q values('abc','abc') - ###> OK - ###< select * from crash_q where a like b - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES like_with_number=yes # LIKE on numbers - ###< create table crash_q (a int,b int) - ###> OK - ###< insert into crash_q values(10,10) - ###> OK - ###< select * from crash_q where a like '10' - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES lock_tables=yes # lock table - ###< lock table crash_me READ - ###> OK - ###< unlock tables - ###> OK - ### - ###As far as all queries returned OK, result is YES logical_value=1 # Value of logical operation (1=1) - ###2 multi_drop=yes # many tables to drop table - ###< create table crash_q (a int) - ###> OK - ###< create table crash_q2 (a int) - ###> OK - ###< drop table crash_q,crash_q2 - ###> OK - ### - ###As far as all queries returned OK, result is YES multi_null_in_unique=yes # null in unique index - ###< create table crash_q (q integer, x integer,unique (q)) - ###> OK - ###< insert into crash_q(x) values(1) - ###> OK - ###< insert into crash_q(x) values(2) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES multi_strings=yes # Multiple line strings - ### - ###a - ### - ###< drop table crash_q - ###> OK natural_join=yes # natural join - ###< select * from crash_me natural join crash_me3 - ###> OK - ### - ###As far as all queries returned OK, result is YES natural_join_incompat=yes # natural join (incompatible lists) - ###< select c1 from crash_me natural join crash_me2 - ###> OK - ### - ###As far as all queries returned OK, result is YES natural_left_outer_join=yes # natural left outer join - ###< select c1 from crash_me natural left join crash_me2 - ###> OK - ### - ###As far as all queries returned OK, result is YES no_primary_key=yes # Tables without primary key - ###< create table crash_me (a integer not null,b char(10) not null) - ###> OK - ###< insert into crash_me (a,b) values (1,'a') - ###> OK -not_id_between=no # NOT ID BETWEEN interprets as ID NOT BETWEEN - ###< create table crash_me_b (i int) - ###> OK - ###< insert into crash_me_b values(2) - ###> OK - ###< insert into crash_me_b values(5) - ###> OK - ### - ### null_in_index=yes # null in index - ###< create table crash_q (a char(10),index (a)) - ###> OK - ###< insert into crash_q values (NULL) - ###> OK - ### - ### nulls_in_unique=yes # null combination in unique index - ###< create table crash_q (q integer,q1 integer,unique (q,q1)) - ###> OK - ###< insert into crash_q (q,q1) values(1,NULL) - ###> OK - ###< insert into crash_q (q,q1) values(1,NULL) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES odbc_left_outer_join=yes # left outer join odbc style - ###< select crash_me.a from { oj crash_me left outer join crash_me2 ON crash_me.a=crash_me2.a } - ###> OK - ### - ###As far as all queries returned OK, result is YES -operating_system=Linux 2.4.21-199-smp4G i686 # crash-me tested on +operating_system=Linux 2.6.8-my i686 # crash-me tested on order_by=yes # Order by - ###< select a from crash_me order by a - ###> OK - ### - ###As far as all queries returned OK, result is YES order_by_alias=yes # Order by alias - ###< select a as ab from crash_me order by ab - ###> OK - ### - ###As far as all queries returned OK, result is YES order_by_function=yes # Order by function - ###< select a from crash_me order by a+1 - ###> OK - ### - ###As far as all queries returned OK, result is YES order_by_position=yes # Order by position - ###< select a from crash_me order by 1 - ###> OK - ### - ###As far as all queries returned OK, result is YES order_on_unused=yes # Order by on unused column - ###< select b from crash_me order by a - ###> OK - ### - ###As far as all queries returned OK, result is YES position_of_null=first # Where is null values in sorted recordset - ###< insert into crash_me_n (i) values(1) - ###> OK - ###< insert into crash_me_n values(2,2) - ###> OK - ###< insert into crash_me_n values(3,3) - ###> OK - ###< insert into crash_me_n values(4,4) - ###> OK - ###< insert into crash_me_n (i) values(5) - ###> OK - ### - ###< select r from crash_me_n order by r - ###> - ###> - ###> 2 - ###> 3 - ###> 4 position_of_null_desc=last # Where is null values in sorted recordset (DESC) - ###< select r from crash_me_n order by r desc - ###> 4 - ###> 3 - ###> 2 - ###> - ###> primary_key_in_create=yes # primary key in create table - ###< create table crash_q (q integer not null,primary key (q)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES psm_functions=no # PSM functions (ANSI SQL) - ###< create table crash_q (a int) - ###> OK - ###< create function crash_func(in a1 int, in b1 int) returns int language sql deterministic contains sql begin return a1 * b1; end - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(in a1 int, in b1 int) returns int language sql deterministic c - ###< insert into crash_q values(crash_func(2,4)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(2,4))' at line 1 - ###< select a,crash_func(a,2) from crash_q - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(a,2) from crash_q' at line 1 - ###< drop function crash_func cascade - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'cascade' at line 1 - ###< drop table crash_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO psm_modules=no # PSM modules (ANSI SQL) - ###< create table crash_q (a int,b int) - ###> OK - ###< create module crash_m declare procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end; declare procedure crash_proc2(INOUT a int, in b int) contains sql set a = b + 10; end module - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'module crash_m declare procedure crash_proc(in a1 int, in b1 in - ###< call crash_proc(1,10) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'call crash_proc(1,10)' at line 1 - ###< drop module crash_m cascade - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'module crash_m cascade' at line 1 - ###< drop table crash_q cascade - ###> OK - ### - ###As far as some queries didnt return OK, result is NO psm_procedures=no # PSM procedures (ANSI SQL) - ###< create table crash_q (a int,b int) - ###> OK - ###< create procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure crash_proc(in a1 int, in b1 int) language sql modifie - ###< call crash_proc(1,10) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'call crash_proc(1,10)' at line 1 - ###< drop procedure crash_proc - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'procedure crash_proc' at line 1 - ###< drop table crash_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO psm_trigger=no # Triggers (ANSI SQL) - ###< create table crash_q (a int ,b int) - ###> OK - ###< create trigger crash_trigger after insert on crash_q referencing new table as new_a when (localtime > time '18:00:00') begin atomic end - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger crash_trigger after insert on crash_q referencing new t - ###< insert into crash_q values(1,2) - ###> OK - ###< drop trigger crash_trigger - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger crash_trigger' at line 1 - ###< drop table crash_q - ###> OK - ### - ###As far as some queries didnt return OK, result is NO query_size=1048574 # query size quote_ident_with_"=error # " as identifier quote (ANSI SQL) - ### - ### execute failed:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '[A] from crash_me' at line 1 quote_ident_with_`=yes # ` as identifier quote - ### - ###hello - ###We expected 'hello ' but got 'hello' - ### - ###< drop table crash_q - ###> OK -remember_end_space_varchar=no # Remembers end space in varchar() - ###< create table crash_q (a varchar(10)) - ###> OK - ###< insert into crash_q values('hello ') - ###> OK - ### - ###0 - ###We expected '1' but got '0' +safe_decimal_arithmetic=yes # safe decimal arithmetic select_constants=yes # Select constants - ###< select 1 - ###> OK - ### - ###As far as all queries returned OK, result is YES select_limit=with LIMIT # LIMIT number of rows - ###< select * from crash_me limit 1 - ###> OK select_limit2=yes # SELECT with LIMIT #,# - ###< select * from crash_me limit 1,1 - ###> OK - ### - ###As far as all queries returned OK, result is YES select_limit3=yes # SELECT with LIMIT # OFFSET # - ###< select * from crash_me limit 1 offset 1 - ###> OK - ### - ###As far as all queries returned OK, result is YES select_string_size=1048565 # constant string size in SELECT - ###We are trying (example with N=5): - ###select 'aaaaa' select_table_update=yes # Update with sub select - ###< create table crash_q (a integer,b char(10)) - ###> OK - ###< insert into crash_q values(1,'c') - ###> OK - ###< update crash_q set b= (select b from crash_me where crash_q.a = crash_me.a) - ###> OK - ### - ###1.1 - ### - ###< drop table crash_q - ###> OK - ### - ###< create table crash_q (q1 float(4,1)) - ###> OK - ###< insert into crash_q values(1.16) - ###> OK - ### - ###1.1 - ### - ###< drop table crash_q - ###> OK - ### - ###< create table crash_q (q1 float(4,1)) - ###> OK - ###< insert into crash_q values(1.16) - ###> OK - ### - ###00:00:20 - ###We expected '20:08:16' but got '00:00:20' - ### - ###< delete from crash_me_t - ###> OK time_format_HHHHMMSS=yes # Supports HHHHmmSS time format - ###< insert into crash_me_t(a) values ('00200816') - ###> OK - ### - ###20:08:16 - ### - ###< delete from crash_me_t - ###> OK time_format_USA=error # Supports HH:MM:SS (AM|PM) time format - ###< insert into crash_me_t(a) values ('08:08:16 PM') - ###> OK - ### - ###1 - ###We expected '' but got '1' truncate_table=yes # truncate - ###< create table crash_q (a integer, b integer,c1 CHAR(10)) - ###> OK - ###< truncate table crash_q - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_abstime=no # Type abstime - ###< create table crash_q (q abstime) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'abstime)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_bfile=no # Type bfile - ###< create table crash_q (q bfile) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'bfile)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_blob=yes # Type blob - ###< create table crash_q (q blob) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_bool=yes # Type bool - ###< create table crash_q (q bool) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_box=no # Type box - ###< create table crash_q (q box) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'box)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_byte=no # Type byte - ###< create table crash_q (q byte) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'byte)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_char(1_arg)_binary=yes # Type char(1 arg) binary - ###< create table crash_q (q char(10) binary) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_cidr=no # Type cidr - ###< create table crash_q (q cidr) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'cidr)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_circle=no # Type circle - ###< create table crash_q (q circle) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'circle)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_clob=no # Type clob - ###< create table crash_q (q clob) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'clob)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_datetime=yes # Type datetime - ###< create table crash_q (q datetime) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_double=yes # Type double - ###< create table crash_q (q double) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_enum(1_arg)=yes # Type enum(1 arg) - ###< create table crash_q (q enum('red')) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_float(2_arg)=yes # Type float(2 arg) - ###< create table crash_q (q float(6,2)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_float4=yes # Type float4 - ###< create table crash_q (q float4) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_float8=yes # Type float8 - ###< create table crash_q (q float8) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_image=no # Type image - ###< create table crash_q (q image) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'image)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_inet=no # Type inet - ###< create table crash_q (q inet) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_int(1_arg)_zerofill=yes # Type int(1 arg) zerofill - ###< create table crash_q (q int(5) zerofill) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int1=yes # Type int1 - ###< create table crash_q (q int1) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int2=yes # Type int2 - ###< create table crash_q (q int2) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int3=yes # Type int3 - ###< create table crash_q (q int3) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int4=yes # Type int4 - ###< create table crash_q (q int4) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int8=yes # Type int8 - ###< create table crash_q (q int8) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int_auto_increment=yes # Type int not null auto_increment - ###< create table crash_q (q int not null auto_increment,unique(q)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_int_identity=no # Type int not null identity - ###< create table crash_q (q int not null identity,unique(q)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'identity,unique(q))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_int_unsigned=yes # Type int unsigned - ###< create table crash_q (q int unsigned) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_interval=no # Type interval - ###< create table crash_q (q interval) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_line=no # Type line - ###< create table crash_q (q line) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'line)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_long=yes # Type long - ###< create table crash_q (q long) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_long_raw=no # Type long raw - ###< create table crash_q (q long raw) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'raw)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_long_varbinary=yes # Type long varbinary - ###< create table crash_q (q long varbinary) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_long_varchar(1_arg)=no # Type long varchar(1 arg) - ###< create table crash_q (q long varchar(1)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_lseg=no # Type lseg - ###< create table crash_q (q lseg) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'lseg)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_macaddr=no # Type macaddr - ###< create table crash_q (q macaddr) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'macaddr)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_mediumint=yes # Type mediumint - ###< create table crash_q (q mediumint) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_mediumtext=yes # Type mediumtext - ###< create table crash_q (q mediumtext) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_middleint=yes # Type middleint - ###< create table crash_q (q middleint) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_mlslabel=no # Type mlslabel - ###< create table crash_q (q mlslabel) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mlslabel)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_money=no # Type money - ###< create table crash_q (q money) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'money)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_nclob=no # Type nclob - ###< create table crash_q (q nclob) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'nclob)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_number=no # Type number - ###< create table crash_q (q number) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_number(1_arg)=no # Type number(1 arg) - ###< create table crash_q (q number(9)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number(9))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_number(2_arg)=no # Type number(2 arg) - ###< create table crash_q (q number(9,2)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'number(9,2))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_nvarchar2(1_arg)=no # Type nvarchar2(1 arg) - ###< create table crash_q (q nvarchar2(16)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'nvarchar2(16))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_path=no # Type path - ###< create table crash_q (q path) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'path)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_point=yes # Type point - ###< create table crash_q (q point) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_polygon=yes # Type polygon - ###< create table crash_q (q polygon) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_raw(1_arg)=no # Type raw(1 arg) - ###< create table crash_q (q raw(16)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'raw(16))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_reltime=no # Type reltime - ###< create table crash_q (q reltime) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'reltime)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_rowid=no # Type rowid - ###< create table crash_q (q rowid) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'rowid)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_serial=yes # Type serial - ###< create table crash_q (q serial) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_set(1_arg)=yes # Type set(1 arg) - ###< create table crash_q (q set('red')) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_smalldatetime=no # Type smalldatetime - ###< create table crash_q (q smalldatetime) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smalldatetime)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_smallfloat=no # Type smallfloat - ###< create table crash_q (q smallfloat) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallfloat)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_smallmoney=no # Type smallmoney - ###< create table crash_q (q smallmoney) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallmoney)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_text=yes # Type text - ###< create table crash_q (q text) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_text(1_arg)=yes # Type text(1 arg) - ###< create table crash_q (q text(10)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_extra_timespan=no # Type timespan - ###< create table crash_q (q timespan) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'timespan)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_uint=no # Type uint - ###< create table crash_q (q uint) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'uint)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_varchar2(1_arg)=no # Type varchar2(1 arg) - ###< create table crash_q (q varchar2(257)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar2(257))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_extra_year=yes # Type year - ###< create table crash_q (q year) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_odbc_bigint=yes # Type bigint - ###< create table crash_q (q bigint) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_odbc_binary(1_arg)=yes # Type binary(1 arg) - ###< create table crash_q (q binary(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_odbc_datetime=yes # Type datetime - ###< create table crash_q (q datetime) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_odbc_tinyint=yes # Type tinyint - ###< create table crash_q (q tinyint) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_odbc_varbinary(1_arg)=yes # Type varbinary(1 arg) - ###< create table crash_q (q varbinary(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_bit=yes # Type bit - ###< create table crash_q (q bit) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_bit(1_arg)=yes # Type bit(1 arg) - ###< create table crash_q (q bit(2)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg) - ###< create table crash_q (q bit varying(2)) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'varying(2))' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_boolean=yes # Type boolean - ###< create table crash_q (q boolean) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_char(1_arg)=yes # Type char(1 arg) - ###< create table crash_q (q char(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_char_varying(1_arg)=yes # Type char varying(1 arg) - ###< create table crash_q (q char varying(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_character(1_arg)=yes # Type character(1 arg) - ###< create table crash_q (q character(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_character_varying(1_arg)=yes # Type character varying(1 arg) - ###< create table crash_q (q character varying(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_date=yes # Type date - ###< create table crash_q (q date) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_dec(2_arg)=yes # Type dec(2 arg) - ###< create table crash_q (q dec(6,2)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_decimal(2_arg)=yes # Type decimal(2 arg) - ###< create table crash_q (q decimal(6,2)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_double_precision=yes # Type double precision - ###< create table crash_q (q double precision) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_float=yes # Type float - ###< create table crash_q (q float) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_float(1_arg)=yes # Type float(1 arg) - ###< create table crash_q (q float(8)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_int=yes # Type int - ###< create table crash_q (q int) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_integer=yes # Type integer - ###< create table crash_q (q integer) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_interval_day=no # Type interval day - ###< create table crash_q (q interval day) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_day_to_hour=no # Type interval day to hour - ###< create table crash_q (q interval day to hour) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to hour)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_day_to_minute=no # Type interval day to minute - ###< create table crash_q (q interval day to minute) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to minute)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_day_to_second=no # Type interval day to second - ###< create table crash_q (q interval day to second) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval day to second)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_hour=no # Type interval hour - ###< create table crash_q (q interval hour) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_hour_to_minute=no # Type interval hour to minute - ###< create table crash_q (q interval hour to minute) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour to minute)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_hour_to_second=no # Type interval hour to second - ###< create table crash_q (q interval hour to second) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval hour to second)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_minute=no # Type interval minute - ###< create table crash_q (q interval minute) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval minute)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_minute_to_second=no # Type interval minute to second - ###< create table crash_q (q interval minute to second) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval minute to second)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_month=no # Type interval month - ###< create table crash_q (q interval month) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval month)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_second=no # Type interval second - ###< create table crash_q (q interval second) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval second)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_year=no # Type interval year - ###< create table crash_q (q interval year) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval year)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_interval_year_to_month=no # Type interval year to month - ###< create table crash_q (q interval year to month) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval year to month)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_national_char_varying(1_arg)=yes # Type national char varying(1 arg) - ###< create table crash_q (q national char varying(20)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_national_character(1_arg)=yes # Type national character(1 arg) - ###< create table crash_q (q national character(20)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_national_character_varying(1_arg)=yes # Type national character varying(1 arg) - ###< create table crash_q (q national character varying(20)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_nchar(1_arg)=yes # Type nchar(1 arg) - ###< create table crash_q (q nchar(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_nchar_varying(1_arg)=yes # Type nchar varying(1 arg) - ###< create table crash_q (q nchar varying(20)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_numeric(2_arg)=yes # Type numeric(2 arg) - ###< create table crash_q (q numeric(9,2)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_real=yes # Type real - ###< create table crash_q (q real) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_smallint=yes # Type smallint - ###< create table crash_q (q smallint) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_time=yes # Type time - ###< create table crash_q (q time) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_timestamp=yes # Type timestamp - ###< create table crash_q (q timestamp) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES type_sql_timestamp_with_time_zone=no # Type timestamp with time zone - ###< create table crash_q (q timestamp with time zone) - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'with time zone)' at line 1 - ###< drop table crash_q - ###> execute error:Unknown table 'crash_q' - ### - ###As far as some queries didnt return OK, result is NO type_sql_varchar(1_arg)=yes # Type varchar(1 arg) - ###< create table crash_q (q varchar(1)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES union=yes # union - ###< select * from crash_me union select a,b from crash_me3 - ###> OK - ### - ###As far as all queries returned OK, result is YES union_all=yes # union all - ###< select * from crash_me union all select a,b from crash_me3 - ###> OK - ### - ###As far as all queries returned OK, result is YES union_all_incompat=yes # union all (incompatible lists) - ###< select * from crash_me union all select a,b from crash_me2 - ###> OK - ### - ###As far as all queries returned OK, result is YES union_incompat=yes # union (incompatible lists) - ###< select * from crash_me union select a,b from crash_me2 - ###> OK - ### - ###As far as all queries returned OK, result is YES unique_in_create=yes # unique in create table - ###< create table crash_q (q integer not null,unique (q)) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES unique_null_in_create=yes # unique null in create - ###< create table crash_q (q integer,unique (q)) - ###> OK - ###< insert into crash_q (q) values (NULL) - ###> OK - ###< insert into crash_q (q) values (NULL) - ###> OK - ###< insert into crash_q (q) values (1) - ###> OK - ###< drop table crash_q - ###> OK - ### - ###As far as all queries returned OK, result is YES value_of_false=0 # Value of FALSE - ###1 -views=no # views - ###< create view crash_q as select a from crash_me - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'view crash_q as select a from crash_me' at line 1 - ###< drop view crash_q - ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'view crash_q' at line 1 - ### - ###As far as some queries didnt return OK, result is NO +views=yes # views where_string_size=1048539 # constant string size in where - ###We are trying (example with N=5): - ###select a from crash_me where b >='11111' diff --git a/sql/item.h b/sql/item.h index 18b419dd6d5..841c8c62e22 100644 --- a/sql/item.h +++ b/sql/item.h @@ -284,7 +284,9 @@ public: Item(THD *thd, Item *item); virtual ~Item() { +#ifdef EXTRA_DEBUG name=0; +#endif } /*lint -e1509 */ void set_name(const char *str,uint length, CHARSET_INFO *cs); void rename(char *new_name); diff --git a/sql/item_func.cc b/sql/item_func.cc index 47dffa679e9..9d930c7f4ca 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -211,15 +211,16 @@ void Item_func::set_arguments(List &list) { allowed_arg_cols= 1; arg_count=list.elements; - if ((args=(Item**) sql_alloc(sizeof(Item*)*arg_count))) + args= tmp_arg; // If 2 arguments + if (arg_count <= 2 || (args=(Item**) sql_alloc(sizeof(Item*)*arg_count))) { - uint i=0; List_iterator_fast li(list); Item *item; + Item **save_args= args; while ((item=li++)) { - args[i++]= item; + *(save_args++)= item; with_sum_func|=item->with_sum_func; } } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index a061a28d346..82f9a6b458c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -94,7 +94,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define MAX_FIELDS_BEFORE_HASH 32 #define USER_VARS_HASH_SIZE 16 #define STACK_MIN_SIZE 8192 // Abort if less stack during eval. -#define STACK_BUFF_ALLOC 64 // For stack overrun checks +#define STACK_BUFF_ALLOC 256 // For stack overrun checks #ifndef MYSQLD_NET_RETRY_COUNT #define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int. #endif diff --git a/sql/sp_head.cc b/sql/sp_head.cc index fcca1b51d1c..2a79d927a47 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1904,21 +1904,21 @@ sp_instr_copen::execute(THD *thd, uint *nextp) else { sp_lex_keeper *lex_keeper= c->pre_open(thd); - - if (!lex_keeper) + if (!lex_keeper) // cursor already open or OOM { res= -1; *nextp= m_ip+1; } else + { res= lex_keeper->reset_lex_and_exec_core(thd, nextp, FALSE, this); - - c->post_open(thd, (lex_keeper ? TRUE : FALSE)); + c->post_open(thd, res ? FALSE : TRUE); + } } - DBUG_RETURN(res); } + int sp_instr_copen::exec_core(THD *thd, uint *nextp) { diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 2e79a1e2533..0e8210301c1 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -168,8 +168,22 @@ sp_rcontext::pop_cursors(uint count) * */ -// We have split this in two to make it easy for sp_instr_copen -// to reuse the sp_instr::exec_stmt() code. +/* + pre_open cursor + + SYNOPSIS + pre_open() + THD Thread handler + + NOTES + We have to open cursor in two steps to make it easy for sp_instr_copen + to reuse the sp_instr::exec_stmt() code. + If this function returns 0, post_open should not be called + + RETURN + 0 ERROR +*/ + sp_lex_keeper* sp_cursor::pre_open(THD *thd) { @@ -179,32 +193,31 @@ sp_cursor::pre_open(THD *thd) MYF(0)); return NULL; } - - bzero((char *)&m_mem_root, sizeof(m_mem_root)); init_alloc_root(&m_mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); if ((m_prot= new Protocol_cursor(thd, &m_mem_root)) == NULL) return NULL; - m_oprot= thd->protocol; // Save the original protocol - thd->protocol= m_prot; - + /* Save for execution. Will be restored in post_open */ + m_oprot= thd->protocol; m_nseof= thd->net.no_send_eof; + + /* Change protocol for execution */ + thd->protocol= m_prot; thd->net.no_send_eof= TRUE; return m_lex_keeper; } + void sp_cursor::post_open(THD *thd, my_bool was_opened) { thd->net.no_send_eof= m_nseof; // Restore the originals thd->protocol= m_oprot; - if (was_opened) - { - m_isopen= was_opened; + if ((m_isopen= was_opened)) m_current_row= m_prot->data; - } } + int sp_cursor::close(THD *thd) { @@ -217,6 +230,7 @@ sp_cursor::close(THD *thd) return 0; } + void sp_cursor::destroy() { @@ -225,7 +239,6 @@ sp_cursor::destroy() delete m_prot; m_prot= NULL; free_root(&m_mem_root, MYF(0)); - bzero((char *)&m_mem_root, sizeof(m_mem_root)); } m_isopen= FALSE; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b36f88cf8c8..6cba5f04b10 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4502,7 +4502,8 @@ unsent_create_error: send_ok(thd); break; } - if (thd->transaction.xa_state == XA_IDLE && thd->lex->xa_opt == XA_ONE_PHASE) + if (thd->transaction.xa_state == XA_IDLE && + thd->lex->xa_opt == XA_ONE_PHASE) { int r; if ((r= ha_commit(thd))) @@ -4510,8 +4511,8 @@ unsent_create_error: else send_ok(thd); } - else - if (thd->transaction.xa_state == XA_PREPARED && thd->lex->xa_opt == XA_NONE) + else if (thd->transaction.xa_state == XA_PREPARED && + thd->lex->xa_opt == XA_NONE) { if (wait_if_global_read_lock(thd, 0, 0)) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1e340caaa38..183a55fd2c2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -955,32 +955,35 @@ JOIN::optimize() #endif DBUG_EXECUTE("info",TEST_join(this);); - /* - Because filesort always does a full table scan or a quick range scan - we must add the removed reference to the select for the table. - We only need to do this when we have a simple_order or simple_group - as in other cases the join is done before the sort. - */ - if (const_tables != tables && - (order || group_list) && - join_tab[const_tables].type != JT_ALL && - join_tab[const_tables].type != JT_FT && - join_tab[const_tables].type != JT_REF_OR_NULL && - (order && simple_order || group_list && simple_group)) - { - if (add_ref_to_table_cond(thd,&join_tab[const_tables])) - DBUG_RETURN(1); - } - if (!(select_options & SELECT_BIG_RESULT) && - ((group_list && const_tables != tables && - (!simple_group || - !test_if_skip_sort_order(&join_tab[const_tables], group_list, - unit->select_limit_cnt, 0))) || - select_distinct) && - tmp_table_param.quick_group && !procedure) + if (const_tables != tables) { - need_tmp=1; simple_order=simple_group=0; // Force tmp table without sort + /* + Because filesort always does a full table scan or a quick range scan + we must add the removed reference to the select for the table. + We only need to do this when we have a simple_order or simple_group + as in other cases the join is done before the sort. + */ + if ((order || group_list) && + join_tab[const_tables].type != JT_ALL && + join_tab[const_tables].type != JT_FT && + join_tab[const_tables].type != JT_REF_OR_NULL && + (order && simple_order || group_list && simple_group)) + { + if (add_ref_to_table_cond(thd,&join_tab[const_tables])) + DBUG_RETURN(1); + } + + if (!(select_options & SELECT_BIG_RESULT) && + ((group_list && + (!simple_group || + !test_if_skip_sort_order(&join_tab[const_tables], group_list, + unit->select_limit_cnt, 0))) || + select_distinct) && + tmp_table_param.quick_group && !procedure) + { + need_tmp=1; simple_order=simple_group=0; // Force tmp table without sort + } } tmp_having= having; @@ -5219,7 +5222,10 @@ add_found_match_trig_cond(JOIN_TAB *tab, COND *cond, JOIN_TAB *root_tab) tmp= new Item_func_trig_cond(tmp, &tab->found); } if (tmp) + { tmp->quick_fix_field(); + tmp->update_used_tables(); + } return tmp; } @@ -5376,6 +5382,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) JOIN_TAB *first_inner_tab= tab->first_inner; table_map current_map= tab->table->map; bool use_quick_range=0; + COND *tmp; + /* Following force including random expression in last table condition. It solve problem with select like SELECT * FROM t1 WHERE rand() > 0.5 @@ -5397,7 +5405,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) join->best_positions[i].records_read= rows2double(tab->quick->records); } - COND *tmp= NULL; + tmp= NULL; if (cond) tmp= make_cond_for_table(cond,used_tables,current_map); if (cond && !tmp && tab->quick) From b7696f414caf7499a86fb68f3ec2ca523ee515eb Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 5 Jun 2005 16:20:22 +0200 Subject: [PATCH 07/22] sp_rcontext.cc, sp_pcontext.cc, sp_head.cc, sp_cache.cc, ha_federated.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION --- sql/ha_federated.cc | 5 ++--- sql/sp_cache.cc | 3 +-- sql/sp_head.cc | 3 +-- sql/sp_pcontext.cc | 2 +- sql/sp_rcontext.cc | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index c76034c7986..89210a2f3cd 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -345,12 +345,11 @@ */ -#ifdef __GNUC__ +#include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_FEDERATED_DB #include "ha_federated.h" #define MAX_REMOTE_SIZE IO_SIZE diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index 83811e76f9b..c8f0ed6ba2d 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -14,11 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif - -#include "mysql_priv.h" #include "sp_cache.h" #include "sp_head.h" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c17c8b81cb2..84694d6b386 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -14,11 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif - -#include "mysql_priv.h" #include "sp_head.h" #include "sp.h" #include "sp_pcontext.h" diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index f95a43eb903..0de7fe212c0 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif @@ -22,7 +23,6 @@ #undef SAFEMALLOC /* Problems with threads */ #endif -#include "mysql_priv.h" #include "sp_pcontext.h" #include "sp_head.h" diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 2e79a1e2533..0b5e7448d6c 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif @@ -22,7 +23,6 @@ #undef SAFEMALLOC /* Problems with threads */ #endif -#include "mysql_priv.h" #include "mysql.h" #include "sp_head.h" #include "sp_rcontext.h" From c2f7e4d610ff152e81f552424409a1307acc76ad Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Sun, 5 Jun 2005 23:00:45 +0400 Subject: [PATCH 08/22] Fix broken linking when building with ha_federated --- sql/ha_federated.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 22fc03e9eec..f084976718c 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -21,7 +21,7 @@ that you can implement. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif From b24269103c5d325b8a9edd30255fb610ecc96347 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Mon, 6 Jun 2005 14:28:00 +0400 Subject: [PATCH 09/22] Fix yaSSL compilation failure on ds20 (DEC CXX + Linux) --- extra/yassl/taocrypt/include/type_traits.hpp | 2 +- extra/yassl/taocrypt/include/types.hpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/yassl/taocrypt/include/type_traits.hpp b/extra/yassl/taocrypt/include/type_traits.hpp index caf71f90e11..d03ccae64ed 100644 --- a/extra/yassl/taocrypt/include/type_traits.hpp +++ b/extra/yassl/taocrypt/include/type_traits.hpp @@ -67,7 +67,7 @@ MK_FUNDAMENTAL_TYPE(float) MK_FUNDAMENTAL_TYPE( double) MK_FUNDAMENTAL_TYPE(long double) -#ifdef WORD64_AVAILABLE +#if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE) MK_FUNDAMENTAL_TYPE(word64) #endif diff --git a/extra/yassl/taocrypt/include/types.hpp b/extra/yassl/taocrypt/include/types.hpp index 0d57022a2d0..85e2f85d3dd 100644 --- a/extra/yassl/taocrypt/include/types.hpp +++ b/extra/yassl/taocrypt/include/types.hpp @@ -45,10 +45,12 @@ typedef unsigned int word32; #if defined(__GNUC__) || defined(__MWERKS__) || defined(_LONGLONG_TYPE) #define WORD64_AVAILABLE + #define WORD64_IS_DISTINCT_TYPE typedef unsigned long long word64; #define W64LIT(x) x##LL #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__) #define WORD64_AVAILABLE + #define WORD64_IS_DISTINCT_TYPE typedef unsigned __int64 word64; #define W64LIT(x) x##ui64 #elif defined(__DECCXX) From dcae1d174f6d4fe4cabd116a215ce1036aa97bd0 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Mon, 6 Jun 2005 14:43:21 +0400 Subject: [PATCH 10/22] Futher yaSSL portability fixes: hp3750 (HP aCC + HPUX). --- extra/yassl/taocrypt/src/misc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 1780b3050e9..8ff5f47cfa4 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -149,7 +149,8 @@ unsigned long Crop(unsigned long value, unsigned int size) } -#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) +#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) && \ + !(defined(__HP_aCC) && (__HP_aCC <= 35700)) using std::new_handler; using std::set_new_handler; #endif From b6e895ad9f5c595652426b2483a93650a0a15a58 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Mon, 6 Jun 2005 14:52:43 +0400 Subject: [PATCH 11/22] Futher fixes for aCC. --- extra/yassl/src/handshake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index e49d1ec76cc..45dfb6fa032 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -718,7 +718,7 @@ void processReply(SSL& ssl) mySTL::auto_ptr buffered(ysDelete); for (;;) { - mySTL::auto_ptr tmp = DoProcessReply(ssl, buffered); + mySTL::auto_ptr tmp(DoProcessReply(ssl, buffered)); if (tmp.get()) // had only part of a record's data, call again buffered = tmp; else From e18bb16ee5d244c35711e987be7133f022a31e54 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 6 Jun 2005 14:03:33 +0300 Subject: [PATCH 12/22] Fixed wrong key length when using MIN() optimization (non fatal, but caused InnoDB to write warnings to the log file) This fixed bug #11039: InnoDB: Warning: using a partial-field key prefix in search --- mysql-test/r/innodb.result | 9 +++++++++ mysql-test/t/innodb.test | 10 ++++++++++ sql/opt_sum.cc | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 424543ba4b9..91b01f8e8e6 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2401,3 +2401,12 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); ERROR HY000: The used table type doesn't support FULLTEXT indexes DROP TABLE t1; +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +min(a) +4 +select min(b) from t1 where a='8'; +min(b) +6 +drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index dc9645a8326..6c685796b2c 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1319,3 +1319,13 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; --error 1214; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); DROP TABLE t1; + +# +# BUG#11039 Wrong key length in min() +# + +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +select min(b) from t1 where a='8'; +drop table t1; diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index ddeeb44c82b..33c8eadc065 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -677,7 +677,8 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, If key_part2 may be NULL, then we want to find the first row that is not null */ - ref->key_buff[ref->key_length++]= 1; + ref->key_buff[ref->key_length]= 1; + ref->key_length+= part->store_length; *range_fl&= ~NO_MIN_RANGE; *range_fl|= NEAR_MIN; // > NULL } From 95da927081a393c124f7e585c26ac227198b33dd Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Mon, 6 Jun 2005 15:52:45 +0400 Subject: [PATCH 13/22] Portability fix, mySTL on Sun Forte 5.4. --- extra/yassl/mySTL/memory.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extra/yassl/mySTL/memory.hpp b/extra/yassl/mySTL/memory.hpp index 729abae7ebc..cc70fbf60d8 100644 --- a/extra/yassl/mySTL/memory.hpp +++ b/extra/yassl/mySTL/memory.hpp @@ -37,16 +37,18 @@ namespace mySTL { -template +template struct auto_ptr_ref { + typedef void (*Deletor)(T*); T* ptr_; Deletor del_; auto_ptr_ref(T* p, Deletor d) : ptr_(p), del_(d) {} }; -template +template class auto_ptr { + typedef void (*Deletor)(T*); T* ptr_; Deletor del_; From 2df945d87bef20135de1275c15e50e34a7b8ec0d Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Mon, 6 Jun 2005 16:54:15 +0500 Subject: [PATCH 14/22] Bug#8610: The ucs2_turkish_ci collation fails with upper('i') UPPER/LOWER now can return a string with different length. mi_test1.c: Adding new arguments. Many files: Changeing caseup/casedn to return a result with different length than argument. sql_string.h: Removing unused method, mysql_priv.h: Removing unused method --- client/sql_string.h | 2 - include/m_ctype.h | 26 ++-- myisam/mi_test1.c | 11 +- mysql-test/r/ctype_uca.result | 24 ++++ mysql-test/t/ctype_uca.test | 15 ++ sql/item_strfunc.cc | 35 ++--- sql/item_strfunc.h | 27 +++- sql/mysql_priv.h | 3 +- sql/sql_string.h | 2 - strings/ctype-big5.c | 6 + strings/ctype-bin.c | 12 +- strings/ctype-cp932.c | 6 + strings/ctype-czech.c | 3 + strings/ctype-euc_kr.c | 6 + strings/ctype-eucjpms.c | 6 + strings/ctype-extra.c | 3 + strings/ctype-gb2312.c | 6 + strings/ctype-gbk.c | 6 + strings/ctype-latin1.c | 9 ++ strings/ctype-mb.c | 42 +++--- strings/ctype-simple.c | 26 +++- strings/ctype-sjis.c | 6 + strings/ctype-tis620.c | 6 + strings/ctype-uca.c | 102 ++++++++++++++ strings/ctype-ucs2.c | 57 +++++--- strings/ctype-ujis.c | 6 + strings/ctype-utf8.c | 251 +++++++++++++++++++++++++++++++--- strings/ctype-win1250ch.c | 3 + 28 files changed, 601 insertions(+), 106 deletions(-) diff --git a/client/sql_string.h b/client/sql_string.h index 242b31e7ed6..e284301b214 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -260,8 +260,6 @@ public: } bool fill(uint32 max_length,char fill); void strip_sp(); - inline void caseup() { my_caseup(str_charset,Ptr,str_length); } - inline void casedn() { my_casedn(str_charset,Ptr,str_length); } friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); friend int stringcmp(const String *a,const String *b); friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); diff --git a/include/m_ctype.h b/include/m_ctype.h index 6f304f4ba43..8bb8e5c76df 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -44,6 +44,9 @@ typedef struct unicase_info_st uint16 sort; } MY_UNICASE_INFO; +extern MY_UNICASE_INFO *my_unicase_default[256]; +extern MY_UNICASE_INFO *my_unicase_turkish[256]; + #define MY_CS_ILSEQ 0 #define MY_CS_ILUNI 0 #define MY_CS_TOOSMALL -1 @@ -164,8 +167,10 @@ typedef struct my_charset_handler_st /* Functions for case and sort convertion */ void (*caseup_str)(struct charset_info_st *, char *); void (*casedn_str)(struct charset_info_st *, char *); - void (*caseup)(struct charset_info_st *, char *, uint); - void (*casedn)(struct charset_info_st *, char *, uint); + uint (*caseup)(struct charset_info_st *, char *src, uint srclen, + char *dst, uint dstlen); + uint (*casedn)(struct charset_info_st *, char *src, uint srclen, + char *dst, uint dstlen); /* Charset dependant snprintf() */ int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, @@ -216,9 +221,12 @@ typedef struct charset_info_st uint16 **sort_order_big; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; + MY_UNICASE_INFO **caseinfo; uchar *state_map; uchar *ident_map; uint strxfrm_multiply; + uchar caseup_multiply; + uchar casedn_multiply; uint mbminlen; uint mbmaxlen; uint16 min_sort_char; @@ -286,8 +294,10 @@ extern uint my_instr_simple(struct charset_info_st *, /* Functions for 8bit */ extern void my_caseup_str_8bit(CHARSET_INFO *, char *); extern void my_casedn_str_8bit(CHARSET_INFO *, char *); -extern void my_caseup_8bit(CHARSET_INFO *, char *, uint); -extern void my_casedn_8bit(CHARSET_INFO *, char *, uint); +extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen, + char *dst, uint dstlen); +extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen, + char *dst, uint dstlen); extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); @@ -359,8 +369,10 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c); /* Functions for multibyte charsets */ extern void my_caseup_str_mb(CHARSET_INFO *, char *); extern void my_casedn_str_mb(CHARSET_INFO *, char *); -extern void my_caseup_mb(CHARSET_INFO *, char *, uint); -extern void my_casedn_mb(CHARSET_INFO *, char *, uint); +extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen, + char *dst, uint dstlen); +extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen, + char *dst, uint dstlen); extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); int my_wildcmp_mb(CHARSET_INFO *, @@ -441,8 +453,6 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len); #define my_mbcharlen(s, a) 1 #endif -#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l))) -#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l))) #define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a))) #define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a))) #define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e))) diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index aa6cd98ac8e..5727c699469 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -471,20 +471,25 @@ static void update_record(char *record) ptr=blob_key; memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */ if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM) - my_casedn(default_charset_info,blob_key,length); + default_charset_info->cset->casedn(default_charset_info, + blob_key, length, blob_key, length); pos+=recinfo[1].length; } else if (recinfo[1].type == FIELD_VARCHAR) { uint pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); uint length= pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos); - my_casedn(default_charset_info,pos+pack_length,length); + default_charset_info->cset->casedn(default_charset_info, + pos + pack_length, length, + pos + pack_length, length); pos+=recinfo[1].length; } else { if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM) - my_casedn(default_charset_info,pos,keyinfo[0].seg[0].length); + default_charset_info->cset->casedn(default_charset_info, + pos, keyinfo[0].seg[0].length, + pos, keyinfo[0].seg[0].length); pos+=recinfo[1].length; } diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index c6e803904a3..3803dd932d7 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2396,3 +2396,27 @@ utf8_unicode_ci 6109 utf8_unicode_ci 61 utf8_unicode_ci 6120 drop table t1; +CREATE TABLE t1 (id int, a varchar(30) character set utf8); +INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131); +INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049); +INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049); +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 3 ıi 3 II 2 +ıı 4 ıı 4 II 2 +ii 2 ii 2 II 2 +İI 3 ii 2 İI 3 +İİ 4 ii 2 İİ 4 +II 2 ii 2 II 2 +ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci; +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 3 ıi 3 Iİ 3 +ıı 4 ıı 4 II 2 +ii 2 ii 2 İİ 4 +İI 3 iı 3 İI 3 +İİ 4 ii 2 İİ 4 +II 2 ıı 4 II 2 +DROP TABLE t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index dfca82fa70a..e5c2acc8b4e 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -455,3 +455,18 @@ drop table t1; SET collation_connection='utf8_unicode_ci'; -- source include/ctype_filesort.inc + +# +# Check UPPER/LOWER changeing length +# +# Result shorter than argument +CREATE TABLE t1 (id int, a varchar(30) character set utf8); +INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131); +INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049); +INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049); +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci; +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +DROP TABLE t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 4808159fe98..c43f65c731c 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -902,7 +902,7 @@ void Item_func_insert::fix_length_and_dec() } -String *Item_func_lcase::val_str(String *str) +String *Item_str_conv::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res; @@ -912,24 +912,25 @@ String *Item_func_lcase::val_str(String *str) return 0; /* purecov: inspected */ } null_value=0; - res=copy_if_not_alloced(str,res,res->length()); - res->casedn(); - return res; -} - - -String *Item_func_ucase::val_str(String *str) -{ - DBUG_ASSERT(fixed == 1); - String *res; - if (!(res=args[0]->val_str(str))) + if (multiply == 1) { - null_value=1; /* purecov: inspected */ - return 0; /* purecov: inspected */ + uint len; + res= copy_if_not_alloced(str,res,res->length()); + len= converter(collation.collation, (char*) res->ptr(), res->length(), + (char*) res->ptr(), res->length()); + DBUG_ASSERT(len <= res->length()); + res->length(len); + } + else + { + uint len= res->length() * multiply; + tmp_value.alloc(len); + tmp_value.set_charset(collation.collation); + len= converter(collation.collation, (char*) res->ptr(), res->length(), + (char*) tmp_value.ptr(), len); + tmp_value.length(len); + res= &tmp_value; } - null_value=0; - res=copy_if_not_alloced(str,res,res->length()); - res->caseup(); return res; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 95979408ccb..6df90cebdff 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -133,13 +133,14 @@ public: class Item_str_conv :public Item_str_func { +protected: + uint multiply; + uint (*converter)(CHARSET_INFO *cs, char *src, uint srclen, + char *dst, uint dstlen); + String tmp_value; public: Item_str_conv(Item *item) :Item_str_func(item) {} - void fix_length_and_dec() - { - collation.set(args[0]->collation); - max_length = args[0]->max_length; - } + String *val_str(String *); }; @@ -147,16 +148,28 @@ class Item_func_lcase :public Item_str_conv { public: Item_func_lcase(Item *item) :Item_str_conv(item) {} - String *val_str(String *); const char *func_name() const { return "lcase"; } + void fix_length_and_dec() + { + collation.set(args[0]->collation); + multiply= collation.collation->casedn_multiply; + converter= collation.collation->cset->casedn; + max_length= args[0]->max_length * multiply; + } }; class Item_func_ucase :public Item_str_conv { public: Item_func_ucase(Item *item) :Item_str_conv(item) {} - String *val_str(String *); const char *func_name() const { return "ucase"; } + void fix_length_and_dec() + { + collation.set(args[0]->collation); + multiply= collation.collation->caseup_multiply; + converter= collation.collation->cset->caseup; + max_length= args[0]->max_length * multiply; + } }; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 7adb175ed1b..93494b72968 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1354,7 +1354,8 @@ inline void mark_as_null_row(TABLE *table) inline void table_case_convert(char * name, uint length) { if (lower_case_table_names) - my_casedn(files_charset_info, name, length); + files_charset_info->cset->casedn(files_charset_info, + name, length, name, length); } inline const char *table_case_name(HA_CREATE_INFO *info, const char *name) diff --git a/sql/sql_string.h b/sql/sql_string.h index c05305d9265..ddae6368228 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -261,8 +261,6 @@ public: } bool fill(uint32 max_length,char fill); void strip_sp(); - inline void caseup() { my_caseup(str_charset,Ptr,str_length); } - inline void casedn() { my_casedn(str_charset,Ptr,str_length); } friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); friend int stringcmp(const String *a,const String *b); friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 447eea3e635..a4040ed2b90 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6384,9 +6384,12 @@ CHARSET_INFO my_charset_big5_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -6412,9 +6415,12 @@ CHARSET_INFO my_charset_big5_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 56df289158a..13105df9334 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -208,10 +208,13 @@ static void my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)), { } -static void my_case_bin(CHARSET_INFO *cs __attribute__((unused)), - char *str __attribute__((unused)), - uint length __attribute__((unused))) +static uint my_case_bin(CHARSET_INFO *cs __attribute__((unused)), + char *src __attribute__((unused)), + uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { + return srclen; } @@ -526,9 +529,12 @@ CHARSET_INFO my_charset_bin = NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index f2f31b1064e..fd2b0fd8e21 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -5512,9 +5512,12 @@ CHARSET_INFO my_charset_cp932_japanese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -5539,9 +5542,12 @@ CHARSET_INFO my_charset_cp932_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index aaf87e97cb8..1361b728b26 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -618,9 +618,12 @@ CHARSET_INFO my_charset_latin2_czech_ci = NULL, /* sort_order_big*/ tab_8859_2_uni, /* tab_to_uni */ idx_uni_8859_2, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 21b7b56fdaa..e2167aa315e 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8696,9 +8696,12 @@ CHARSET_INFO my_charset_euckr_korean_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -8724,9 +8727,12 @@ CHARSET_INFO my_charset_euckr_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index d9171c800bf..784293918ed 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -8698,9 +8698,12 @@ CHARSET_INFO my_charset_eucjpms_japanese_ci= NULL, /* contractions */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ @@ -8726,9 +8729,12 @@ CHARSET_INFO my_charset_eucjpms_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 3672dcd0b33..2544245bc42 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -33,9 +33,12 @@ CHARSET_INFO compiled_charsets[] = { NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 0, /* strxfrm_mul */ + 0, /* caseup_mul */ + 0, /* casedn_mul */ 0, /* mbminlen */ 0, /* mbmaxlen */ 0, /* min_sort_ord */ diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 592ee341781..6b582081085 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5747,9 +5747,12 @@ CHARSET_INFO my_charset_gb2312_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -5774,9 +5777,12 @@ CHARSET_INFO my_charset_gb2312_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index ec96caa6b91..4150f198722 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9994,9 +9994,12 @@ CHARSET_INFO my_charset_gbk_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -10021,9 +10024,12 @@ CHARSET_INFO my_charset_gbk_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 7a75992dc4f..afe996d3cda 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -424,9 +424,12 @@ CHARSET_INFO my_charset_latin1= NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ @@ -719,9 +722,12 @@ CHARSET_INFO my_charset_latin1_german2_ci= NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 2, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ @@ -747,9 +753,12 @@ CHARSET_INFO my_charset_latin1_bin= NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index b3ec476b8f5..2d9f8b16bfc 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -57,40 +57,48 @@ void my_casedn_str_mb(CHARSET_INFO * cs, char *str) } } -void my_caseup_mb(CHARSET_INFO * cs, char *str, uint length) +uint my_caseup_mb(CHARSET_INFO * cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { register uint32 l; - register char *end=str+length; - register uchar *map=cs->to_upper; - - while (strto_upper; + + DBUG_ASSERT(src == dst && srclen == dstlen); + while (src < srcend) { - if ((l=my_ismbchar(cs, str,end))) - str+=l; + if ((l=my_ismbchar(cs, src, srcend))) + src+= l; else { - *str=(char) map[(uchar)*str]; - str++; + *src=(char) map[(uchar) *src]; + src++; } } + return srclen; } -void my_casedn_mb(CHARSET_INFO * cs, char *str, uint length) +uint my_casedn_mb(CHARSET_INFO * cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { register uint32 l; - register char *end=str+length; + register char *srcend= src + srclen; register uchar *map=cs->to_lower; - - while (strto_upper; - for ( ; length>0 ; length--, str++) - *str= (char) map[(uchar)*str]; + uint srclen0= srclen; + register uchar *map= cs->to_upper; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; srclen > 0 ; srclen--, src++) + *src= (char) map[(uchar) *src]; + return srclen0; } -void my_casedn_8bit(CHARSET_INFO * cs, char *str, uint length) +uint my_casedn_8bit(CHARSET_INFO * cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { + uint srclen0= srclen; register uchar *map=cs->to_lower; - for ( ; length>0 ; length--, str++) - *str= (char) map[(uchar) *str]; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; srclen > 0 ; srclen--, src++) + *src= (char) map[(uchar) *src]; + return srclen0; } int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) @@ -1303,6 +1313,8 @@ static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(uint)) static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint)) { + cs->caseup_multiply= 1; + cs->casedn_multiply= 1; return create_fromuni(cs, alloc); } diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index a7d75da42c9..9cd5d6d7981 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4681,9 +4681,12 @@ CHARSET_INFO my_charset_sjis_japanese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -4708,9 +4711,12 @@ CHARSET_INFO my_charset_sjis_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index c40e74c3343..4fe8bb4e349 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -983,9 +983,12 @@ CHARSET_INFO my_charset_tis620_thai_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ @@ -1010,9 +1013,12 @@ CHARSET_INFO my_charset_tis620_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index fb7e93e10b6..eb207c9821f 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -8049,9 +8049,12 @@ CHARSET_INFO my_charset_ucs2_general_uca= uca_weight, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8076,9 +8079,12 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8103,9 +8109,12 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8130,9 +8139,12 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8157,9 +8169,12 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8184,9 +8199,12 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8211,9 +8229,12 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8238,9 +8259,12 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8265,9 +8289,12 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8292,9 +8319,12 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8319,9 +8349,12 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8347,9 +8380,12 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8374,9 +8410,12 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8401,9 +8440,12 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8428,9 +8470,12 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8456,9 +8501,12 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8484,9 +8532,12 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8559,9 +8610,12 @@ CHARSET_INFO my_charset_utf8_general_uca_ci= uca_weight, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8587,9 +8641,12 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8614,9 +8671,12 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8641,9 +8701,12 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8668,9 +8731,12 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8695,9 +8761,12 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8722,9 +8791,12 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8749,9 +8821,12 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8776,9 +8851,12 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8803,9 +8881,12 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 2, /* caseup_multiply */ + 2, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8830,9 +8911,12 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8858,9 +8942,12 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8885,9 +8972,12 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8912,9 +9002,12 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8939,9 +9032,12 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8966,9 +9062,12 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ @@ -8993,9 +9092,12 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 9, /* min_sort_char */ diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 706d42e3725..4acd75d7a6f 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -30,7 +30,6 @@ #define EILSEQ ENOENT #endif -extern MY_UNICASE_INFO *uni_plane[256]; static uchar ctype_ucs2[] = { 0, @@ -113,20 +112,26 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) , } -static void my_caseup_ucs2(CHARSET_INFO *cs, char *s, uint slen) +static uint my_caseup_ucs2(CHARSET_INFO *cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { my_wc_t wc; int res; - char *e=s+slen; - - while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_ucs2_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) { - int plane = (wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; - if (res != my_uni_ucs2(cs,wc,(uchar*)s,(uchar*)e)) + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; + if (res != my_uni_ucs2(cs, wc, (uchar*) src, (uchar*) srcend)) break; - s+=res; + src+= res; } + return srclen; } @@ -136,6 +141,7 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen, my_wc_t wc; int res; const uchar *e=s+slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while (e > s+1 && e[-1] == ' ' && e[-2] == '\0') e-= 2; @@ -160,22 +166,26 @@ static void my_caseup_str_ucs2(CHARSET_INFO * cs __attribute__((unused)), -static void my_casedn_ucs2(CHARSET_INFO *cs, char *s, uint slen) +static uint my_casedn_ucs2(CHARSET_INFO *cs, char *src, uint srclen, + char *dst __attribute__((unused)), + uint dstlen __attribute__((unused))) { my_wc_t wc; int res; - char *e=s+slen; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); - while ((s < e) && (res=my_ucs2_uni(cs, &wc, (uchar*)s, (uchar*)e))>0) + while ((src < srcend) && + (res= my_ucs2_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) { - int plane = (wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; - if (res != my_uni_ucs2(cs, wc, (uchar*)s, (uchar*)e)) - { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; + if (res != my_uni_ucs2(cs, wc, (uchar*) src, (uchar*) srcend)) break; - } - s+=res; + src+= res; } + return srclen; } static void my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)), @@ -193,6 +203,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, my_wc_t s_wc,t_wc; const uchar *se=s+slen; const uchar *te=t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -256,6 +267,7 @@ static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), { const uchar *se, *te; uint minlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; /* extra safety to make sure the lengths are even numbers */ slen&= ~1; @@ -305,6 +317,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs, my_wc_t s_wc,t_wc; const char *se=s+len; const char *te=t+len; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -352,6 +365,7 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs, int plane; uchar *de = dst + dstlen; const uchar *se = src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while( src < se && dst < de ) { @@ -1310,6 +1324,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { + MY_UNICASE_INFO **uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -1596,9 +1611,12 @@ CHARSET_INFO my_charset_ucs2_general_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ @@ -1623,9 +1641,12 @@ CHARSET_INFO my_charset_ucs2_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 5d0c77cee6e..6b704980d0d 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8566,9 +8566,12 @@ CHARSET_INFO my_charset_ujis_japanese_ci= NULL, /* contractions */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ @@ -8594,9 +8597,12 @@ CHARSET_INFO my_charset_ujis_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 250c57cf265..6f6d24d8643 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -172,6 +172,8 @@ static MY_UNICASE_INFO plane00[]={ {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} }; + + static MY_UNICASE_INFO plane01[]={ {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041}, @@ -1482,7 +1484,7 @@ static MY_UNICASE_INFO planeFF[]={ {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} }; -MY_UNICASE_INFO *uni_plane[256]={ +MY_UNICASE_INFO *my_unicase_default[256]={ plane00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1519,6 +1521,186 @@ MY_UNICASE_INFO *uni_plane[256]={ }; +/* + Turkish lower/upper mapping: + 1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> + 0x0131 LATIN SMALL LETTER DOTLESS I + 2. UPPER(0x0069 LATIN SMALL LETTER I) -> + 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +*/ + +static MY_UNICASE_INFO turk00[]= +{ + {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, + {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, + {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, + {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, + {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, + {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, + {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, + {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, + {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, + {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, + {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, + {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, + {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, + {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, + {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, + {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, + {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, + {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, + {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, + {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, + {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, + {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, + {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, + {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, + {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, + {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, + {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, + {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, + {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, + {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, + {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, + {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, + {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0049,0x0131,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, + {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, + {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, + {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0130,0x0069,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, + {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, + {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, + {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, + {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, + {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, + {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, + {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, + {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, + {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, + {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, + {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, + {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, + {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, + {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, + {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, + {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, + {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, + {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, + {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, + {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, + {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, + {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, + {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, + {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, + {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, + {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, + {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, + {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, + {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, + {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, + {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, + {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, + {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, + {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} +}; + + + +MY_UNICASE_INFO *my_unicase_turkish[256]= +{ + turk00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, + NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF +}; + + + /* ** Compare string against string with wildcard ** This function is used in UTF8 and UCS2 @@ -1907,20 +2089,26 @@ static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) , } -static void my_caseup_utf8(CHARSET_INFO *cs, char *s, uint slen) +static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen, + char *dst, uint dstlen) { my_wc_t wc; - int res; - char *e=s+slen; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); - while ((s < e) && (res=my_utf8_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) + while ((src < srcend) && + (srcres= my_utf8_uni(cs, &wc, (uchar *) src, (uchar*) srcend)) > 0) { - int plane = (wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; - if (res != my_uni_utf8(cs,wc,(uchar*)s,(uchar*)e)) + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; + if ((dstres= my_uni_utf8(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; - s+=res; + src+= srcres; + dst+= dstres; } + return dst - dst0; } static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen, @@ -1929,6 +2117,7 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen, my_wc_t wc; int res; const uchar *e=s+slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; /* Remove end space. We have to do this to be able to compare @@ -1952,31 +2141,37 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen, static void my_caseup_str_utf8(CHARSET_INFO * cs, char * s) { - my_caseup_utf8(cs, s, strlen(s)); + uint len= strlen(s); + my_caseup_utf8(cs, s, len, s, len); } -static void my_casedn_utf8(CHARSET_INFO *cs, char *s, uint slen) +static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen, + char *dst, uint dstlen) { my_wc_t wc; - int res; - char *e=s+slen; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); - while ((s < e) && (res=my_utf8_uni(cs, &wc, (uchar*)s, (uchar*)e))>0) + while ((src < srcend) && + (srcres= my_utf8_uni(cs, &wc, (uchar*) src, (uchar*)srcend)) > 0) { - int plane = (wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; - if (res != my_uni_utf8(cs, wc, (uchar*)s, (uchar*)e)) - { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; + if ((dstres= my_uni_utf8(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; - } - s+=res; + src+= srcres; + dst+= dstres; } + return dst - dst0; } static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s) { - my_casedn_utf8(cs, s, strlen(s)); + uint len= strlen(s); + my_casedn_utf8(cs, s, len, s, len); } @@ -1989,6 +2184,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs, my_wc_t s_wc,t_wc; const uchar *se=s+slen; const uchar *te=t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2057,6 +2253,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, int s_res, t_res, res; my_wc_t s_wc,t_wc; const uchar *se= s+slen, *te= t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE diff_if_only_endspace_difference= 0; @@ -2144,6 +2341,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, static int my_strcasecmp_utf8(CHARSET_INFO *cs, const char *s, const char *t) { + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; @@ -2228,6 +2426,7 @@ int my_wildcmp_utf8(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { + MY_UNICASE_INFO **uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -2249,6 +2448,7 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, uchar *de= dst + dstlen; uchar *de_beg= de - 1; const uchar *se = src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while (dst < de_beg) { @@ -2367,9 +2567,12 @@ CHARSET_INFO my_charset_utf8_general_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ @@ -2395,9 +2598,12 @@ CHARSET_INFO my_charset_utf8_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ @@ -2561,9 +2767,12 @@ CHARSET_INFO my_charset_utf8_general_cs= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index cb8de8f43ac..8ac80ed392b 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -652,9 +652,12 @@ CHARSET_INFO my_charset_cp1250_czech_ci = NULL, /* sort_order_big*/ tab_cp1250_uni, /* tab_to_uni */ idx_uni_cp1250, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 2, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ From f2405d71eb25736b7ad5adf104aa175b0044a861 Mon Sep 17 00:00:00 2001 From: "igor@rurik.mysql.com" <> Date: Mon, 6 Jun 2005 06:05:11 -0700 Subject: [PATCH 15/22] sp.test, sp.result: Added a test case for bug #6866. sql_select.cc: Fixed bug #6866. Bug was due to the fact that on_expr was not backed up for the second execution of the stored procedure. --- mysql-test/r/sp.result | 40 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/sp.test | 44 ++++++++++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 2 ++ 3 files changed, 86 insertions(+) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 3c6fa84882f..ff8092d1e01 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3138,4 +3138,44 @@ x x 3 drop procedure bug10961| +DROP PROCEDURE IF EXISTS bug6866| +DROP VIEW IF EXISTS tv| +Warnings: +Note 1051 Unknown table 'test.tv' +DROP TABLE IF EXISTS tt1,tt2,tt3| +Warnings: +Note 1051 Unknown table 'tt1' +Note 1051 Unknown table 'tt2' +Note 1051 Unknown table 'tt3' +CREATE TABLE tt1 (a1 int, a2 int, a3 int, data varchar(10))| +CREATE TABLE tt2 (a2 int, data2 varchar(10))| +CREATE TABLE tt3 (a3 int, data3 varchar(10))| +INSERT INTO tt1 VALUES (1, 1, 4, 'xx')| +INSERT INTO tt2 VALUES (1, 'a')| +INSERT INTO tt2 VALUES (2, 'b')| +INSERT INTO tt2 VALUES (3, 'c')| +INSERT INTO tt3 VALUES (4, 'd')| +INSERT INTO tt3 VALUES (5, 'e')| +INSERT INTO tt3 VALUES (6, 'f')| +CREATE VIEW tv AS +SELECT tt1.*, tt2.data2, tt3.data3 +FROM tt1 INNER JOIN tt2 ON tt1.a2 = tt2.a2 +LEFT JOIN tt3 ON tt1.a3 = tt3.a3 +ORDER BY tt1.a1, tt2.a2, tt3.a3| +CREATE PROCEDURE bug6866 (_a1 int) +BEGIN +SELECT * FROM tv WHERE a1 = _a1; +END| +CALL bug6866(1)| +a1 a2 a3 data data2 data3 +1 1 4 xx a d +CALL bug6866(1)| +a1 a2 a3 data data2 data3 +1 1 4 xx a d +CALL bug6866(1)| +a1 a2 a3 data data2 data3 +1 1 4 xx a d +DROP PROCEDURE bug6866; +DROP VIEW tv| +DROP TABLE tt1, tt2, tt3| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 7acd4d81081..57d5d2939e1 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3848,6 +3848,50 @@ call bug10961()| drop procedure bug10961| +# +# BUG #6866: Second call of a stored procedure using a view with on expressions +# + +--disable_warnings +DROP PROCEDURE IF EXISTS bug6866| +--enable_warnings + +DROP VIEW IF EXISTS tv| +DROP TABLE IF EXISTS tt1,tt2,tt3| + +CREATE TABLE tt1 (a1 int, a2 int, a3 int, data varchar(10))| +CREATE TABLE tt2 (a2 int, data2 varchar(10))| +CREATE TABLE tt3 (a3 int, data3 varchar(10))| + +INSERT INTO tt1 VALUES (1, 1, 4, 'xx')| + +INSERT INTO tt2 VALUES (1, 'a')| +INSERT INTO tt2 VALUES (2, 'b')| +INSERT INTO tt2 VALUES (3, 'c')| + +INSERT INTO tt3 VALUES (4, 'd')| +INSERT INTO tt3 VALUES (5, 'e')| +INSERT INTO tt3 VALUES (6, 'f')| + +CREATE VIEW tv AS +SELECT tt1.*, tt2.data2, tt3.data3 + FROM tt1 INNER JOIN tt2 ON tt1.a2 = tt2.a2 + LEFT JOIN tt3 ON tt1.a3 = tt3.a3 + ORDER BY tt1.a1, tt2.a2, tt3.a3| + +CREATE PROCEDURE bug6866 (_a1 int) +BEGIN +SELECT * FROM tv WHERE a1 = _a1; +END| + +CALL bug6866(1)| +CALL bug6866(1)| +CALL bug6866(1)| + +DROP PROCEDURE bug6866; + +DROP VIEW tv| +DROP TABLE tt1, tt2, tt3| # # BUG#NNNN: New bug synopsis diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0b46d30b708..c4952e408db 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7374,6 +7374,8 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top) } else { + if (!(table->prep_on_expr)) + table->prep_on_expr= table->on_expr; used_tables= table->table->map; if (conds) not_null_tables= conds->not_null_tables(); From 13afa9129bb2c949147b2c0d84b39982e3575015 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 6 Jun 2005 15:23:04 +0200 Subject: [PATCH 16/22] Some Windows compile improvements: - removed some unreferenced variables - fixed the libmysql project file by removing a duplicate file reference (merge error) --- VC++Files/libmysql/libmysql.dsp | 4 ---- sql/item_func.cc | 1 - sql/sql_select.cc | 2 +- sql/unireg.cc | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index 4f93ac93c40..32d32fd6b2c 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -147,10 +147,6 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File -SOURCE="..\strings\ctype-cp932.c" -# End Source File -# Begin Source File - SOURCE="..\strings\ctype-euc_kr.c" # End Source File # Begin Source File diff --git a/sql/item_func.cc b/sql/item_func.cc index 5af99cb8132..e308df64f96 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4724,7 +4724,6 @@ Item_func_sp::func_name() const Field * Item_func_sp::sp_result_field(void) const { - Field *field; DBUG_ENTER("Item_func_sp::sp_result_field"); if (!m_sp) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 27ef3fcea6f..9690bfdb236 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7989,7 +7989,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, bool using_unique_constraint= 0; bool use_packed_rows= 0; bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS); - char *tmpname,path[FN_REFLEN], filename[FN_REFLEN]; + char *tmpname,path[FN_REFLEN]; byte *pos,*group_buff; uchar *null_flags; Field **reg_field, **from_field; diff --git a/sql/unireg.cc b/sql/unireg.cc index eda17d8f4a9..e8aad2fedd0 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -668,7 +668,7 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, { int error; Field::utype type; - uint firstpos, null_count; + uint null_count; uchar *buff,*null_pos; TABLE table; create_field *field; From fb5333120f22f4a7f39f766e909e99ec82f8d097 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 6 Jun 2005 17:59:00 +0300 Subject: [PATCH 17/22] Some fixes for Netware builds. --- netware/BUILD/compile-linux-tools | 6 ++++++ netware/BUILD/compile-netware-END | 5 +++++ netware/BUILD/mwenv | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index c21857146e0..c85fced5739 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -30,6 +30,10 @@ rm -f */*.linux # build tools only make clean all-local + +# Create mysql_version.h which was deleted my previous step +./config.status include/mysql_version.h + (cd dbug; make libdbug.a) (cd strings; make libmystrings.a) (cd mysys; make libmysys.a) @@ -56,3 +60,5 @@ cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux cp sql/gen_lex_hash sql/gen_lex_hash.linux cp strings/conf_to_src strings/conf_to_src.linux +# Delete mysql_version.h +rm -f include/mysql_version.h diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END index 2bd59f97114..60ef428b2a9 100755 --- a/netware/BUILD/compile-netware-END +++ b/netware/BUILD/compile-netware-END @@ -22,6 +22,11 @@ rm -rf Makefile.in.bk # run auto tools . $path/compile-AUTOTOOLS +# For NetWare there is no comp_err but comp_err.linux +sed -e "s/comp_err/comp_err.linux/g" extra/Makefile.am > extra/Makefile.am.$$ +sed -e "s/replace comp_err.linux/replace comp_err/g" extra/Makefile.am.$$ > extra/Makefile.am +rm extra/Makefile.am.$$ + # configure ./configure $base_configs $extra_configs diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index 0acfd3aaf8f..99de5e9be1e 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -6,7 +6,7 @@ # the default is "F:/mydev" export MYDEV="F:/mydev" -export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.1.4;$MYDEV" +export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/include;$MYDEV" export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/openssl;$MYDEV/mysql-VERSION/netware/BUILD" export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp" From ea7f982ef0c1eacabb3d2194fb1f532c84b8cc2c Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 6 Jun 2005 18:30:59 +0300 Subject: [PATCH 18/22] Some fixes for Netware. --- include/my_sys.h | 5 ++++- netware/mysql_test_run.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/my_sys.h b/include/my_sys.h index 62affb31740..ee4312be058 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -181,7 +181,7 @@ extern void my_large_free(gptr ptr, myf my_flags); #endif /* _AIX */ #if defined(__MWERKS__) #undef alloca -#define alloca __alloca +#define alloca _alloca #endif /* __MWERKS__ */ #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) #define alloca __builtin_alloca @@ -836,7 +836,10 @@ my_bool my_gethwaddr(uchar *to); #define MAP_NOSYNC 0x0800 #define MAP_FAILED ((void *)-1) #define MS_SYNC 0x0000 + +#ifndef __NETWARE__ #define HAVE_MMAP +#endif int my_getpagesize(void); void *my_mmap(void *, size_t, int, int, int, my_off_t); diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index d8cfb79c1cb..45b7c4719fb 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -1162,6 +1162,8 @@ void setup(char *file) setenv("MYSQL_TCP_PORT", "3306", 1); snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port); setenv("MYSQL_CLIENT_TEST",file_path,1); + snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port); + setenv("MYSQL",file_path,1); } /****************************************************************************** From 03526f1c2c45863c2b8af55ff98c84503d40cab0 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 6 Jun 2005 18:34:44 +0300 Subject: [PATCH 19/22] A fix for Metrowerks compiler. --- netware/BUILD/mwenv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index 99de5e9be1e..7f89a8faf7f 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -19,9 +19,9 @@ export AR='mwldnlm' export AR_FLAGS='-type library -o' export AS='mwasmnlm' export CC='mwccnlm -gccincludes' -export CFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c' +export CFLAGS='-enum int -O3 -align 8 -proc 686 -relax_pointers -dialect c' export CXX='mwccnlm -gccincludes' -export CXXFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T' +export CXXFLAGS='-enum int -O3 -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T' export LD='mwldnlm' export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption' export RANLIB=: From db23a7ec29dec890202f5ecad9ad9971927f970b Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 6 Jun 2005 19:00:50 +0300 Subject: [PATCH 20/22] A logger patch for Netware. --- netware/mysqld_safe.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index a307b52bb7e..3a1672fdf61 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -666,7 +666,6 @@ void mysql_start(int argc, char *argv[]) if (!strnicmp(argv[i], private_options[j], strlen(private_options[j]))) { skip= TRUE; - consoleprintf("The argument skipped is %s\n", argv[i]); break; } } @@ -674,7 +673,6 @@ void mysql_start(int argc, char *argv[]) if (!skip) { add_arg(&al, "%s", argv[i]); - consoleprintf("The final argument is %s\n", argv[i]); } } // spawn From 4283fdb170cf66a6b55cfa1bea057fac8707fe2a Mon Sep 17 00:00:00 2001 From: "reggie@monster." <> Date: Mon, 6 Jun 2005 11:34:52 -0500 Subject: [PATCH 21/22] fixes for compiler warnings from VC6 --- client/mysqltest.c | 11 ++++++----- myisam/mi_create.c | 2 +- mysys/default.c | 2 +- mysys/my_handler.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index e3267b1731b..c172d18cbd0 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -246,6 +246,7 @@ typedef struct static char *subst_env_var(const char *cmd); static FILE *my_popen(const char *cmd, const char *mode); +#undef popen #define popen(A,B) my_popen((A),(B)) #endif /* __NETWARE__ */ @@ -2587,13 +2588,13 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res) { if (i) dynstr_append_mem(ds, "\t", 1); - replace_dynstr_append_mem(ds, val, len); + replace_dynstr_append_mem(ds, val, (int)len); } else { dynstr_append(ds, fields[i].name); dynstr_append_mem(ds, "\t", 1); - replace_dynstr_append_mem(ds, val, len); + replace_dynstr_append_mem(ds, val, (int)len); dynstr_append_mem(ds, "\n", 1); } } @@ -2960,7 +2961,7 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags) int error= 0; /* Function return code if "goto end;" */ int err; /* Temporary storage of return code from calls */ int query_len, got_error_on_execute; - uint num_rows; + ulonglong num_rows; char *query; MYSQL_RES *res= NULL; /* Note that here 'res' is meta data result set */ DYNAMIC_STRING *ds; @@ -3215,13 +3216,13 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags) { if (col_idx) /* No tab before first col */ dynstr_append_mem(ds, "\t", 1); - replace_dynstr_append_mem(ds, val, len); + replace_dynstr_append_mem(ds, val, (int)len); } else { dynstr_append(ds, field[col_idx].name); dynstr_append_mem(ds, "\t", 1); - replace_dynstr_append_mem(ds, val, len); + replace_dynstr_append_mem(ds, val, (int)len); dynstr_append_mem(ds, "\n", 1); } } diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 12b03e65baa..47332b02a72 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -667,7 +667,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { tmp_keydef.keysegs=1; tmp_keydef.flag= HA_UNIQUE_CHECK; - tmp_keydef.block_length= myisam_block_size; + tmp_keydef.block_length= (uint16)myisam_block_size; tmp_keydef.keylength= MI_UNIQUE_HASH_LENGTH + pointer; tmp_keydef.minlength=tmp_keydef.maxlength=tmp_keydef.keylength; tmp_keyseg.type= MI_UNIQUE_HASH_TYPE; diff --git a/mysys/default.c b/mysys/default.c index e28161ba7b0..ab9bdaf0ed2 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -850,7 +850,7 @@ static void init_default_directories() *ptr++= "C:/"; if (GetWindowsDirectory(system_dir,sizeof(system_dir))) - *ptr++= &system_dir; + *ptr++= (char*)&system_dir; #if defined(_MSC_VER) && (_MSC_VER >= 1300) /* Only VC7 and up */ /* Only add shared system directory if different from default. */ diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 87e526d0ea3..e14bd7529f9 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -23,7 +23,7 @@ int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length, { if (!part_key) return charset_info->coll->strnncollsp(charset_info, a, a_length, - b, b_length, !skip_end_space); + b, b_length, (my_bool)!skip_end_space); return charset_info->coll->strnncoll(charset_info, a, a_length, b, b_length, part_key); } From dec2607e1d746af5905cd22031b38fc42067a8ef Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 6 Jun 2005 20:41:52 +0300 Subject: [PATCH 22/22] Ensure that we reset auto-increment cache if we have to do an UPDATE becasue of REPLACE This fixes bug #11080: Multi-row REPLACE fails on a duplicate key error --- mysql-test/r/auto_increment.result | 39 ++++++++++++++++++++++++++ mysql-test/r/innodb.result | 39 ++++++++++++++++++++++++++ mysql-test/t/auto_increment.test | 36 ++++++++++++++++++++++++ mysql-test/t/innodb.test | 45 ++++++++++++++++++++++++++++++ mysys/my_alloc.c | 1 + sql/sql_insert.cc | 12 ++++++++ 6 files changed, 172 insertions(+) diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 4587c675150..61a42b004a9 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -355,3 +355,42 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)); +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +a b +3 1 +2 2 +4 3 +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +a b +3 1 +2 2 +4 3 +drop table t1; +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)); +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +insert into t1 (val) values ('1'),('2'); +ERROR 23000: Duplicate entry '1' for key 2 +select * from t1; +rowid val +3 1 +4 2 +drop table t1; +create table t1 (a int not null auto_increment primary key, val int); +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +insert into t1 (val) values (1); +select * from t1; +a val +2 1 +3 1 +drop table t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 91b01f8e8e6..53dbf2a39e1 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2410,3 +2410,42 @@ select min(b) from t1 where a='8'; min(b) 6 drop table t1; +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +ERROR 23000: Duplicate entry '3' for key 1 +select * from t1; +a b +1 1 +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +ERROR 23000: Duplicate entry '3' for key 1 +select * from t1; +a b +3 1 +2 2 +drop table t1; +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +ERROR 23000: Duplicate entry '3' for key 1 +insert into t1 (val) values ('1'),('2'); +ERROR 23000: Duplicate entry '1' for key 2 +select * from t1; +rowid val +1 1 +2 2 +drop table t1; +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +insert into t1 (val) values (1); +ERROR 23000: Duplicate entry '2' for key 1 +select * from t1; +a val +2 1 +drop table t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index ef344df5fb6..afc4c722051 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -218,3 +218,39 @@ CHECK TABLE t1; INSERT INTO t1 (b) VALUES ('bbbb'); CHECK TABLE t1; DROP TABLE IF EXISTS t1; + +# +# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error +# + +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)); +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +drop table t1; + +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)); +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +--error 1062 +insert into t1 (val) values ('1'),('2'); +select * from t1; +drop table t1; + +# +# Test that update changes internal auto-increment value +# + +create table t1 (a int not null auto_increment primary key, val int); +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +insert into t1 (val) values (1); +select * from t1; +drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 6c685796b2c..e3edcdfa5fc 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1329,3 +1329,48 @@ insert into t1 values ('8', '6'), ('4', '7'); select min(a) from t1; select min(b) from t1 where a='8'; drop table t1; + +# +# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error +# + +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +# We shouldn't get the following error +--error 1062 +replace into t1 (b) values (2), (1), (3); +select * from t1; +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +# We shouldn't get the following error +--error 1062 +replace into t1 (b) values (3); +select * from t1; +drop table t1; + +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +# We shouldn't get the following error +--error 1062 +replace into t1 (val) values ('1'),('2'); +--error 1062 +insert into t1 (val) values ('1'),('2'); +select * from t1; +drop table t1; + + +# +# Test that update changes internal auto-increment value +# + +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +# We shouldn't get the following error +--error 1062 +insert into t1 (val) values (1); +select * from t1; +drop table t1; diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 072fc09cd12..4aa31829c59 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -262,6 +262,7 @@ static inline void mark_blocks_free(MEM_ROOT* root) NOTES One can call this function either with root block initialised with init_alloc_root() or with a bzero()-ed block. + It's also safe to call this multiple times with the same mem_root. */ void free_root(MEM_ROOT *root, myf MyFlags) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index dbecfe1489e..6fb871cbc9d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -916,6 +916,12 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) if (res == VIEW_CHECK_ERROR) goto before_trg_err; + if (thd->clear_next_insert_id) + { + /* Reset auto-increment cacheing if we do an update */ + thd->clear_next_insert_id= 0; + thd->next_insert_id= 0; + } if ((error=table->file->update_row(table->record[1],table->record[0]))) { if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore) @@ -949,6 +955,12 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, TRG_ACTION_BEFORE, TRUE)) goto before_trg_err; + if (thd->clear_next_insert_id) + { + /* Reset auto-increment cacheing if we do an update */ + thd->clear_next_insert_id= 0; + thd->next_insert_id= 0; + } if ((error=table->file->update_row(table->record[1], table->record[0]))) goto err;