From dab880274afbae01571257feebb819d94b861c01 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 22 Jun 2005 16:14:14 -0700 Subject: [PATCH 001/322] Fix LOAD DATA to handle having the escape and enclosed-by character be the same. (Bug #11203) --- mysql-test/r/loaddata.result | 8 ++++++++ mysql-test/std_data/loaddata5.dat | 3 +++ mysql-test/t/loaddata.test | 8 ++++++++ sql/sql_load.cc | 19 +++++++++++++++++-- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 mysql-test/std_data/loaddata5.dat diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index c0baabcc507..cb9849ec23d 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -66,3 +66,11 @@ a b 3 row 3 0 drop table t1; +create table t1 (a varchar(20), b varchar(20)); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +select * from t1; +a b +field1 field2 +a"b cd"ef +a"b c"d"e +drop table t1; diff --git a/mysql-test/std_data/loaddata5.dat b/mysql-test/std_data/loaddata5.dat new file mode 100644 index 00000000000..5bdddfa977a --- /dev/null +++ b/mysql-test/std_data/loaddata5.dat @@ -0,0 +1,3 @@ +"field1","field2" +"a""b","cd""ef" +"a"b",c"d"e diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index aa0ea0a2f55..2afd710c694 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -31,3 +31,11 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated select * from t1; drop table t1; +# +# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and +# ENCLOSED +# +create table t1 (a varchar(20), b varchar(20)); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +select * from t1; +drop table t1; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index c4f5b1427af..b998f39971c 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -799,8 +799,23 @@ int READ_INFO::read_field() *to++= (byte) escape_char; goto found_eof; } - *to++ = (byte) unescape((char) chr); - continue; + /* + When escape_char == enclosed_char, we treat it like we do for + handling quotes in SQL parsing -- you can double-up the + escape_char to include it literally, but it doesn't do escapes + like \n. This allows: LOAD DATA ... ENCLOSED BY '"' ESCAPED BY '"' + with data like: "fie""ld1", "field2" + */ + if (escape_char != enclosed_char || chr == escape_char) + { + *to++ = (byte) unescape((char) chr); + continue; + } + else + { + PUSH(chr); + chr= escape_char; + } } #ifdef ALLOW_LINESEPARATOR_IN_STRINGS if (chr == line_term_char) From c601bb87f856728a6429b9323914df59a6f87479 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Thu, 1 Sep 2005 15:06:36 +0500 Subject: [PATCH 002/322] a fix (bug #10303: Misleading Last_query_cost value). --- sql/sql_select.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5ba2722482b..0b6d63c1446 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -541,6 +541,9 @@ JOIN::optimize() DBUG_RETURN(0); optimized= 1; + if (thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS) + thd->status_var.last_query_cost= 0.0; + row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR : unit->select_limit_cnt); /* select_limit is used to decide if we are likely to scan the whole table */ From 68acf8fdea1af29bccc01bc251878989540a9aeb Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Tue, 6 Sep 2005 15:00:35 +0500 Subject: [PATCH 003/322] fix (bug #10303: Misleading Last_query_cost value). --- mysql-test/r/query_cache.result | 16 ++++++++++++++++ mysql-test/r/status.result | 6 ++++++ mysql-test/t/query_cache.test | 13 +++++++++++++ mysql-test/t/status.test | 7 +++++++ sql/sql_cache.cc | 1 + 5 files changed, 43 insertions(+) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0efd5ac1566..06f1d2d0e7c 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1127,3 +1127,19 @@ Qcache_hits 9 drop procedure f1; drop table t1; set GLOBAL query_cache_size=0; +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +a +4 +5 +select * from t1 where a > 3; +a +4 +5 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index e9616232fa1..5461e4dd563 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -17,3 +17,9 @@ Variable_name Value Table_locks_immediate 3 Table_locks_waited 1 drop table t1; +select 1; +1 +1 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 822c27fe40d..db759fcbac3 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -816,3 +816,16 @@ drop table t1; set GLOBAL query_cache_size=0; # End of 4.1 tests + +# +# Bug #10303: problem with last_query_cost +# + +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +select * from t1 where a > 3; +show status like 'last_query_cost'; +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 7fea51c9327..929a0cb5877 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -37,3 +37,10 @@ show status like 'Table_lock%'; drop table t1; # End of 4.1 tests + +# +# lost_query_cost +# + +select 1; +show status like 'last_query_cost'; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 81eed413a8e..828a9c4d15c 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1178,6 +1178,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", #endif /*!EMBEDDED_LIBRARY*/ thd->limit_found_rows = query->found_rows(); + thd->status_var.last_query_cost= 0.0; BLOCK_UNLOCK_RD(query_block); DBUG_RETURN(1); // Result sent to client From d3c71e12e36fb5b5546bf18f2576262964e8fecc Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Fri, 9 Sep 2005 16:23:59 +0500 Subject: [PATCH 004/322] Fix for bug #12991 (compile error --without-geometry) --- myisam/mi_check.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index ee64f9b9979..d32d3964b95 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1045,9 +1045,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) /* We don't need to lock the key tree here as we don't allow concurrent threads when running myisamchk */ - int search_result= (keyinfo->flag & HA_SPATIAL) ? + int search_result= +#ifdef HAVE_RTREE_KEYS + (keyinfo->flag & HA_SPATIAL) ? rtree_find_first(info, key, info->lastkey, key_length, SEARCH_SAME) : +#endif _mi_search(info,keyinfo,info->lastkey,key_length, SEARCH_SAME, info->s->state.key_root[key]); if (search_result) From 36731edfc79c6f928a4929945fe5b2415baa7c39 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 16 Sep 2005 14:22:11 +0500 Subject: [PATCH 005/322] Bug#13145: A table named "C-cedilla" can't be dropped. ctype_latin1.test, ctype_latin1.result: adding test case ctype-latin1.c: Fixing ctype array to treat extended cp1252 letters as valid identifiers on server side, and as valid "isprint" characters (e.g. on client side). --- mysql-test/r/ctype_latin1.result | 3 +++ mysql-test/t/ctype_latin1.test | 17 +++++++++++++++++ strings/ctype-latin1.c | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 95fca1575ef..b47853a0ccc 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -296,6 +296,9 @@ FD C3BD FD 1 FE C3BE FE 1 FF C3BF FF 1 DROP TABLE t1; +SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ; +ƒ Š Œ Ž š œ ž Ÿ +1 2 3 4 5 6 7 8 select 'a' regexp 'A' collate latin1_general_ci; 'a' regexp 'A' collate latin1_general_ci 1 diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 1b83373da29..f2886088ba8 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -54,6 +54,23 @@ SELECT a=@l FROM t1; DROP TABLE t1; +# +# Bug#13145: A table named "C-cedilla" can't be dropped. +# Accept extended cp1252 letters as valid identifiers. +# This test partially checks that "ctype" array is correct +# for cp1252 extended characters 0x80-0x9F. +# +# 0x83 0x0192 #LATIN SMALL LETTER F WITH HOOK +# 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON +# 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE +# 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON +# 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON +# 0x9C 0x0153 #LATIN SMALL LIGATURE OE +# 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON +# 0x9F 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS +# +SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ; + # # Bug #6737: REGEXP gives wrong result with case sensitive collation # diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index b6e3e300c34..e5deba885e7 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -28,8 +28,8 @@ static uchar ctype_latin1[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 16, 2, 16, 16, 16, 16, 16, 16, 1, 16, 1, 0, 1, 0, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 2, 0, 2, 1, 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, From a778669efdf01271c6d742005e0614eaf3b3a222 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 20 Sep 2005 09:36:35 -0700 Subject: [PATCH 006/322] Tweak kill test to avoid spurious test failure on SCO OpenServer. (Bug #12136) --- mysql-test/t/kill.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index fdedaa8cd7f..aada8dd2ef3 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -24,6 +24,7 @@ select ((@id := kill_id) - kill_id) from t1; kill @id; connection con1; +--sleep 1 --disable_reconnect # this statement should fail From 743cad72f6c31ed5b2c2ae46fbc6f5ac4177e4e6 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 20 Sep 2005 16:57:58 -0700 Subject: [PATCH 007/322] Fix handling of password field at the old size (16 characters) but in the UTF-8 character set. (Bug #13064) --- sql/sql_acl.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 1b5f69c7873..47c6343bc3b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -193,6 +193,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) my_bool return_val= 1; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; char tmp_name[NAME_LEN+1]; + int password_length; DBUG_ENTER("acl_load"); priv_version++; /* Privileges updated */ @@ -250,7 +251,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0); VOID(my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100)); - if (table->field[2]->field_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323) + password_length= table->field[2]->field_length / + table->field[2]->charset()->mbmaxlen; + if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323) { sql_print_error("Fatal error: mysql.user table is damaged or in " "unsupported 3.20 format."); @@ -258,10 +261,10 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) } DBUG_PRINT("info",("user table fields: %d, password length: %d", - table->fields, table->field[2]->field_length)); + table->fields, password_length)); pthread_mutex_lock(&LOCK_global_system_variables); - if (table->field[2]->field_length < SCRAMBLED_PASSWORD_CHAR_LENGTH) + if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH) { if (opt_secure_auth) { From 12068b45e8cb7cad2e429a64d864726502efe5c5 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Wed, 21 Sep 2005 14:35:01 +0500 Subject: [PATCH 008/322] Fix for bug #12839 (Endian support is absurd) --- mysql-test/r/gis.result | 6 + mysql-test/t/gis.test | 3 + sql/field.cc | 9 +- sql/item_geofunc.cc | 77 ++++------ sql/spatial.cc | 319 +++++++++++++++++++++++++++++++++++++--- sql/spatial.h | 19 ++- 6 files changed, 354 insertions(+), 79 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index c51b07f09d6..bf2f3e2bf03 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -655,3 +655,9 @@ t1 where object_id=85984; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) 85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))) +POINT(10 10) +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); +(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))) +POINT(10 10) diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index b204bc11e2f..3eb17f3a484 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -360,4 +360,7 @@ t1 where object_id=85984; drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); + # End of 4.1 tests diff --git a/sql/field.cc b/sql/field.cc index 6d2f92e27ea..ccf82bdbae3 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5745,8 +5745,8 @@ void Field_blob::get_key_image(char *buff,uint length, return; } get_ptr(&blob); - gobj= Geometry::create_from_wkb(&buffer, - blob + SRID_SIZE, blob_length - SRID_SIZE); + gobj= Geometry::construct(&buffer, + blob + SRID_SIZE, blob_length - SRID_SIZE); if (gobj->get_mbr(&mbr, &dummy)) bzero(buff, SIZEOF_STORED_DOUBLE*4); else @@ -6039,8 +6039,7 @@ void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, return; } get_ptr(&blob); - gobj= Geometry::create_from_wkb(&buffer, - blob + SRID_SIZE, blob_length - SRID_SIZE); + gobj= Geometry::construct(&buffer, blob, blob_length); if (gobj->get_mbr(&mbr, &dummy)) bzero(buff, SIZEOF_STORED_DOUBLE*4); else @@ -6100,7 +6099,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs) uint32 wkb_type; if (length < SRID_SIZE + WKB_HEADER_SIZE + SIZEOF_STORED_DOUBLE*2) goto err; - wkb_type= uint4korr(from + WKB_HEADER_SIZE); + wkb_type= uint4korr(from + SRID_SIZE + 1); if (wkb_type < (uint32) Geometry::wkb_point || wkb_type > (uint32) Geometry::wkb_end) return -1; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 8b856d809d6..6bd2e65632f 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -78,8 +78,7 @@ String *Item_func_geometry_from_wkb::val_str(String *str) str->q_append(srid); if ((null_value= (args[0]->null_value || - !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length()) || - str->append(*wkb)))) + !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length(), str)))) return 0; return str; } @@ -96,8 +95,7 @@ String *Item_func_as_wkt::val_str(String *str) if ((null_value= (args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE))))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))) return 0; str->length(0); @@ -123,8 +121,7 @@ String *Item_func_as_wkb::val_str(String *str) if ((null_value= (args[0]->null_value || - !(Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE))))) + !(Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))) return 0; str->copy(swkb->ptr() + SRID_SIZE, swkb->length() - SRID_SIZE, @@ -142,8 +139,7 @@ String *Item_func_geometry_type::val_str(String *str) if ((null_value= (args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE))))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))) return 0; /* String will not move */ str->copy(geom->get_class_info()->m_name.str, @@ -164,8 +160,7 @@ String *Item_func_envelope::val_str(String *str) if ((null_value= args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))) return 0; srid= uint4korr(swkb->ptr()); @@ -188,8 +183,7 @@ String *Item_func_centroid::val_str(String *str) uint32 srid; if ((null_value= args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))) return 0; str->set_charset(&my_charset_bin); @@ -218,8 +212,7 @@ String *Item_func_spatial_decomp::val_str(String *str) if ((null_value= (args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE))))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))) return 0; srid= uint4korr(swkb->ptr()); @@ -267,8 +260,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str) if ((null_value= (args[0]->null_value || args[1]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE))))) + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))) return 0; str->set_charset(&my_charset_bin); @@ -475,10 +467,8 @@ longlong Item_func_spatial_rel::val_int() if ((null_value= (args[0]->null_value || args[1]->null_value || - !(g1= Geometry::create_from_wkb(&buffer1, res1->ptr() + SRID_SIZE, - res1->length() - SRID_SIZE)) || - !(g2= Geometry::create_from_wkb(&buffer2, res2->ptr() + SRID_SIZE, - res2->length() - SRID_SIZE)) || + !(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) || + !(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) || g1->get_mbr(&mbr1, &dummy) || g2->get_mbr(&mbr2, &dummy)))) return 0; @@ -543,8 +533,7 @@ longlong Item_func_isclosed::val_int() null_value= (!swkb || args[0]->null_value || !(geom= - Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + Geometry::construct(&buffer, swkb->ptr(), swkb->length())) || geom->is_closed(&isclosed)); return (longlong) isclosed; @@ -566,9 +555,7 @@ longlong Item_func_dimension::val_int() null_value= (!swkb || args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) || geom->dimension(&dim, &dummy)); return (longlong) dim; } @@ -583,9 +570,8 @@ longlong Item_func_numinteriorring::val_int() Geometry *geom; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->num_interior_ring(&num)); return (longlong) num; } @@ -600,9 +586,8 @@ longlong Item_func_numgeometries::val_int() Geometry *geom; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->num_geometries(&num)); return (longlong) num; } @@ -618,9 +603,8 @@ longlong Item_func_numpoints::val_int() null_value= (!swkb || args[0]->null_value || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->num_points(&num)); return (longlong) num; } @@ -635,9 +619,8 @@ double Item_func_x::val() Geometry *geom; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->get_x(&res)); return res; } @@ -652,9 +635,8 @@ double Item_func_y::val() Geometry *geom; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->get_y(&res)); return res; } @@ -670,9 +652,8 @@ double Item_func_area::val() const char *dummy; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->area(&res, &dummy)); return res; } @@ -686,9 +667,8 @@ double Item_func_glength::val() Geometry *geom; null_value= (!swkb || - !(geom= Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)) || + !(geom= Geometry::construct(&buffer, + swkb->ptr(), swkb->length())) || geom->length(&res)); return res; } @@ -700,9 +680,8 @@ longlong Item_func_srid::val_int() Geometry_buffer buffer; null_value= (!swkb || - !Geometry::create_from_wkb(&buffer, - swkb->ptr() + SRID_SIZE, - swkb->length() - SRID_SIZE)); + !Geometry::construct(&buffer, + swkb->ptr(), swkb->length())); if (null_value) return 0; diff --git a/sql/spatial.cc b/sql/spatial.cc index 1afb7bb7dec..d37a4605a0b 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -119,25 +119,23 @@ Geometry::Class_info *Geometry::find_class(const char *name, uint32 len) return 0; } -Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer, - const char *data, uint32 data_len) + +Geometry *Geometry::construct(Geometry_buffer *buffer, + const char *data, uint32 data_len) { uint32 geom_type; Geometry *result; + char byte_order; - if (data_len < 1 + 4) + if (data_len < SRID_SIZE + 1 + 4) return NULL; - data++; - /* - FIXME: check byte ordering - Also check if we could replace this with one byte - */ - geom_type= uint4korr(data); - data+= 4; + byte_order= data[SRID_SIZE]; + geom_type= uint4korr(data + SRID_SIZE + 1); + data+= SRID_SIZE + WKB_HEADER_SIZE; if (!(result= create_by_typeid(buffer, (int) geom_type))) return NULL; result->m_data= data; - result->m_data_end= data + data_len; + result->m_data_end= data + (data_len - (SRID_SIZE + WKB_HEADER_SIZE)); return result; } @@ -168,13 +166,71 @@ Geometry *Geometry::create_from_wkt(Geometry_buffer *buffer, return NULL; if (init_stream) { - result->init_from_wkb(wkt->ptr(), wkt->length()); + result->set_data_ptr(wkt->ptr(), wkt->length()); result->shift_wkb_header(); } return result; } +static double wkb_get_double(const char *ptr, Geometry::wkbByteOrder bo) +{ + double res; + if (bo != Geometry::wkb_xdr) + float8get(res, ptr); + else + { + char inv_array[8]; + inv_array[0]= ptr[7]; + inv_array[1]= ptr[6]; + inv_array[2]= ptr[5]; + inv_array[3]= ptr[4]; + inv_array[4]= ptr[3]; + inv_array[5]= ptr[2]; + inv_array[6]= ptr[1]; + inv_array[7]= ptr[0]; + float8get(res, inv_array); + } + return res; +} + + +static uint32 wkb_get_uint(const char *ptr, Geometry::wkbByteOrder bo) +{ + if (bo != Geometry::wkb_xdr) + return uint4korr(ptr); + /* else */ + { + char inv_array[4]; + inv_array[0]= ptr[3]; + inv_array[1]= ptr[2]; + inv_array[2]= ptr[1]; + inv_array[3]= ptr[0]; + return uint4korr(inv_array); + } +} + + +int Geometry::create_from_wkb(Geometry_buffer *buffer, + const char *wkb, uint32 len, String *res) +{ + uint32 geom_type; + Geometry *geom; + + if (len < WKB_HEADER_SIZE) + return 1; + geom_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]); + if (!(geom= create_by_typeid(buffer, (int) geom_type)) || + res->reserve(WKB_HEADER_SIZE, 512)) + return 1; + + res->q_append((char)wkb_ndr); + res->q_append(geom_type); + return geom->init_from_wkb(wkb+WKB_HEADER_SIZE, len - WKB_HEADER_SIZE, + (wkbByteOrder)wkb[0], res); +} + + bool Geometry::envelope(String *result) const { MBR mbr; @@ -344,6 +400,20 @@ bool Gis_point::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_point::init_from_wkb(const char *wkb, uint len, + wkbByteOrder bo, String *res) +{ + double x, y; + if (len < POINT_DATA_SIZE || res->reserve(POINT_DATA_SIZE)) + return 0; + x= wkb_get_double(wkb, bo); + y= wkb_get_double(wkb + SIZEOF_STORED_DOUBLE, bo); + res->q_append(x); + res->q_append(y); + return POINT_DATA_SIZE; +} + + bool Gis_point::get_data_as_wkt(String *txt, const char **end) const { double x, y; @@ -413,6 +483,33 @@ bool Gis_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_line_string::init_from_wkb(const char *wkb, uint len, + wkbByteOrder bo, String *res) +{ + uint32 n_points, proper_length; + const char *wkb_end; + Gis_point p; + + if (len < 4) + return 0; + n_points= wkb_get_uint(wkb, bo); + proper_length= 4 + n_points * POINT_DATA_SIZE; + + if (len < proper_length || res->reserve(proper_length)) + return 0; + + res->q_append(n_points); + wkb_end= wkb + proper_length; + for (wkb+= 4; wkbcheck_next_symbol(')')) return 1; - ls.init_from_wkb(wkb->ptr()+ls_pos, wkb->length()-ls_pos); + ls.set_data_ptr(wkb->ptr()+ls_pos, wkb->length()-ls_pos); if (ls.is_closed(&closed) || !closed) { trs->set_error_msg("POLYGON's linear ring isn't closed"); @@ -607,6 +704,43 @@ bool Gis_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, + String *res) +{ + uint32 n_linear_rings; + const char *wkb_orig= wkb; + + if (len < 4) + return 0; + + n_linear_rings= wkb_get_uint(wkb, bo); + if (res->reserve(4, 512)) + return 0; + wkb+= 4; + len-= 4; + res->q_append(n_linear_rings); + + while (n_linear_rings--) + { + Gis_line_string ls; + uint32 ls_pos= res->length(); + int ls_len; + int closed; + + if (!(ls_len= ls.init_from_wkb(wkb, len, bo, res))) + return 0; + + ls.set_data_ptr(res->ptr()+ls_pos, res->length()-ls_pos); + + if (ls.is_closed(&closed) || !closed) + return 0; + wkb+= ls_len; + } + + return wkb - wkb_orig; +} + + bool Gis_polygon::get_data_as_wkt(String *txt, const char **end) const { uint32 n_linear_rings; @@ -895,6 +1029,36 @@ bool Gis_multi_point::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_multi_point::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, + String *res) +{ + uint32 n_points; + uint proper_size; + Gis_point p; + const char *wkb_end; + + if (len < 4) + return 0; + n_points= wkb_get_uint(wkb, bo); + proper_size= 4 + n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE); + + if (len < proper_size || res->reserve(proper_size)) + return 0; + + res->q_append(n_points); + wkb_end= wkb + proper_size; + for (wkb+=4; wkb < wkb_end; wkb+= (WKB_HEADER_SIZE + POINT_DATA_SIZE)) + { + res->q_append((char)wkb_ndr); + res->q_append((uint32)wkb_point); + if (!p.init_from_wkb(wkb + WKB_HEADER_SIZE, + POINT_DATA_SIZE, (wkbByteOrder)wkb[0], res)) + return 0; + } + return proper_size; +} + + bool Gis_multi_point::get_data_as_wkt(String *txt, const char **end) const { uint32 n_points; @@ -1004,6 +1168,42 @@ bool Gis_multi_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len, + wkbByteOrder bo, String *res) +{ + uint32 n_line_strings; + const char *wkb_orig= wkb; + + if (len < 4) + return 0; + n_line_strings= wkb_get_uint(wkb, bo); + + if (res->reserve(4, 512)) + return 0; + res->q_append(n_line_strings); + + for (wkb+=4; n_line_strings; n_line_strings--) + { + Gis_line_string ls; + int ls_len; + + if ((len < WKB_HEADER_SIZE) || + res->reserve(WKB_HEADER_SIZE, 512)) + return 0; + + res->q_append((char) wkb_ndr); + res->q_append((uint32) wkb_linestring); + + if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len, + (wkbByteOrder)wkb[0], res))) + return 0; + wkb+= (ls_len + WKB_HEADER_SIZE); + len-= (ls_len + WKB_HEADER_SIZE); + } + return wkb-wkb_orig; +} + + bool Gis_multi_line_string::get_data_as_wkt(String *txt, const char **end) const { @@ -1109,7 +1309,7 @@ int Gis_multi_line_string::length(double *len) const double ls_len; Gis_line_string ls; data+= WKB_HEADER_SIZE; - ls.init_from_wkb(data, (uint32) (m_data_end - data)); + ls.set_data_ptr(data, (uint32) (m_data_end - data)); if (ls.length(&ls_len)) return 1; *len+= ls_len; @@ -1138,7 +1338,7 @@ int Gis_multi_line_string::is_closed(int *closed) const Gis_line_string ls; if (no_data(data, 0)) return 1; - ls.init_from_wkb(data, (uint32) (m_data_end - data)); + ls.set_data_ptr(data, (uint32) (m_data_end - data)); if (ls.is_closed(closed)) return 1; if (!*closed) @@ -1220,6 +1420,41 @@ bool Gis_multi_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len, + wkbByteOrder bo, String *res) +{ + uint32 n_poly; + const char *wkb_orig= wkb; + + if (len < 4) + return 0; + n_poly= wkb_get_uint(wkb, bo); + + if (res->reserve(4, 512)) + return 0; + res->q_append(n_poly); + + for (wkb+=4; n_poly; n_poly--) + { + Gis_polygon p; + int p_len; + + if (len < WKB_HEADER_SIZE || + res->reserve(WKB_HEADER_SIZE, 512)) + return 0; + res->q_append((char) wkb_ndr); + res->q_append((uint32) wkb_polygon); + + if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len, + (wkbByteOrder)wkb[0], res))) + return 0; + wkb+= (p_len + WKB_HEADER_SIZE); + len-= (p_len + WKB_HEADER_SIZE); + } + return wkb-wkb_orig; +} + + bool Gis_multi_polygon::get_data_as_wkt(String *txt, const char **end) const { uint32 n_polygons; @@ -1356,7 +1591,7 @@ int Gis_multi_polygon::area(double *ar, const char **end_of_data) const Gis_polygon p; data+= WKB_HEADER_SIZE; - p.init_from_wkb(data, (uint32) (m_data_end - data)); + p.set_data_ptr(data, (uint32) (m_data_end - data)); if (p.area(&p_area, &data)) return 1; result+= p_area; @@ -1388,7 +1623,7 @@ int Gis_multi_polygon::centroid(String *result) const while (n_polygons--) { data+= WKB_HEADER_SIZE; - p.init_from_wkb(data, (uint32) (m_data_end - data)); + p.set_data_ptr(data, (uint32) (m_data_end - data)); if (p.area(&cur_area, &data) || p.centroid_xy(&cur_cx, &cur_cy)) return 1; @@ -1442,7 +1677,7 @@ uint32 Gis_geometry_collection::get_data_size() const if (!(geom= create_by_typeid(&buffer, wkb_type))) return GET_SIZE_ERROR; - geom->init_from_wkb(data, (uint) (m_data_end - data)); + geom->set_data_ptr(data, (uint) (m_data_end - data)); if ((object_size= geom->get_data_size()) == GET_SIZE_ERROR) return GET_SIZE_ERROR; data+= object_size; @@ -1482,6 +1717,46 @@ bool Gis_geometry_collection::init_from_wkt(Gis_read_stream *trs, String *wkb) } +uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len, + wkbByteOrder bo, String *res) +{ + uint32 n_geom; + const char *wkb_orig= wkb; + + if (len < 4) + return 0; + n_geom= wkb_get_uint(wkb, bo); + + if (res->reserve(4, 512)) + return 0; + res->q_append(n_geom); + + for (wkb+=4; n_geom; n_geom--) + { + Geometry_buffer buffer; + Geometry *geom; + int g_len; + uint32 wkb_type; + + if (len < WKB_HEADER_SIZE || + res->reserve(WKB_HEADER_SIZE, 512)) + return 0; + + res->q_append((char) wkb_ndr); + wkb_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]); + res->q_append(wkb_type); + + if (!(geom= create_by_typeid(&buffer, wkb_type)) || + !(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len, + (wkbByteOrder)wkb[0], res))) + return 0; + wkb+= (g_len + WKB_HEADER_SIZE); + len-= (g_len + WKB_HEADER_SIZE); + } + return wkb-wkb_orig; +} + + bool Gis_geometry_collection::get_data_as_wkt(String *txt, const char **end) const { @@ -1506,7 +1781,7 @@ bool Gis_geometry_collection::get_data_as_wkt(String *txt, if (!(geom= create_by_typeid(&buffer, wkb_type))) return 1; - geom->init_from_wkb(data, (uint) (m_data_end - data)); + geom->set_data_ptr(data, (uint) (m_data_end - data)); if (geom->as_wkt(txt, &data)) return 1; if (txt->append(",", 1, 512)) @@ -1541,7 +1816,7 @@ bool Gis_geometry_collection::get_mbr(MBR *mbr, const char **end) const if (!(geom= create_by_typeid(&buffer, wkb_type))) return 1; - geom->init_from_wkb(data, (uint32) (m_data_end - data)); + geom->set_data_ptr(data, (uint32) (m_data_end - data)); if (geom->get_mbr(mbr, &data)) return 1; } @@ -1582,7 +1857,7 @@ int Gis_geometry_collection::geometry_n(uint32 num, String *result) const if (!(geom= create_by_typeid(&buffer, wkb_type))) return 1; - geom->init_from_wkb(data, (uint) (m_data_end - data)); + geom->set_data_ptr(data, (uint) (m_data_end - data)); if ((length= geom->get_data_size()) == GET_SIZE_ERROR) return 1; data+= length; @@ -1635,7 +1910,7 @@ bool Gis_geometry_collection::dimension(uint32 *res_dim, const char **end) const data+= WKB_HEADER_SIZE; if (!(geom= create_by_typeid(&buffer, wkb_type))) return 1; - geom->init_from_wkb(data, (uint32) (m_data_end - data)); + geom->set_data_ptr(data, (uint32) (m_data_end - data)); if (geom->dimension(&dim, &end_data)) return 1; set_if_bigger(*res_dim, dim); diff --git a/sql/spatial.h b/sql/spatial.h index b96434831a1..acd16172fcc 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -202,6 +202,10 @@ public: virtual const Class_info *get_class_info() const=0; virtual uint32 get_data_size() const=0; virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0; + + /* returns the length of the wkb that was read */ + virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, + String *res)=0; virtual bool get_data_as_wkt(String *txt, const char **end) const=0; virtual bool get_mbr(MBR *mbr, const char **end) const=0; virtual bool dimension(uint32 *dim, const char **end) const=0; @@ -231,11 +235,13 @@ public: return my_reinterpret_cast(Geometry *)(buffer); } - static Geometry *create_from_wkb(Geometry_buffer *buffer, - const char *data, uint32 data_len); + static Geometry *construct(Geometry_buffer *buffer, + const char *data, uint32 data_len); static Geometry *create_from_wkt(Geometry_buffer *buffer, Gis_read_stream *trs, String *wkt, bool init_stream=1); + static int Geometry::create_from_wkb(Geometry_buffer *buffer, + const char *wkb, uint32 len, String *res); int as_wkt(String *wkt, const char **end) { uint32 len= get_class_info()->m_name.length; @@ -249,7 +255,7 @@ public: return 0; } - inline void init_from_wkb(const char *data, uint32 data_len) + inline void set_data_ptr(const char *data, uint32 data_len) { m_data= data; m_data_end= data + data_len; @@ -293,6 +299,7 @@ class Gis_point: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; @@ -339,6 +346,7 @@ class Gis_line_string: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int length(double *len) const; @@ -364,6 +372,7 @@ class Gis_polygon: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int area(double *ar, const char **end) const; @@ -389,6 +398,7 @@ class Gis_multi_point: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; @@ -410,6 +420,7 @@ class Gis_multi_line_string: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; @@ -433,6 +444,7 @@ class Gis_multi_polygon: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; @@ -456,6 +468,7 @@ class Gis_geometry_collection: public Geometry public: uint32 get_data_size() const; bool init_from_wkt(Gis_read_stream *trs, String *wkb); + uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res); bool get_data_as_wkt(String *txt, const char **end) const; bool get_mbr(MBR *mbr, const char **end) const; int num_geometries(uint32 *num) const; From 3bfe3579d4d58a33062f3c7053206d331df7659d Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 22 Sep 2005 15:59:13 -0700 Subject: [PATCH 009/322] Fix CAST(1.0e+300 TO SIGNED). (Bug #13344) --- mysql-test/r/cast.result | 3 +++ mysql-test/t/cast.test | 5 +++++ sql/item.h | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7cd0934f7a3..d5d679a0ae8 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -252,3 +252,6 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 394971f9648..e883788be51 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -143,4 +143,9 @@ select cast(concat('184467440','73709551615') as signed); select cast(repeat('1',20) as unsigned); select cast(repeat('1',20) as signed); +# +# Bug #13344: cast of large decimal to signed int not handled correctly +# +select cast(1.0e+300 as signed int); + # End of 4.1 tests diff --git a/sql/item.h b/sql/item.h index e683cda5786..f55707cfc32 100644 --- a/sql/item.h +++ b/sql/item.h @@ -703,6 +703,14 @@ public: longlong val_int() { DBUG_ASSERT(fixed == 1); + if (value <= (double) LONGLONG_MIN) + { + return LONGLONG_MIN; + } + else if (value >= (double) (ulonglong) LONGLONG_MAX) + { + return LONGLONG_MAX; + } return (longlong) (value+(value > 0 ? 0.5 : -0.5)); } String *val_str(String*); From 836bc2638e1939c0f65748f219e5613cc0f0af06 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Mon, 26 Sep 2005 14:55:52 +0500 Subject: [PATCH 010/322] Fix for bug #12267 (primary key over GEOMETRY field) --- mysql-test/r/gis.result | 5 +++++ mysql-test/t/gis.test | 8 ++++++++ sql/sql_table.cc | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 78014137b50..2748199efad 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -680,3 +680,8 @@ select astext(fn3()); astext(fn3()) POINT(1 1) drop function fn3; +create table t1(pt POINT); +alter table t1 add primary key pti(pt); +ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length +alter table t1 add primary key pti(pt(20)); +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index aba2f33833a..1f30407c2b7 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -395,3 +395,11 @@ show create function fn3; select astext(fn3()); drop function fn3; +# +# Bug #12267 (primary key over GIS) +# +create table t1(pt POINT); +--error 1170 +alter table t1 add primary key pti(pt); +alter table t1 add primary key pti(pt(20)); +drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 635b512fe23..d9ed7165850 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1148,7 +1148,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, { column->length*= sql_field->charset->mbmaxlen; - if (f_is_blob(sql_field->pack_flag)) + if (f_is_blob(sql_field->pack_flag) || + (f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL)) { if (!(file->table_flags() & HA_CAN_INDEX_BLOBS)) { From 6a84506af777a19fbe730cae322d387b28e331f4 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Mon, 26 Sep 2005 18:46:31 +0200 Subject: [PATCH 011/322] Fixed BUG#7049: Stored procedure CALL errors are ignored Search the chain of sp_rcontexts recursively for handlers. If one is found, it will be detected in the sp_head::execute() method at the corresponding level. --- mysql-test/r/sp.result | 95 +++++++++++++++++++++++++++++++++++++--- mysql-test/t/sp.test | 98 ++++++++++++++++++++++++++++++++++++++++++ sql/sp_head.cc | 9 ++-- sql/sp_rcontext.cc | 8 +++- sql/sp_rcontext.h | 4 +- 5 files changed, 202 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index f9e6eae7e57..dea04dfdfdf 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3310,19 +3310,15 @@ select 1| 1 call bug12379_1()| bug12379() +NULL 42 42 -Warnings: -Error 1062 Duplicate entry 'X' for key 1 -Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes select 2| 2 2 call bug12379_2()| bug12379() -Warnings: -Error 1062 Duplicate entry 'X' for key 1 -Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes +NULL select 3| 3 3 @@ -3390,4 +3386,91 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| +drop table if exists t3| +drop procedure if exists bug7049_1| +drop procedure if exists bug7049_2| +drop procedure if exists bug7049_3| +drop procedure if exists bug7049_4| +drop procedure if exists bug7049_5| +drop procedure if exists bug7049_6| +drop function if exists bug7049_1| +drop function if exists bug7049_2| +create table t3 ( x int unique )| +create procedure bug7049_1() +begin +insert into t3 values (42); +insert into t3 values (42); +end| +create procedure bug7049_2() +begin +declare exit handler for sqlexception +select 'Caught it' as 'Result'; +call bug7049_1(); +select 'Missed it' as 'Result'; +end| +create procedure bug7049_3() +call bug7049_1()| +create procedure bug7049_4() +begin +declare exit handler for sqlexception +select 'Caught it' as 'Result'; +call bug7049_3(); +select 'Missed it' as 'Result'; +end| +create procedure bug7049_5() +begin +declare x decimal(2,1); +set x = 'zap'; +end| +create procedure bug7049_6() +begin +declare exit handler for sqlwarning +select 'Caught it' as 'Result'; +call bug7049_5(); +select 'Missed it' as 'Result'; +end| +create function bug7049_1() +returns int +begin +insert into t3 values (42); +insert into t3 values (42); +return 42; +end| +create function bug7049_2() +returns int +begin +declare x int default 0; +declare continue handler for sqlexception +set x = 1; +set x = bug7049_1(); +return x; +end| +call bug7049_2()| +Result +Caught it +select * from t3| +x +42 +delete from t3| +call bug7049_4()| +Result +Caught it +select * from t3| +x +42 +call bug7049_6()| +Result +Caught it +select bug7049_2()| +bug7049_2() +1 +drop table t3| +drop procedure bug7049_1| +drop procedure bug7049_2| +drop procedure bug7049_3| +drop procedure bug7049_4| +drop procedure bug7049_5| +drop procedure bug7049_6| +drop function bug7049_1| +drop function bug7049_2| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 65d4f89e2bb..67fb165d4f4 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4264,6 +4264,104 @@ drop table t3| drop procedure bug6127| +# +# BUG#7049: Stored procedure CALL errors are ignored +# +--disable_warnings +drop table if exists t3| +drop procedure if exists bug7049_1| +drop procedure if exists bug7049_2| +drop procedure if exists bug7049_3| +drop procedure if exists bug7049_4| +drop procedure if exists bug7049_5| +drop procedure if exists bug7049_6| +drop function if exists bug7049_1| +drop function if exists bug7049_2| +--enable_warnings + +create table t3 ( x int unique )| + +create procedure bug7049_1() +begin + insert into t3 values (42); + insert into t3 values (42); +end| + +create procedure bug7049_2() +begin + declare exit handler for sqlexception + select 'Caught it' as 'Result'; + + call bug7049_1(); + select 'Missed it' as 'Result'; +end| + +create procedure bug7049_3() + call bug7049_1()| + +create procedure bug7049_4() +begin + declare exit handler for sqlexception + select 'Caught it' as 'Result'; + + call bug7049_3(); + select 'Missed it' as 'Result'; +end| + +create procedure bug7049_5() +begin + declare x decimal(2,1); + + set x = 'zap'; +end| + +create procedure bug7049_6() +begin + declare exit handler for sqlwarning + select 'Caught it' as 'Result'; + + call bug7049_5(); + select 'Missed it' as 'Result'; +end| + +create function bug7049_1() + returns int +begin + insert into t3 values (42); + insert into t3 values (42); + return 42; +end| + +create function bug7049_2() + returns int +begin + declare x int default 0; + declare continue handler for sqlexception + set x = 1; + + set x = bug7049_1(); + return x; +end| + +call bug7049_2()| +select * from t3| +delete from t3| +call bug7049_4()| +select * from t3| +call bug7049_6()| +select bug7049_2()| + +drop table t3| +drop procedure bug7049_1| +drop procedure bug7049_2| +drop procedure bug7049_3| +drop procedure bug7049_4| +drop procedure bug7049_5| +drop procedure bug7049_6| +drop function bug7049_1| +drop function bug7049_2| + + # # BUG#NNNN: New bug synopsis # diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 671acbc2a0c..ab0e42a7ab6 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1110,7 +1110,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, Item **resp) DBUG_RETURN(-1); // QQ Should have some error checking here? (types, etc...) - if (!(nctx= new sp_rcontext(csize, hmax, cmax))) + if (!(nctx= new sp_rcontext(octx, csize, hmax, cmax))) goto end; for (i= 0 ; i < argcount ; i++) { @@ -1254,7 +1254,7 @@ int sp_head::execute_procedure(THD *thd, List *args) save_spcont= octx= thd->spcont; if (! octx) { // Create a temporary old context - if (!(octx= new sp_rcontext(csize, hmax, cmax))) + if (!(octx= new sp_rcontext(octx, csize, hmax, cmax))) DBUG_RETURN(-1); thd->spcont= octx; @@ -1262,7 +1262,7 @@ int sp_head::execute_procedure(THD *thd, List *args) thd->spcont->callers_arena= thd; } - if (!(nctx= new sp_rcontext(csize, hmax, cmax))) + if (!(nctx= new sp_rcontext(octx, csize, hmax, cmax))) { thd->spcont= save_spcont; DBUG_RETURN(-1); @@ -2390,7 +2390,10 @@ sp_instr_hreturn::print(String *str) str->append("hreturn "); str->qs_append(m_frame); if (m_dest) + { + str->append(' '); str->qs_append(m_dest); + } } diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 252bd7e5cab..ccb38358049 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -29,9 +29,9 @@ #include "sp_rcontext.h" #include "sp_pcontext.h" -sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax) +sp_rcontext::sp_rcontext(sp_rcontext *prev, uint fsize, uint hmax, uint cmax) : m_count(0), m_fsize(fsize), m_result(NULL), m_hcount(0), m_hsp(0), - m_ihsp(0), m_hfound(-1), m_ccount(0) + m_ihsp(0), m_hfound(-1), m_ccount(0), m_prev_ctx(prev) { m_frame= (Item **)sql_alloc(fsize * sizeof(Item*)); m_handler= (sp_handler_t *)sql_alloc(hmax * sizeof(sp_handler_t)); @@ -116,7 +116,11 @@ sp_rcontext::find_handler(uint sql_errno, } } if (found < 0) + { + if (m_prev_ctx) + return m_prev_ctx->find_handler(sql_errno, level); return FALSE; + } m_hfound= found; return TRUE; } diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 22fa4f6e865..c7a298eccc0 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -66,7 +66,7 @@ class sp_rcontext : public Sql_alloc */ Query_arena *callers_arena; - sp_rcontext(uint fsize, uint hmax, uint cmax); + sp_rcontext(sp_rcontext *prev, uint fsize, uint hmax, uint cmax); ~sp_rcontext() { @@ -226,6 +226,8 @@ private: sp_cursor **m_cstack; uint m_ccount; + sp_rcontext *m_prev_ctx; // Previous context (NULL if none) + }; // class sp_rcontext : public Sql_alloc From 7f3e2dc48d1f40a68b45218642677738a6607370 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 15:11:39 +0500 Subject: [PATCH 012/322] Fix for bug #13372 (decimal union) --- mysql-test/r/type_decimal.result | 17 ++++++++++++++++- mysql-test/r/type_float.result | 15 +++++++++++++++ mysql-test/t/type_decimal.test | 14 +++++++++++++- mysql-test/t/type_float.test | 13 +++++++++++++ sql/item.cc | 24 ++++++++++++++++++++++-- 5 files changed, 79 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index c3b2d5090ef..de8610f6514 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2, t3; SET SQL_WARNINGS=1; CREATE TABLE t1 ( id int(11) NOT NULL auto_increment, @@ -655,3 +655,18 @@ select * from t1; a b 123.12345 123.1 drop table t1; +create table t1 (d decimal(10,1)); +create table t2 (d decimal(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +d +1.234567800 +100000000.000000000 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `d` decimal(18,9) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 319a957498b..2e6642c3fcf 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -235,3 +235,18 @@ select * from t1 where reckey=1.09E2; reckey recdesc 109 Has 109 as key drop table t1; +create table t1 (d double(10,1)); +create table t2 (d double(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +d +1.234567800 +100000000.000000000 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `d` double(61,9) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 1f133666910..cc5e9278b12 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -1,7 +1,7 @@ # bug in decimal() with negative numbers by kaido@tradenet.ee --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2, t3; --enable_warnings SET SQL_WARNINGS=1; @@ -276,4 +276,16 @@ update t1 set b=a; select * from t1; drop table t1; +# +# Bug #13372 (decimal union) +# +create table t1 (d decimal(10,1)); +create table t2 (d decimal(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +show create table t3; +drop table t1, t2, t3; + # End of 4.1 tests diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 2d4a90911a1..abaf72ea2ed 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -149,4 +149,17 @@ select * from t1 where reckey=109; select * from t1 where reckey=1.09E2; drop table t1; +# +# Bug #13372 (decimal union) +# +create table t1 (d double(10,1)); +create table t2 (d double(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +show create table t3; +drop table t1, t2, t3; + + # End of 4.1 tests diff --git a/sql/item.cc b/sql/item.cc index 010189c321c..ec83cc1f511 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3205,9 +3205,14 @@ enum_field_types Item_type_holder::get_real_type(Item *item) bool Item_type_holder::join_types(THD *thd, Item *item) { + uint max_length_orig= max_length; + uint decimals_orig= decimals; max_length= max(max_length, display_length(item)); + decimals= max(decimals, item->decimals); fld_type= Field::field_type_merge(fld_type, get_real_type(item)); - if (Field::result_merge_type(fld_type) == STRING_RESULT) + switch (Field::result_merge_type(fld_type)) + { + case STRING_RESULT: { const char *old_cs, *old_derivation; old_cs= collation.collation->name; @@ -3221,8 +3226,23 @@ bool Item_type_holder::join_types(THD *thd, Item *item) "UNION"); return TRUE; } + break; } - decimals= max(decimals, item->decimals); + case REAL_RESULT: + { + decimals= max(decimals, item->decimals); + if (decimals != NOT_FIXED_DEC) + { + int delta1= max_length_orig - decimals_orig; + int delta2= item->max_length - item->decimals; + max_length= max(delta1, delta2) + decimals; + } + else + max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7; + break; + } + default:; + }; maybe_null|= item->maybe_null; get_full_info(item); return FALSE; From 9b88d252470984beb62bf5fd6c1c1da745f22456 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 15:31:38 +0500 Subject: [PATCH 013/322] additional fix to the bug #13372 (decimal union) --- mysql-test/r/type_float.result | 2 +- sql/item.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 2e6642c3fcf..6e381192270 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -247,6 +247,6 @@ d show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` double(61,9) default NULL + `d` double(22,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; diff --git a/sql/item.cc b/sql/item.cc index ec83cc1f511..b3c0e64dec1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3230,12 +3230,12 @@ bool Item_type_holder::join_types(THD *thd, Item *item) } case REAL_RESULT: { - decimals= max(decimals, item->decimals); if (decimals != NOT_FIXED_DEC) { int delta1= max_length_orig - decimals_orig; int delta2= item->max_length - item->decimals; - max_length= max(delta1, delta2) + decimals; + max_length= min(max(delta1, delta2) + decimals, + (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7); } else max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7; From f0dfa1954856a6e49e843f4725101d05eff2c1a5 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 16:23:37 +0500 Subject: [PATCH 014/322] additional fix for bug #13372 (decimal union) --- mysql-test/r/union.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index a3dd2c5c291..318bfa2cda8 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -565,7 +565,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` double(53,1) NOT NULL default '0.0' + `a` double(21,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); From ceb541e4bc441433bc64317dc42dfce7ed6f4a28 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 28 Sep 2005 15:46:09 +0500 Subject: [PATCH 015/322] Bug#13487 Japanese data inside a comment causes the syntax error mysql.cc: Fixed not to copy multibyte characters to the target string if we are inside a comment. --- client/mysql.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index e73d627d67a..06b869be495 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1157,11 +1157,17 @@ static bool add_line(String &buffer,char *line,char *in_string, #ifdef USE_MB int l; if (use_mb(charset_info) && - (l = my_ismbchar(charset_info, pos, strend))) { - while (l--) - *out++ = *pos++; - pos--; - continue; + (l= my_ismbchar(charset_info, pos, strend))) + { + if (!*ml_comment) + { + while (l--) + *out++ = *pos++; + pos--; + } + else + pos+= l - 1; + continue; } #endif if (!*ml_comment && inchar == '\\') From d81d57d408c0965d8cce06a7b114f06235d65163 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Thu, 29 Sep 2005 10:42:23 +0200 Subject: [PATCH 016/322] mysqlbinlog --hexdump augments each log entry with byte information --- client/mysqlbinlog.cc | 30 ++++++---- sql/log_event.cc | 134 ++++++++++++++++++++++++++++++------------ sql/log_event.h | 69 ++++++++++++++-------- 3 files changed, 163 insertions(+), 70 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index eff05b9a8bf..577ae82eebd 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -62,6 +62,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0; +static bool opt_hexdump= 0; static const char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static ulonglong offset = 0; @@ -522,12 +523,15 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, } if (!short_form) fprintf(result_file, "# at %s\n",llstr(pos,ll_buff)); - + + /* Set pos to 0 if hexdump is disabled */ + pos= (opt_hexdump ? pos : 0); + switch (ev_type) { case QUERY_EVENT: if (check_database(((Query_log_event*)ev)->db)) goto end; - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); break; case CREATE_FILE_EVENT: { @@ -547,7 +551,8 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT' below. */ - ce->print(result_file, short_form, last_event_info, TRUE); + ce->print(result_file, short_form, pos, last_event_info, TRUE); + // If this binlog is not 3.23 ; why this test?? if (description_event->binlog_version >= 3) { @@ -558,13 +563,13 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, break; } case APPEND_BLOCK_EVENT: - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); if (load_processor.process((Append_block_log_event*) ev)) break; // Error break; case EXEC_LOAD_EVENT: { - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); Execute_load_log_event *exv= (Execute_load_log_event*)ev; Create_file_log_event *ce= load_processor.grab_event(exv->file_id); /* @@ -574,7 +579,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, */ if (ce) { - ce->print(result_file, short_form, last_event_info, TRUE); + ce->print(result_file, short_form, pos, last_event_info, TRUE); my_free((char*)ce->fname,MYF(MY_WME)); delete ce; } @@ -586,7 +591,7 @@ Create_file event for file_id: %u\n",exv->file_id); case FORMAT_DESCRIPTION_EVENT: delete description_event; description_event= (Format_description_log_event*) ev; - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); /* We don't want this event to be deleted now, so let's hide it (I (Guilhem) should later see if this triggers a non-serious Valgrind @@ -596,7 +601,7 @@ Create_file event for file_id: %u\n",exv->file_id); ev= 0; break; case BEGIN_LOAD_QUERY_EVENT: - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); load_processor.process((Begin_load_query_log_event*) ev); break; case EXECUTE_LOAD_QUERY_EVENT: @@ -613,7 +618,7 @@ Create_file event for file_id: %u\n",exv->file_id); if (fname) { - exlq->print(result_file, short_form, last_event_info, fname); + exlq->print(result_file, short_form, pos, last_event_info, fname); my_free(fname, MYF(MY_WME)); } else @@ -622,7 +627,7 @@ Begin_load_query event for file_id: %u\n", exlq->file_id); break; } default: - ev->print(result_file, short_form, last_event_info); + ev->print(result_file, short_form, pos, last_event_info); } } @@ -669,6 +674,8 @@ static struct my_option my_long_options[] = 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"hexdump", 'H', "Augment output with hexadecimal and ascii data dump.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Get the binlog from server.", (gptr*) &host, (gptr*) &host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset, @@ -848,6 +855,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'd': one_database = 1; break; + case 'H': + opt_hexdump= 1; + break; case 'p': if (argument) { diff --git a/sql/log_event.cc b/sql/log_event.cc index 5cb4c289a10..631a4627f3a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -24,6 +24,8 @@ #include "mysql_priv.h" #include "slave.h" #include +#else +#include /* For isalnum() */ #endif /* MYSQL_CLIENT */ #define log_cs &my_charset_latin1 @@ -881,15 +883,58 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, Log_event::print_header() */ -void Log_event::print_header(FILE* file) +void Log_event::print_header(FILE* file, my_off_t start_pos) { char llbuff[22]; fputc('#', file); print_timestamp(file); fprintf(file, " server id %d end_log_pos %s ", server_id, llstr(log_pos,llbuff)); + + if (start_pos) + { + fprintf(file, "\n"); + unsigned char *ptr= (unsigned char*)temp_buf; + my_off_t i; + + char position[8+1] = {0}; + char b[3+1] = {0}; + char hex_string[16*3+1+1] = {0}; + char char_string[16+1] = {0}; + + for (i= 0; i < (log_pos-start_pos); i++, ptr++) + { + if (i % 16 == 0) + snprintf(position, sizeof(position), "%.8x", + (unsigned int) (start_pos+i)); + + snprintf(b, sizeof(b), "%02X ", *ptr); + strncat(hex_string, b, sizeof(hex_string)-strlen(hex_string)-1); + + snprintf(b, sizeof(b), "%c", isalnum(*ptr) ? *ptr : '.'); + strncat(char_string, b, sizeof(char_string)-strlen(char_string)-1); + + if (i % 16 == 15) + { + fprintf(file, "# %8.8s %-48.48s |%16s|\n", + position, hex_string, char_string); + hex_string[0] = 0; + char_string[0] = 0; + } + else if (i % 8 == 7) + { + /* Middle space */ + strncat(hex_string, " ", sizeof(hex_string)-strlen(hex_string)-1); + } + } + + if (strlen(hex_string)) { + printf("# %8.8s %-48.48s |%s|\n# ", position, hex_string, char_string); + } + } } + /* Log_event::print_timestamp() */ @@ -1373,6 +1418,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, #ifdef MYSQL_CLIENT void Query_log_event::print_query_header(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { // TODO: print the catalog ?? @@ -1382,7 +1428,7 @@ void Query_log_event::print_query_header(FILE* file, bool short_form, if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n", get_type_str(), (ulong) thread_id, (ulong) exec_time, error_code); } @@ -1503,10 +1549,10 @@ void Query_log_event::print_query_header(FILE* file, bool short_form, } -void Query_log_event::print(FILE* file, bool short_form, +void Query_log_event::print(FILE* file, bool short_form, my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { - print_query_header(file, short_form, last_event_info); + print_query_header(file, short_form, start_pos, last_event_info); my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME)); fputs(";\n", file); } @@ -1804,11 +1850,12 @@ void Start_log_event_v3::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Start_log_event_v3::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Start_log_event_v3::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\tStart: binlog v %d, server v %s created ", binlog_version, server_version); print_timestamp(file); @@ -2532,19 +2579,20 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, */ #ifdef MYSQL_CLIENT -void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Load_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { - print(file, short_form, last_event_info, 0); + print(file, short_form, start_pos, last_event_info, 0); } -void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, - bool commented) +void Load_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info, bool commented) { DBUG_ENTER("Load_log_event::print"); if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\tQuery\tthread_id=%ld\texec_time=%ld\n", thread_id, exec_time); } @@ -2949,13 +2997,14 @@ void Rotate_log_event::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Rotate_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Rotate_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { char buf[22]; if (short_form) return; - print_header(file); + print_header(file, start_pos); fprintf(file, "\tRotate to "); if (new_log_ident) my_fwrite(file, (byte*) new_log_ident, (uint)ident_len, @@ -3151,7 +3200,7 @@ bool Intvar_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Intvar_log_event::print(FILE* file, bool short_form, +void Intvar_log_event::print(FILE* file, bool short_form, my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; @@ -3160,7 +3209,7 @@ void Intvar_log_event::print(FILE* file, bool short_form, if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\tIntvar\n"); } @@ -3241,12 +3290,13 @@ bool Rand_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Rand_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Rand_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { char llbuff[22],llbuff2[22]; if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\tRand\n"); } fprintf(file, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s;\n", @@ -3311,14 +3361,15 @@ bool Xid_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Xid_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Xid_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { if (!short_form) { char buf[64]; longlong10_to_str(xid, buf, 10); - print_header(file); + print_header(file, start_pos); fprintf(file, "\tXid = %s\n", buf); fflush(file); } @@ -3509,11 +3560,12 @@ bool User_var_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void User_var_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void User_var_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { if (!short_form) { - print_header(file); + print_header(file, start_pos); fprintf(file, "\tUser_var\n"); } @@ -3684,11 +3736,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) #ifdef HAVE_REPLICATION #ifdef MYSQL_CLIENT -void Unknown_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Unknown_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file); + print_header(file, start_pos); fputc('\n', file); fprintf(file, "# %s", "Unknown event\n"); } @@ -3755,12 +3808,13 @@ Slave_log_event::~Slave_log_event() #ifdef MYSQL_CLIENT -void Slave_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Slave_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { char llbuff[22]; if (short_form) return; - print_header(file); + print_header(file, start_pos); fputc('\n', file); fprintf(file, "\ Slave: master_host: '%s' master_port: %d master_log: '%s' master_pos: %s\n", @@ -3840,12 +3894,13 @@ int Slave_log_event::exec_event(struct st_relay_log_info* rli) */ #ifdef MYSQL_CLIENT -void Stop_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info) +void Stop_log_event::print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file); + print_header(file, start_pos); fprintf(file, "\tStop\n"); fflush(file); } @@ -4019,19 +4074,20 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len, */ #ifdef MYSQL_CLIENT -void Create_file_log_event::print(FILE* file, bool short_form, +void Create_file_log_event::print(FILE* file, bool short_form, my_off_t start_pos, LAST_EVENT_INFO* last_event_info, bool enable_local) { if (short_form) { if (enable_local && check_fname_outside_temp_buf()) - Load_log_event::print(file, 1, last_event_info); + Load_log_event::print(file, 1, start_pos, last_event_info); return; } if (enable_local) { - Load_log_event::print(file, short_form, last_event_info, !check_fname_outside_temp_buf()); + Load_log_event::print(file, short_form, start_pos, last_event_info, + !check_fname_outside_temp_buf()); /* That one is for "file_id: etc" below: in mysqlbinlog we want the #, in SHOW BINLOG EVENTS we don't. @@ -4044,9 +4100,10 @@ void Create_file_log_event::print(FILE* file, bool short_form, void Create_file_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { - print(file,short_form,last_event_info,0); + print(file, short_form, start_pos, last_event_info, 0); } #endif /* MYSQL_CLIENT */ @@ -4207,11 +4264,12 @@ bool Append_block_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Append_block_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file); + print_header(file, start_pos); fputc('\n', file); fprintf(file, "#%s: file_id: %d block_len: %d\n", get_type_str(), file_id, block_len); @@ -4351,11 +4409,12 @@ bool Delete_file_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Delete_file_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file); + print_header(file, start_pos); fputc('\n', file); fprintf(file, "#Delete_file: file_id=%u\n", file_id); } @@ -4447,11 +4506,12 @@ bool Execute_load_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Execute_load_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file); + print_header(file, start_pos); fputc('\n', file); fprintf(file, "#Exec_load: file_id=%d\n", file_id); @@ -4659,17 +4719,19 @@ Execute_load_query_log_event::write_post_header_for_derived(IO_CACHE* file) #ifdef MYSQL_CLIENT void Execute_load_query_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, last_event_info, 0); + print(file, short_form, start_pos, last_event_info, 0); } void Execute_load_query_log_event::print(FILE* file, bool short_form, + my_off_t start_pos, LAST_EVENT_INFO* last_event_info, const char *local_fname) { - print_query_header(file, short_form, last_event_info); + print_query_header(file, short_form, start_pos, last_event_info); if (local_fname) { diff --git a/sql/log_event.h b/sql/log_event.h index 29580589a34..864266b5a90 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -589,9 +589,10 @@ public: static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event *description_event); /* print*() functions are used by mysqlbinlog */ - virtual void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0) = 0; + virtual void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0) = 0; void print_timestamp(FILE* file, time_t *ts = 0); - void print_header(FILE* file); + void print_header(FILE* file, my_off_t start_pos= 0); #endif static void *operator new(size_t size) @@ -751,8 +752,11 @@ public: uint32 q_len_arg); #endif /* HAVE_REPLICATION */ #else - void print_query_header(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print_query_header(FILE* file, bool short_form= 0, + my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Query_log_event(const char* buf, uint event_len, @@ -806,7 +810,8 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Slave_log_event(const char* buf, uint event_len); @@ -894,8 +899,10 @@ public: bool use_rli_only_for_errors); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info = 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool commented); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info = 0); + void print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info, bool commented); #endif /* @@ -984,7 +991,8 @@ public: #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Start_log_event_v3(const char* buf, @@ -1079,7 +1087,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Intvar_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1120,7 +1129,8 @@ class Rand_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Rand_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1157,7 +1167,8 @@ class Xid_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Xid_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1199,7 +1210,8 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif User_var_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1225,7 +1237,8 @@ public: {} int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Stop_log_event(const char* buf, const Format_description_log_event* description_event): @@ -1264,7 +1277,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Rotate_log_event(const char* buf, uint event_len, @@ -1317,8 +1331,10 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Create_file_log_event(const char* buf, uint event_len, @@ -1385,7 +1401,8 @@ public: virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Append_block_log_event(const char* buf, uint event_len, @@ -1420,8 +1437,10 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Delete_file_log_event(const char* buf, uint event_len, @@ -1456,7 +1475,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); #endif Execute_load_log_event(const char* buf, uint event_len, @@ -1541,11 +1561,11 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, LAST_EVENT_INFO* last_event_info= 0); /* Prints the query as LOAD DATA LOCAL and with rewritten filename */ - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, - const char *local_fname); + void print(FILE* file, bool short_form, my_off_t start_pos, + LAST_EVENT_INFO* last_event_info, const char *local_fname); #endif Execute_load_query_log_event(const char* buf, uint event_len, const Format_description_log_event *description_event); @@ -1574,7 +1594,8 @@ public: Log_event(buf, description_event) {} ~Unknown_log_event() {} - void print(FILE* file, bool short_form= 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + LAST_EVENT_INFO* last_event_info= 0); Log_event_type get_type_code() { return UNKNOWN_EVENT;} bool is_valid() const { return 1; } }; From 613a494c47845aaeae7784eb148b5ddc2bd2bc99 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Thu, 29 Sep 2005 17:30:15 +0200 Subject: [PATCH 017/322] Updated result after manual merge of sp.test. --- mysql-test/r/sp.result | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index dea04dfdfdf..1791cd385f4 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3386,6 +3386,51 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| +drop procedure if exists bug12589_1| +drop procedure if exists bug12589_2| +drop procedure if exists bug12589_3| +create procedure bug12589_1() +begin +declare spv1 decimal(3,3); +set spv1= 123.456; +set spv1 = 'test'; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_2() +begin +declare spv1 decimal(6,3); +set spv1= 123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_3() +begin +declare spv1 decimal(6,3); +set spv1= -123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +call bug12589_1()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(1,0) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'test' +call bug12589_2()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +call bug12589_3()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table if exists t3| drop procedure if exists bug7049_1| drop procedure if exists bug7049_2| From bf19d02b276d9b06abc81a7c6a93ca160a4f21f5 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Fri, 30 Sep 2005 00:12:14 +0200 Subject: [PATCH 018/322] mysqlbinlog --hexdump additional patch 2 - Fixes related to Guilhems review - Special printing of event header --- client/mysqlbinlog.cc | 10 ++- sql/log_event.cc | 153 ++++++++++++++++++++++-------------------- sql/log_event.h | 46 ++++++------- 3 files changed, 109 insertions(+), 100 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 577ae82eebd..d78b6ca4412 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -525,7 +525,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, fprintf(result_file, "# at %s\n",llstr(pos,ll_buff)); /* Set pos to 0 if hexdump is disabled */ - pos= (opt_hexdump ? pos : 0); + if (!opt_hexdump) pos= 0; switch (ev_type) { case QUERY_EVENT: @@ -674,8 +674,9 @@ static struct my_option my_long_options[] = 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"hexdump", 'H', "Augment output with hexadecimal and ascii data dump.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.", + (gptr*) &opt_hexdump, (gptr*) &opt_hexdump, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"host", 'h', "Get the binlog from server.", (gptr*) &host, (gptr*) &host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset, @@ -855,9 +856,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'd': one_database = 1; break; - case 'H': - opt_hexdump= 1; - break; case 'p': if (argument) { diff --git a/sql/log_event.cc b/sql/log_event.cc index 631a4627f3a..c704e81007a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -24,8 +24,6 @@ #include "mysql_priv.h" #include "slave.h" #include -#else -#include /* For isalnum() */ #endif /* MYSQL_CLIENT */ #define log_cs &my_charset_latin1 @@ -883,53 +881,66 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, Log_event::print_header() */ -void Log_event::print_header(FILE* file, my_off_t start_pos) +void Log_event::print_header(FILE* file, my_off_t hexdump_from) { char llbuff[22]; fputc('#', file); print_timestamp(file); fprintf(file, " server id %d end_log_pos %s ", server_id, - llstr(log_pos,llbuff)); + llstr(log_pos,llbuff)); - if (start_pos) + /* mysqlbinlog --hexdump */ + if (hexdump_from) { fprintf(file, "\n"); - unsigned char *ptr= (unsigned char*)temp_buf; + uchar *ptr= (uchar*)temp_buf; + my_off_t size= + uint4korr(ptr + EVENT_LEN_OFFSET) - LOG_EVENT_MINIMAL_HEADER_LEN; my_off_t i; - char position[8+1] = {0}; - char b[3+1] = {0}; - char hex_string[16*3+1+1] = {0}; - char char_string[16+1] = {0}; + /* Header len * 4 >= header len * (2 chars + space + extra space) */ + char *h, hex_string[LOG_EVENT_MINIMAL_HEADER_LEN*4]= {0}; + char *c, char_string[16+1]= {0}; - for (i= 0; i < (log_pos-start_pos); i++, ptr++) + /* Common header of event */ + fprintf(file, "# Position Timestamp Type Master ID " + "Size Master Pos Flags \n"); + fprintf(file, "# %8.8lx %02x %02x %02x %02x %02x " + "%02x %02x %02x %02x %02x %02x %02x %02x " + "%02x %02x %02x %02x %02x %02x\n", + hexdump_from, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], + ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], + ptr[12], ptr[13], ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]); + ptr += LOG_EVENT_MINIMAL_HEADER_LEN; + hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN; + + /* Rest of event (without common header) */ + for (i= 0, c= char_string, h=hex_string; + i < size; + i++, ptr++) { - if (i % 16 == 0) - snprintf(position, sizeof(position), "%.8x", - (unsigned int) (start_pos+i)); + my_snprintf(h, 4, "%02x ", *ptr); + h += 3; - snprintf(b, sizeof(b), "%02X ", *ptr); - strncat(hex_string, b, sizeof(hex_string)-strlen(hex_string)-1); - - snprintf(b, sizeof(b), "%c", isalnum(*ptr) ? *ptr : '.'); - strncat(char_string, b, sizeof(char_string)-strlen(char_string)-1); + *c++= my_isalnum(&my_charset_bin, *ptr) ? *ptr : '.'; if (i % 16 == 15) { - fprintf(file, "# %8.8s %-48.48s |%16s|\n", - position, hex_string, char_string); - hex_string[0] = 0; - char_string[0] = 0; - } - else if (i % 8 == 7) - { - /* Middle space */ - strncat(hex_string, " ", sizeof(hex_string)-strlen(hex_string)-1); + fprintf(file, "# %8.8lx %-48.48s |%16s|\n", + hexdump_from + (i & 0xfffffff0), hex_string, char_string); + hex_string[0]= 0; + char_string[0]= 0; + c= char_string; + h= hex_string; } + else if (i % 8 == 7) *h++ = ' '; } + *c= '\0'; - if (strlen(hex_string)) { - printf("# %8.8s %-48.48s |%s|\n# ", position, hex_string, char_string); + /* Non-full last line */ + if (hex_string[0]) { + printf("# %8.8lx %-48.48s |%s|\n# ", + hexdump_from + (i & 0xfffffff0), hex_string, char_string); } } } @@ -1418,7 +1429,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, #ifdef MYSQL_CLIENT void Query_log_event::print_query_header(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { // TODO: print the catalog ?? @@ -1428,7 +1439,7 @@ void Query_log_event::print_query_header(FILE* file, bool short_form, if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n", get_type_str(), (ulong) thread_id, (ulong) exec_time, error_code); } @@ -1549,10 +1560,10 @@ void Query_log_event::print_query_header(FILE* file, bool short_form, } -void Query_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Query_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { - print_query_header(file, short_form, start_pos, last_event_info); + print_query_header(file, short_form, hexdump_from, last_event_info); my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME)); fputs(";\n", file); } @@ -1850,12 +1861,12 @@ void Start_log_event_v3::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Start_log_event_v3::print(FILE* file, bool short_form, my_off_t start_pos, +void Start_log_event_v3::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tStart: binlog v %d, server v %s created ", binlog_version, server_version); print_timestamp(file); @@ -2579,20 +2590,20 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, */ #ifdef MYSQL_CLIENT -void Load_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Load_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, start_pos, last_event_info, 0); + print(file, short_form, hexdump_from, last_event_info, 0); } -void Load_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Load_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, bool commented) { DBUG_ENTER("Load_log_event::print"); if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tQuery\tthread_id=%ld\texec_time=%ld\n", thread_id, exec_time); } @@ -2997,14 +3008,14 @@ void Rotate_log_event::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Rotate_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Rotate_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { char buf[22]; if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tRotate to "); if (new_log_ident) my_fwrite(file, (byte*) new_log_ident, (uint)ident_len, @@ -3200,7 +3211,7 @@ bool Intvar_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Intvar_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Intvar_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; @@ -3209,7 +3220,7 @@ void Intvar_log_event::print(FILE* file, bool short_form, my_off_t start_pos, if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tIntvar\n"); } @@ -3290,13 +3301,13 @@ bool Rand_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Rand_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Rand_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { char llbuff[22],llbuff2[22]; if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tRand\n"); } fprintf(file, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s;\n", @@ -3361,7 +3372,7 @@ bool Xid_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Xid_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Xid_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (!short_form) @@ -3369,7 +3380,7 @@ void Xid_log_event::print(FILE* file, bool short_form, my_off_t start_pos, char buf[64]; longlong10_to_str(xid, buf, 10); - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tXid = %s\n", buf); fflush(file); } @@ -3560,12 +3571,12 @@ bool User_var_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void User_var_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void User_var_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (!short_form) { - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tUser_var\n"); } @@ -3736,12 +3747,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) #ifdef HAVE_REPLICATION #ifdef MYSQL_CLIENT -void Unknown_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Unknown_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fputc('\n', file); fprintf(file, "# %s", "Unknown event\n"); } @@ -3808,13 +3819,13 @@ Slave_log_event::~Slave_log_event() #ifdef MYSQL_CLIENT -void Slave_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Slave_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fputc('\n', file); fprintf(file, "\ Slave: master_host: '%s' master_port: %d master_log: '%s' master_pos: %s\n", @@ -3894,13 +3905,13 @@ int Slave_log_event::exec_event(struct st_relay_log_info* rli) */ #ifdef MYSQL_CLIENT -void Stop_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Stop_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fprintf(file, "\tStop\n"); fflush(file); } @@ -4074,19 +4085,19 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len, */ #ifdef MYSQL_CLIENT -void Create_file_log_event::print(FILE* file, bool short_form, my_off_t start_pos, +void Create_file_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, bool enable_local) { if (short_form) { if (enable_local && check_fname_outside_temp_buf()) - Load_log_event::print(file, 1, start_pos, last_event_info); + Load_log_event::print(file, 1, hexdump_from, last_event_info); return; } if (enable_local) { - Load_log_event::print(file, short_form, start_pos, last_event_info, + Load_log_event::print(file, short_form, hexdump_from, last_event_info, !check_fname_outside_temp_buf()); /* That one is for "file_id: etc" below: in mysqlbinlog we want the #, in @@ -4100,10 +4111,10 @@ void Create_file_log_event::print(FILE* file, bool short_form, my_off_t start_po void Create_file_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, start_pos, last_event_info, 0); + print(file, short_form, hexdump_from, last_event_info, 0); } #endif /* MYSQL_CLIENT */ @@ -4264,12 +4275,12 @@ bool Append_block_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Append_block_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fputc('\n', file); fprintf(file, "#%s: file_id: %d block_len: %d\n", get_type_str(), file_id, block_len); @@ -4409,12 +4420,12 @@ bool Delete_file_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Delete_file_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fputc('\n', file); fprintf(file, "#Delete_file: file_id=%u\n", file_id); } @@ -4506,12 +4517,12 @@ bool Execute_load_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT void Execute_load_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { if (short_form) return; - print_header(file, start_pos); + print_header(file, hexdump_from); fputc('\n', file); fprintf(file, "#Exec_load: file_id=%d\n", file_id); @@ -4719,19 +4730,19 @@ Execute_load_query_log_event::write_post_header_for_derived(IO_CACHE* file) #ifdef MYSQL_CLIENT void Execute_load_query_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, start_pos, last_event_info, 0); + print(file, short_form, hexdump_from, last_event_info, 0); } void Execute_load_query_log_event::print(FILE* file, bool short_form, - my_off_t start_pos, + my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, const char *local_fname) { - print_query_header(file, short_form, start_pos, last_event_info); + print_query_header(file, short_form, hexdump_from, last_event_info); if (local_fname) { diff --git a/sql/log_event.h b/sql/log_event.h index 864266b5a90..9351e9b1148 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -589,10 +589,10 @@ public: static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event *description_event); /* print*() functions are used by mysqlbinlog */ - virtual void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + virtual void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0) = 0; void print_timestamp(FILE* file, time_t *ts = 0); - void print_header(FILE* file, my_off_t start_pos= 0); + void print_header(FILE* file, my_off_t hexdump_from= 0); #endif static void *operator new(size_t size) @@ -753,9 +753,9 @@ public: #endif /* HAVE_REPLICATION */ #else void print_query_header(FILE* file, bool short_form= 0, - my_off_t start_pos= 0, + my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -810,7 +810,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -899,9 +899,9 @@ public: bool use_rli_only_for_errors); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info = 0); - void print(FILE* file, bool short_form, my_off_t start_pos, + void print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, bool commented); #endif @@ -991,7 +991,7 @@ public: #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1087,7 +1087,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1129,7 +1129,7 @@ class Rand_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1167,7 +1167,7 @@ class Xid_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1210,7 +1210,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1237,7 +1237,7 @@ public: {} int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1277,7 +1277,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1331,9 +1331,9 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, my_off_t start_pos, + void print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif @@ -1401,7 +1401,7 @@ public: virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1437,9 +1437,9 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, my_off_t start_pos, + void print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif @@ -1475,7 +1475,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); #endif @@ -1561,10 +1561,10 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); /* Prints the query as LOAD DATA LOCAL and with rewritten filename */ - void print(FILE* file, bool short_form, my_off_t start_pos, + void print(FILE* file, bool short_form, my_off_t hexdump_from, LAST_EVENT_INFO* last_event_info, const char *local_fname); #endif Execute_load_query_log_event(const char* buf, uint event_len, @@ -1594,7 +1594,7 @@ public: Log_event(buf, description_event) {} ~Unknown_log_event() {} - void print(FILE* file, bool short_form= 0, my_off_t start_pos= 0, + void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, LAST_EVENT_INFO* last_event_info= 0); Log_event_type get_type_code() { return UNKNOWN_EVENT;} bool is_valid() const { return 1; } From e9f2f9437a9c7be83db93d3461ce6e77245d1df4 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Fri, 30 Sep 2005 15:21:37 +0400 Subject: [PATCH 019/322] BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMIT optimization: now can use index to find records to update/delete when there is no WHERE clause. --- mysql-test/r/update.result | 59 +++++++++++++++++++++ mysql-test/t/update.test | 29 ++++++++++ sql/mysql_priv.h | 2 + sql/opt_range.cc | 88 +++++++++++++++++++++++++++++++ sql/opt_range.h | 2 + sql/records.cc | 105 ++++++++++++++++++++++++++++++++++++- sql/sql_delete.cc | 48 +++++++++++------ sql/sql_update.cc | 32 ++++++++--- sql/structs.h | 1 + 9 files changed, 343 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index d6c1118f90c..cf07487febc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -263,3 +263,62 @@ test delete from t1 where count(*)=1; ERROR HY000: Invalid use of group function drop table t1; +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); +flush status; +select a from t1 order by a limit 1; +a +0 +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +alter table t1 disable keys; +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +select count(*) from t1; +count(*) +5 +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 84e9ced2017..a37655b15fe 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -227,4 +227,33 @@ select DATABASE(); delete from t1 where count(*)=1; drop table t1; +# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); + +flush status; +select a from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; + +alter table t1 disable keys; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +select count(*) from t1; + +drop table t1; # End of 4.1 tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 32c5861028e..5961d57e83f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1105,6 +1105,8 @@ void change_byte(byte *,uint,char,char); void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form, SQL_SELECT *select, int use_record_cache, bool print_errors); +void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, + bool print_error, uint idx); void end_read_record(READ_RECORD *info); ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder, uint s_length, SQL_SELECT *select, diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 5cb330100f8..29994c14d3e 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -582,6 +582,94 @@ SEL_ARG *SEL_ARG::clone_tree() return root; } + +/* + Find an index that allows to retrieve first #limit records in the given + order cheaper then one would retrieve them using full table scan. + + SYNOPSIS + get_index_for_order() + table Table to be accessed + order Required ordering + limit Number of records that will be retrieved + + DESCRIPTION + Run through all table indexes and find the shortest index that allows + records to be retrieved in given order. If there is such index and + reading first #limit records from it is cheaper then scanning the entire + table, return it. + + This function is used only by UPDATE/DELETE, so we take into account how + the UPDATE/DELETE code will work: + * index can only be scanned in forward direction + * HA_EXTRA_KEYREAD will not be used + Perhaps these assumptions could be relaxed + + RETURN + index number + MAX_KEY if no such index was found. +*/ + +uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit) +{ + uint idx; + uint match_key= MAX_KEY, match_key_len= MAX_KEY_LENGTH + 1; + ORDER *ord; + + for (ord= order; ord; ord= ord->next) + if (!ord->asc) + return MAX_KEY; + + for (idx= 0; idx < table->keys; idx++) + { + if (!(table->keys_in_use_for_query.is_set(idx))) + continue; + KEY_PART_INFO *keyinfo= table->key_info[idx].key_part; + uint partno= 0; + + /* + The below check is sufficient considering we now have either BTREE + indexes (records are returned in order for any index prefix) or HASH + indexes (records are not returned in order for any index prefix). + */ + if (!(table->file->index_flags(idx, 0, 1) & HA_READ_ORDER)) + continue; + for (ord= order; ord; ord= ord->next, partno++) + { + Item *item= order->item[0]; + if (!(item->type() == Item::FIELD_ITEM && + ((Item_field*)item)->field->eq(keyinfo[partno].field))) + break; + } + + if (!ord && table->key_info[idx].key_length < match_key_len) + { + /* + Ok, the ordering is compatible and this key is shorter then + previous match (we want shorter keys as we'll have to read fewer + index pages for the same number of records) + */ + match_key= idx; + match_key_len= table->key_info[idx].key_length; + } + } + + if (match_key != MAX_KEY) + { + /* + Found an index that allows records to be retrieved in the requested + order. Now we'll check if using the index is cheaper then doing a table + scan. + */ + double full_scan_time= table->file->scan_time(); + double index_scan_time= table->file->read_time(match_key, 1, limit); + if (index_scan_time > full_scan_time) + match_key= MAX_KEY; + } + return match_key; +} + + /* Test if a key can be used in different ranges diff --git a/sql/opt_range.h b/sql/opt_range.h index 87e0315a09e..15f0bf02b34 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -167,4 +167,6 @@ public: QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, struct st_table_ref *ref); +uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit); + #endif diff --git a/sql/records.cc b/sql/records.cc index e5a0d102b10..1bf585ae46a 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -29,7 +29,59 @@ static int rr_from_cache(READ_RECORD *info); static int init_rr_cache(READ_RECORD *info); static int rr_cmp(uchar *a,uchar *b); - /* init struct for read with info->read_record */ +static int rr_index(READ_RECORD *info); + + + +/* + Initialize READ_RECORD structure to perform full index scan + + SYNOPSIS + init_read_record_idx() + info READ_RECORD structure to initialize. + thd Thread handle + table Table to be accessed + print_error If true, call table->file->print_error() if an error + occurs (except for end-of-records error) + idx index to scan + + DESCRIPTION + Initialize READ_RECORD structure to perform full index scan (in forward + direction) using read_record.read_record() interface. + + This function has been added at late stage and is used only by + UPDATE/DELETE. Other statements perform index scans using + join_read_first/next functions. +*/ + +void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, + bool print_error, uint idx) +{ + bzero((char*) info,sizeof(*info)); + info->thd=thd; + info->table=table; + info->file= table->file; + info->forms= &info->table; /* Only one table */ + + info->record= table->record[0]; + info->ref_length= table->file->ref_length; + + info->select=NULL; + info->print_error=print_error; + info->ignore_not_found_rows= 0; + table->status=0; /* And it's always found */ + + if (!table->file->inited) + { + table->file->ha_index_init(idx); + table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY); + } + info->read_record= rr_index; + info->first= TRUE; +} + + +/* init struct for read with info->read_record */ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, SQL_SELECT *select, @@ -182,6 +234,57 @@ static int rr_quick(READ_RECORD *info) } +/* + Read next index record. The calling convention of this function is + compatible with READ_RECORD::read_record. + + SYNOPSIS + rr_index() + info Scan info + + RETURN + 0 Ok + -1 End of records + 1 Error +*/ + +static int rr_index(READ_RECORD *info) +{ + int tmp; + while (1) + { + if (info->first) + { + info->first= FALSE; + tmp= info->file->index_first(info->record); + } + else + tmp= info->file->index_next(info->record); + + if (!tmp) + break; + if (info->thd->killed) + { + my_error(ER_SERVER_SHUTDOWN,MYF(0)); + return 1; + } + if (tmp != HA_ERR_RECORD_DELETED) + { + if (tmp == HA_ERR_END_OF_FILE) + tmp= -1; + else + { + if (info->print_error) + info->table->file->print_error(tmp,MYF(0)); + if (tmp < 0) // Fix negative BDB errno + tmp=1; + } + break; + } + } + return tmp; +} + static int rr_sequential(READ_RECORD *info) { int tmp; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 1dd52a2ba74..079a301818c 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -37,6 +37,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, bool using_limit=limit != HA_POS_ERROR; bool transactional_table, log_delayed, safe_update, const_cond; ha_rows deleted; + uint usable_index= MAX_KEY; DBUG_ENTER("mysql_delete"); if ((open_and_lock_tables(thd, table_list))) @@ -119,30 +120,47 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, tables.table = table; tables.alias = table_list->alias; - table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), - MYF(MY_FAE | MY_ZEROFILL)); if (thd->lex->select_lex.setup_ref_array(thd, order->elements) || setup_order(thd, thd->lex->select_lex.ref_pointer_array, &tables, - fields, all_fields, (ORDER*) order->first) || - !(sortorder=make_unireg_sortorder((ORDER*) order->first, &length)) || - (table->sort.found_records = filesort(thd, table, sortorder, length, - select, HA_POS_ERROR, - &examined_rows)) - == HA_POS_ERROR) + fields, all_fields, (ORDER*) order->first)) { delete select; free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(-1); // This will force out message } - /* - Filesort has already found and selected the rows we want to delete, - so we don't need the where clause - */ - delete select; - select= 0; + + if (!select && limit != HA_POS_ERROR) + usable_index= get_index_for_order(table, (ORDER*)(order->first), limit); + + if (usable_index == MAX_KEY) + { + table->sort.io_cache= (IO_CACHE *) my_malloc(sizeof(IO_CACHE), + MYF(MY_FAE | MY_ZEROFILL)); + + if ( !(sortorder=make_unireg_sortorder((ORDER*) order->first, &length)) || + (table->sort.found_records = filesort(thd, table, sortorder, length, + select, HA_POS_ERROR, + &examined_rows)) + == HA_POS_ERROR) + { + delete select; + free_underlaid_joins(thd, &thd->lex->select_lex); + DBUG_RETURN(-1); // This will force out message + } + /* + Filesort has already found and selected the rows we want to delete, + so we don't need the where clause + */ + delete select; + select= 0; + } } - init_read_record(&info,thd,table,select,1,1); + if (usable_index==MAX_KEY) + init_read_record(&info,thd,table,select,1,1); + else + init_read_record_idx(&info, thd, table, 1, usable_index); + deleted=0L; init_ftfuncs(thd, &thd->lex->select_lex, 1); thd->proc_info="updating"; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 2857bce09ed..712f2acd526 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -61,7 +61,8 @@ int mysql_update(THD *thd, bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table, log_delayed; int error=0; - uint used_index; + uint used_index= MAX_KEY; + bool need_sort= TRUE; #ifndef NO_EMBEDDED_ACCESS_CHECKS uint want_privilege; #endif @@ -145,6 +146,11 @@ int mysql_update(THD *thd, send_ok(thd); // No matching records DBUG_RETURN(0); } + if (!select && limit != HA_POS_ERROR) + { + if (MAX_KEY != (used_index= get_index_for_order(table, order, limit))) + need_sort= FALSE; + } /* If running in safe sql mode, don't allow updates without keys */ if (table->quick_keys.is_clear_all()) { @@ -157,6 +163,7 @@ int mysql_update(THD *thd, } } init_ftfuncs(thd, &thd->lex->select_lex, 1); + /* Check if we are modifying a key that we are used to search with */ if (select && select->quick) { @@ -164,13 +171,15 @@ int mysql_update(THD *thd, used_key_is_modified= (!select->quick->unique_key_range() && check_if_key_used(table, used_index, fields)); } + else if (used_index != MAX_KEY) + { + used_key_is_modified= check_if_key_used(table, used_index, fields); + } else if ((used_index=table->file->key_used_on_scan) < MAX_KEY) used_key_is_modified=check_if_key_used(table, used_index, fields); else - { used_key_is_modified=0; - used_index= MAX_KEY; - } + if (used_key_is_modified || order) { /* @@ -181,10 +190,11 @@ int mysql_update(THD *thd, if (used_index < MAX_KEY && old_used_keys.is_set(used_index)) { table->key_read=1; - table->file->extra(HA_EXTRA_KEYREAD); + table->file->extra(HA_EXTRA_KEYREAD); //todo: psergey: check } - if (order) + /* note: can actually avoid sorting below.. */ + if (order && need_sort) { /* Doing an ORDER BY; Let filesort find and sort the rows we are going @@ -225,7 +235,11 @@ int mysql_update(THD *thd, DISK_BUFFER_SIZE, MYF(MY_WME))) goto err; - init_read_record(&info,thd,table,select,0,1); + if (used_index == MAX_KEY) + init_read_record(&info,thd,table,select,0,1); + else + init_read_record_idx(&info, thd, table, 1, used_index); + thd->proc_info="Searching rows for update"; uint tmp_limit= limit; @@ -251,6 +265,10 @@ int mysql_update(THD *thd, error= 1; // Aborted limit= tmp_limit; end_read_record(&info); + + /* if we got here we must not use index in the main update loop below */ + used_index= MAX_KEY; + /* Change select to use tempfile */ if (select) { diff --git a/sql/structs.h b/sql/structs.h index 081ada88bf7..4a88a17cdd0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -132,6 +132,7 @@ typedef struct st_read_record { /* Parameter to read_record */ byte *cache,*cache_pos,*cache_end,*read_positions; IO_CACHE *io_cache; bool print_error, ignore_not_found_rows; + bool first; /* used only with rr_index_read */ } READ_RECORD; From 7d0d7826bb8d715f935d954d3bba8ad863a0ebbc Mon Sep 17 00:00:00 2001 From: "SergeyV@selena." <> Date: Mon, 3 Oct 2005 20:34:42 +0400 Subject: [PATCH 020/322] Fixes bug #13377. Added code to close active log files in case of log reset condition. --- sql/log.cc | 67 ++++++++++++++++++++++++++++++++++++++++++++++++- sql/slave.cc | 17 +++++++++++++ sql/sql_class.h | 8 +++++- sql/sql_repl.cc | 37 +++++++++++++++++++++++---- 4 files changed, 122 insertions(+), 7 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 6e372938752..d5a5eecf36b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -353,7 +353,7 @@ MYSQL_LOG::MYSQL_LOG() :bytes_written(0), last_time(0), query_start(0), name(0), file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0), inited(0), need_start_event(1), prepared_xids(0), description_event_for_exec(0), - description_event_for_queue(0) + description_event_for_queue(0), readers_count(0), reset_pending(false) { /* We don't want to initialize LOCK_Log here as such initialization depends on @@ -379,7 +379,9 @@ void MYSQL_LOG::cleanup() delete description_event_for_exec; (void) pthread_mutex_destroy(&LOCK_log); (void) pthread_mutex_destroy(&LOCK_index); + (void) pthread_mutex_destroy(&LOCK_readers); (void) pthread_cond_destroy(&update_cond); + (void) pthread_cond_destroy(&reset_cond); } DBUG_VOID_RETURN; } @@ -424,7 +426,9 @@ void MYSQL_LOG::init_pthread_objects() inited= 1; (void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_readers, MY_MUTEX_INIT_SLOW); (void) pthread_cond_init(&update_cond, 0); + (void) pthread_cond_init(&reset_cond, 0); } const char *MYSQL_LOG::generate_name(const char *log_name, @@ -927,6 +931,13 @@ bool MYSQL_LOG::reset_logs(THD* thd) */ pthread_mutex_lock(&LOCK_log); pthread_mutex_lock(&LOCK_index); + + /* + we need one more lock to block attempts to open a log while + we are waiting untill all log files will be closed + */ + pthread_mutex_lock(&LOCK_readers); + /* The following mutex is needed to ensure that no threads call 'delete thd' as we would then risk missing a 'rollback' from this @@ -949,6 +960,19 @@ bool MYSQL_LOG::reset_logs(THD* thd) goto err; } + reset_pending = true; + /* + send update signal just in case so that all reader threads waiting + for log update will leave wait condition + */ + signal_update(); + /* + if there are active readers wait until all of them will + release opened files + */ + if (readers_count) + pthread_cond_wait(&reset_cond, &LOCK_log); + for (;;) { my_delete(linfo.log_file_name, MYF(MY_WME)); @@ -967,7 +991,10 @@ bool MYSQL_LOG::reset_logs(THD* thd) my_free((gptr) save_name, MYF(0)); err: + reset_pending = false; + (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_readers); pthread_mutex_unlock(&LOCK_index); pthread_mutex_unlock(&LOCK_log); DBUG_RETURN(error); @@ -2038,6 +2065,10 @@ void MYSQL_LOG::wait_for_update(THD* thd, bool is_slave) { const char *old_msg; DBUG_ENTER("wait_for_update"); + + if (reset_pending) + DBUG_VOID_RETURN; + old_msg= thd->enter_cond(&update_cond, &LOCK_log, is_slave ? "Has read all relay log; waiting for the slave I/O " @@ -2288,6 +2319,40 @@ void MYSQL_LOG::signal_update() DBUG_VOID_RETURN; } +void MYSQL_LOG::readers_addref() +{ + /* + currently readers_addref and readers_release are necessary + only for __WIN__ build to wait untill readers will close + opened log files before reset. + There is no necessity for this on *nix, since it allows to + delete opened files, however it is more clean way to wait + untill all files will be closed on *nix as well. + If decided, the following #ifdef section is to be removed. + */ +#ifdef __WIN__ + DBUG_ENTER("MYSQL_LOG::reader_addref"); + pthread_mutex_lock(&LOCK_log); + pthread_mutex_lock(&LOCK_readers); + readers_count++; + pthread_mutex_unlock(&LOCK_readers); + pthread_mutex_unlock(&LOCK_log); + DBUG_VOID_RETURN; +#endif +} + +void MYSQL_LOG::readers_release() +{ +#ifdef __WIN__ + DBUG_ENTER("MYSQL_LOG::reader_release"); + pthread_mutex_lock(&LOCK_log); + readers_count--; + if (!readers_count) + pthread_cond_broadcast(&reset_cond); + pthread_mutex_unlock(&LOCK_log); + DBUG_VOID_RETURN; +#endif +} #ifdef __NT__ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, diff --git a/sql/slave.cc b/sql/slave.cc index 092fb40d9d9..0fd9393ed3a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3615,6 +3615,15 @@ err: pthread_mutex_lock(&mi->run_lock); mi->slave_running = 0; mi->io_thd = 0; + + /* Close log file and free buffers */ + if (mi->rli.cur_log_fd >= 0) + { + end_io_cache(&mi->rli.cache_buf); + my_close(mi->rli.cur_log_fd, MYF(MY_WME)); + mi->rli.cur_log_fd= -1; + } + /* Forget the relay log's format */ delete mi->rli.relay_log.description_event_for_queue; mi->rli.relay_log.description_event_for_queue= 0; @@ -3831,6 +3840,14 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ rli->cached_charset_invalidate(); rli->save_temporary_tables = thd->temporary_tables; + /* Close log file and free buffers if it's already open */ + if (rli->cur_log_fd >= 0) + { + end_io_cache(&rli->cache_buf); + my_close(rli->cur_log_fd, MYF(MY_WME)); + rli->cur_log_fd = -1; + } + /* TODO: see if we can do this conditionally in next_event() instead to avoid unneeded position re-init diff --git a/sql/sql_class.h b/sql/sql_class.h index 7cbfc19123f..903b786d21d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -189,8 +189,11 @@ class MYSQL_LOG: public TC_LOG { private: /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ - pthread_mutex_t LOCK_log, LOCK_index; + pthread_mutex_t LOCK_log, LOCK_index, LOCK_readers; pthread_cond_t update_cond; + pthread_cond_t reset_cond; + bool reset_pending; + int readers_count; ulonglong bytes_written; time_t last_time,query_start; IO_CACHE log_file; @@ -334,6 +337,9 @@ public: int purge_logs_before_date(time_t purge_time); int purge_first_log(struct st_relay_log_info* rli, bool included); bool reset_logs(THD* thd); + inline bool is_reset_pending() { return reset_pending; } + void readers_addref(); + void readers_release(); void close(uint exiting); // iterating through the log index file diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 98f47d13eee..b5865fa8816 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -372,6 +372,11 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, goto err; } + /* + Call readers_addref before opening log to track count + of binlog readers + */ + mysql_bin_log.readers_addref(); if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0) { my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; @@ -569,7 +574,8 @@ impossible position"; goto err; if (!(flags & BINLOG_DUMP_NON_BLOCK) && - mysql_bin_log.is_active(log_file_name)) + mysql_bin_log.is_active(log_file_name) && + !mysql_bin_log.is_reset_pending()) { /* Block until there is more data in the log @@ -683,6 +689,13 @@ impossible position"; { bool loop_breaker = 0; // need this to break out of the for loop from switch + + // if we are going to switch log file anyway, close current log first + end_io_cache(&log); + (void) my_close(file, MYF(MY_WME)); + // decrease reference count of binlog readers + mysql_bin_log.readers_release(); + thd->proc_info = "Finished reading one binlog; switching to next binlog"; switch (mysql_bin_log.find_next_log(&linfo, 1)) { case LOG_INFO_EOF: @@ -691,16 +704,25 @@ impossible position"; case 0: break; default: + // need following call to do release on err label + mysql_bin_log.readers_addref(); errmsg = "could not find next log"; my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; goto err; } - if (loop_breaker) - break; + if (loop_breaker) + { + // need following call to do release on end label + mysql_bin_log.readers_addref(); + break; + } - end_io_cache(&log); - (void) my_close(file, MYF(MY_WME)); + /* + Call readers_addref before opening log to track count + of binlog readers + */ + mysql_bin_log.readers_addref(); /* Call fake_rotate_event() in case the previous log (the one which @@ -733,6 +755,8 @@ end: end_io_cache(&log); (void)my_close(file, MYF(MY_WME)); + // decrease reference count of binlog readers + mysql_bin_log.readers_release(); send_eof(thd); thd->proc_info = "Waiting to finalize termination"; @@ -759,6 +783,9 @@ err: pthread_mutex_unlock(&LOCK_thread_count); if (file >= 0) (void) my_close(file, MYF(MY_WME)); + // decrease reference count of binlog readers + mysql_bin_log.readers_release(); + my_message(my_errno, errmsg, MYF(0)); DBUG_VOID_RETURN; } From 5a10244d8b024745b65341d4a4f09ba50621635a Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Mon, 3 Oct 2005 23:22:46 +0400 Subject: [PATCH 021/322] Fix bug#13535 Incorrect result from SELECT statement after SHOW TABLE STATUS After SHOW TABLE STATUS last_insert_id wasn't cleaned, and next select erroneously rewrites WHERE condition and returs a row; 5.0 isn't affected because of different SHOW TABLE STATUS handling. last_insert_id cleanup added to mysqld_extend_show_tables(). --- mysql-test/r/select.result | 10 ++++++++++ mysql-test/t/select.test | 10 ++++++++++ sql/sql_show.cc | 12 +++++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 64cbaf4fa67..8477fa88887 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2626,3 +2626,13 @@ f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL +t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index bdadd5c536b..d158932beb1 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2174,4 +2174,14 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); drop table t1,t2; +# +# Bug #13535 +# +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X +show table status like 't1%'; +select 123 as a from t1 where f1 is null; +drop table t1,t11; # End of 4.1 tests diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e619b148f3a..d6ceca5f23c 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -462,6 +462,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) TABLE *table; Protocol *protocol= thd->protocol; TIME time; + int res= 0; DBUG_ENTER("mysqld_extend_show_tables"); (void) sprintf(path,"%s/%s",mysql_data_home,db); @@ -632,10 +633,15 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) close_thread_tables(thd,0); } if (protocol->write()) - DBUG_RETURN(-1); + { + res= -1; + break; + } } - send_eof(thd); - DBUG_RETURN(0); + thd->insert_id(0); + if (!res) + send_eof(thd); + DBUG_RETURN(res); } From cb96f195c8ec86236b1673adc0db5d32e08bd957 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 4 Oct 2005 15:43:55 +0200 Subject: [PATCH 022/322] Improved testing of ssl and compression - Added show status variable "compression" for checking that compression is turned on. - Updated show status variable "have_openssl" to be set to DISABLED if server supports ssl but it's not turned on to accept incoming ssl connections. - Setup server to accept ssl connections from clients ig that is supported by server - New tests - ssl - Run with ssl turned on - ssl_compress - Run with ssl and compression turned on - compress - Run with compression turned in - Updated test - openssl_1, rpl_openssl1 - Changed to run if server supports ssl --- client/mysqltest.c | 12 + mysql-test/include/have_openssl_1.inc | 4 - mysql-test/mysql-test-run.pl | 123 +- mysql-test/r/compress.result | 2948 ++++++++++++++++++++++++ mysql-test/r/have_openssl_1.require | 2 - mysql-test/r/openssl_1.result | 12 + mysql-test/r/ssl.result | 2948 ++++++++++++++++++++++++ mysql-test/r/ssl_compress.result | 2951 +++++++++++++++++++++++++ mysql-test/t/compress.test | 19 + mysql-test/t/openssl_1.test | 11 +- mysql-test/t/rpl_openssl.test | 2 +- mysql-test/t/ssl.test | 21 + mysql-test/t/ssl_compress.test | 25 + sql-common/client.c | 5 +- sql/mysqld.cc | 10 + sql/sql_show.cc | 5 + sql/structs.h | 3 + 17 files changed, 9069 insertions(+), 32 deletions(-) delete mode 100644 mysql-test/include/have_openssl_1.inc create mode 100644 mysql-test/r/compress.result delete mode 100644 mysql-test/r/have_openssl_1.require create mode 100644 mysql-test/r/ssl.result create mode 100644 mysql-test/r/ssl_compress.result create mode 100644 mysql-test/t/compress.test create mode 100644 mysql-test/t/ssl.test create mode 100644 mysql-test/t/ssl_compress.test diff --git a/client/mysqltest.c b/client/mysqltest.c index 0cad29bd8de..bcdba237b0d 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -309,6 +309,8 @@ Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, Q_EXEC, Q_DELIMITER, Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, +Q_DISABLE_SSL, Q_ENABLE_SSL, +Q_DISABLE_COMPRESS, Q_ENABLE_COMPRESS, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, @@ -395,6 +397,10 @@ const char *command_names[]= "delimiter", "disable_abort_on_error", "enable_abort_on_error", + "disable_ssl", + "enable_ssl", + "disable_compress", + "enable_compress", "vertical_results", "horizontal_results", "query_vertical", @@ -4047,6 +4053,12 @@ int main(int argc, char **argv) case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break; case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break; +#ifdef HAVE_OPENSSL + case Q_ENABLE_SSL: opt_use_ssl=1; break; + case Q_DISABLE_SSL: opt_use_ssl=0; break; +#endif + case Q_ENABLE_COMPRESS: opt_compress=1; break; + case Q_DISABLE_COMPRESS: opt_compress=0; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc deleted file mode 100644 index 887309c7e23..00000000000 --- a/mysql-test/include/have_openssl_1.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/have_openssl_1.require -disable_query_log; -SHOW STATUS LIKE 'Ssl_cipher'; -enable_query_log; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 651aa37fc7e..833b7515c59 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -188,6 +188,12 @@ our $opt_big_test= 0; # Send --big-test to mysqltest our @opt_extra_mysqld_opt; our $opt_compress; +our $opt_ssl; +our $opt_skip_ssl; +our $opt_ssl_supported; +our $opt_with_openssl; # Deprecated flag +our $opt_ps_protocol; + our $opt_current_test; our $opt_ddd; our $opt_debug; @@ -237,7 +243,6 @@ our $opt_skip_rpl; our $opt_skip_test; our $opt_sleep; -our $opt_ps_protocol; our $opt_sleep_time_after_restart= 1; our $opt_sleep_time_for_delete= 10; @@ -275,7 +280,6 @@ our $opt_udiff; our $opt_skip_ndbcluster; our $opt_with_ndbcluster; -our $opt_with_openssl; our $exe_ndb_mgm; our $path_ndb_tools_dir; @@ -296,7 +300,8 @@ sub executable_setup (); sub environment_setup (); sub kill_running_server (); sub kill_and_cleanup (); -sub ndbcluster_support (); +sub check_ssl_support (); +sub check_ndbcluster_support (); sub ndbcluster_install (); sub ndbcluster_start (); sub ndbcluster_stop (); @@ -331,11 +336,9 @@ sub main () { initial_setup(); command_line_setup(); executable_setup(); - - if (! $opt_skip_ndbcluster and ! $opt_with_ndbcluster) - { - $opt_with_ndbcluster= ndbcluster_support(); - } + + check_ndbcluster_support(); + check_ssl_support(); environment_setup(); signal_setup(); @@ -477,6 +480,10 @@ sub command_line_setup () { # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, + 'with-openssl' => \$opt_with_openssl, + 'ssl' => \$opt_ssl, + 'skip-ssl' => \$opt_skip_ssl, + 'compress' => \$opt_compress, 'bench' => \$opt_bench, 'small-bench' => \$opt_small_bench, 'no-manager' => \$opt_no_manager, # Currently not used @@ -527,7 +534,6 @@ sub command_line_setup () { # Misc 'big-test' => \$opt_big_test, - 'compress' => \$opt_compress, 'debug' => \$opt_debug, 'fast' => \$opt_fast, 'local' => \$opt_local, @@ -552,7 +558,6 @@ sub command_line_setup () { 'testcase-timeout=i' => \$opt_testcase_timeout, 'suite-timeout=i' => \$opt_suite_timeout, 'warnings|log-warnings' => \$opt_warnings, - 'with-openssl' => \$opt_with_openssl, 'help|h' => \$opt_usage, ) or usage("Can't read options"); @@ -1094,13 +1099,66 @@ sub kill_and_cleanup () { } +sub check_ssl_support () { + + + # Convert deprecated --with-openssl to --ssl + if ( $opt_with_openssl ) + { + $opt_ssl= 1; + } + + if ($opt_skip_ssl) + { + mtr_report("Skipping SSL"); + $opt_ssl_supported= 0; + $opt_ssl= 0; + return; + } + + # check ssl support by testing using a switch + # that is only available in that case + if ( mtr_run($exe_mysqld, + ["--no-defaults", + "--ssl", + "--help"], + "", "/dev/null", "/dev/null", "") != 0 ) + { + if ( $opt_ssl) + { + mtr_error("Couldn't find support for SSL"); + return; + } + mtr_report("Skipping SSL, mysqld does not support it"); + $opt_ssl_supported= 0; + $opt_ssl= 0; + return; + } + mtr_report("Setting mysqld to support SSL connections"); + $opt_ssl_supported= 1; +} + + ############################################################################## # # Start the ndb cluster # ############################################################################## -sub ndbcluster_support () { +sub check_ndbcluster_support () { + + if ($opt_skip_ndbcluster) + { + mtr_report("Skipping ndbcluster"); + $opt_with_ndbcluster= 0; + return; + } + + if ($opt_with_ndbcluster) + { + mtr_report("Using ndbcluster"); + return; + } # check ndbcluster support by testing using a switch # that is only available in that case @@ -1110,11 +1168,13 @@ sub ndbcluster_support () { "--help"], "", "/dev/null", "/dev/null", "") != 0 ) { - mtr_report("No ndbcluster support"); - return 0; + mtr_report("Skipping ndbcluster, mysqld does not support it"); + $opt_with_ndbcluster= 0; + return; } - mtr_report("Has ndbcluster support"); - return 1; + mtr_report("Using ndbcluster, mysqld supports it"); + $opt_with_ndbcluster= 1; + return; } # FIXME why is there a different start below?! @@ -2003,7 +2063,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix); - if ( $opt_with_openssl ) + if ( $opt_ssl_supported ) { mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix, $glob_mysql_test_dir); @@ -2468,14 +2528,26 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir); } - if ( $opt_with_openssl ) + if ( $opt_ssl_supported ) { mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); + } + + # Turn on SSL for all test cases + if ( $opt_ssl ) + { + mtr_add_arg($args, "--ssl", + $glob_mysql_test_dir); + } + elsif ( $opt_ssl_supported ) + { + mtr_add_arg($args, "--skip-ssl", + $glob_mysql_test_dir); } mtr_add_arg($args, "-R"); @@ -2515,6 +2587,9 @@ Options to control what engine/variation to run embedded-server Use the embedded server, i.e. no mysqld daemons ps-protocol Use the binary protocol between client and server + compress Use the compressed protocol between client and server + ssl Use ssl protocol between client and server + skip-ssl Dont start sterver with support for ssl connections bench Run the benchmark suite FIXME small-bench FIXME @@ -2522,6 +2597,7 @@ Options to control what test suites or cases to run force Continue to run the suite after failure with-ndbcluster Use cluster, and enable test cases that requres it + skip-ndb[cluster] Use cluster, and enable test cases that requres it do-test=PREFIX Run test cases which name are prefixed with PREFIX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" @@ -2545,7 +2621,7 @@ Options that pass on options Options to run test on running server extern Use running server for tests FIXME DANGEROUS - ndbconnectstring=STR Use running cluster, and connect using STR + ndbconnectstring=STR Use running cluster, and connect using STR user=USER User for connect to server Options for debugging the product @@ -2570,7 +2646,6 @@ Misc options verbose Verbose output from this script script-debug Debug this script itself - compress Use the compressed protocol between client and server timer Show test case execution time start-and-exit Only initiate and start the "mysqld" servers, use the startup settings for the specified test case if any @@ -2583,6 +2658,9 @@ Misc options testcase-timeout=MINUTES Max test case run time (default 5) suite-timeout=MINUTES Max test suite run time (default 120) +Deprecated options + with-openssl Deprecated option for ssl + Options not yet described, or that I want to look into more @@ -2599,7 +2677,6 @@ Options not yet described, or that I want to look into more wait-timeout=SECONDS warnings log-warnings - with-openssl HERE mtr_exit(1); diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result new file mode 100644 index 00000000000..a86fb4e4745 --- /dev/null +++ b/mysql-test/r/compress.result @@ -0,0 +1,2948 @@ +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: 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 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require deleted file mode 100644 index b33a1d2854f..00000000000 --- a/mysql-test/r/have_openssl_1.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 035c84431f8..77f2d5495a9 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -6,21 +6,33 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result new file mode 100644 index 00000000000..5c8a7e91c71 --- /dev/null +++ b/mysql-test/r/ssl.result @@ -0,0 +1,2948 @@ +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: 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 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result new file mode 100644 index 00000000000..574726640d4 --- /dev/null +++ b/mysql-test/r/ssl_compress.result @@ -0,0 +1,2951 @@ +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: 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 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test new file mode 100644 index 00000000000..45b9ab9dd1e --- /dev/null +++ b/mysql-test/t/compress.test @@ -0,0 +1,19 @@ +# Turn on compression between the client and server +# and run a number of tests + +-- source include/have_compress.inc + +enable_compress; + +# Reconnect to turn compress on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check compression turned on +SHOW STATUS LIKE 'Compression'; + +# Source select test case +-- source t/select.test + +disable_compress; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index e04c77ddf45..e9487425dd7 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -1,6 +1,6 @@ # We test openssl. Result set is optimized to be compiled with --with-openssl. # Use mysql-test-run with --with-openssl option. --- source include/have_openssl_1.inc +-- source include/have_openssl.inc --disable_warnings drop table if exists t1; @@ -13,27 +13,36 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; +enable_ssl; connect (con1,localhost,ssl_user1,,); connect (con2,localhost,ssl_user2,,); connect (con3,localhost,ssl_user3,,); connect (con4,localhost,ssl_user4,,); connection con1; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con2; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con3; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con4; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test index 3c151721d8e..e15eb9b179a 100644 --- a/mysql-test/t/rpl_openssl.test +++ b/mysql-test/t/rpl_openssl.test @@ -1,4 +1,4 @@ -source include/have_openssl_1.inc; +source include/have_openssl.inc; source include/master-slave.inc; # We don't test all types of ssl auth params here since it's a bit hard diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test new file mode 100644 index 00000000000..d13bec60c2b --- /dev/null +++ b/mysql-test/t/ssl.test @@ -0,0 +1,21 @@ +# Turn on ssl between the client and server +# and run a number of tests + +-- source include/have_openssl.inc + +enable_ssl; + +# Reconnect to turn ssl on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Source select test case +-- source t/select.test + +disable_ssl; + + diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test new file mode 100644 index 00000000000..4a0d3a254ff --- /dev/null +++ b/mysql-test/t/ssl_compress.test @@ -0,0 +1,25 @@ +# Turn on compression between the client and server +# and run a number of tests + +-- source include/have_openssl.inc +-- source include/have_compress.inc + +enable_compress; +enable_ssl; + +# Reconnect to turn ssl and compress on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Check compression turned on +SHOW STATUS LIKE 'Compression'; + +# Source select test case +-- source t/select.test + +disable_compress; +disable_ssl; diff --git a/sql-common/client.c b/sql-common/client.c index 08ad906e2b6..cc90b2a105a 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1474,6 +1474,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , const char *capath __attribute__((unused)), const char *cipher __attribute__((unused))) { + DBUG_ENTER("mysql_ssl_set"); #ifdef HAVE_OPENSSL mysql->options.ssl_key= strdup_if_not_null(key); mysql->options.ssl_cert= strdup_if_not_null(cert); @@ -1481,7 +1482,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , mysql->options.ssl_capath= strdup_if_not_null(capath); mysql->options.ssl_cipher= strdup_if_not_null(cipher); #endif /* HAVE_OPENSSL */ - return 0; + DBUG_RETURN(0); } @@ -1494,6 +1495,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , static void mysql_ssl_free(MYSQL *mysql __attribute__((unused))) { + DBUG_ENTER("mysql_ssl_free"); my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); @@ -1507,6 +1509,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused))) mysql->options.ssl_cipher= 0; mysql->options.use_ssl = FALSE; mysql->connector_fd = 0; + DBUG_VOID_RETURN; } #endif /* HAVE_OPENSSL */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a28ae38c675..f9d7ee4e739 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2765,7 +2765,14 @@ static void init_ssl() opt_ssl_cipher); DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd)); if (!ssl_acceptor_fd) + { opt_use_ssl = 0; + have_openssl= SHOW_OPTION_DISABLED; + } + } + else + { + have_openssl= SHOW_OPTION_DISABLED; } if (des_key_file) load_des_key_file(des_key_file); @@ -5851,6 +5858,9 @@ struct show_var_st status_vars[]= { {"Com_xa_recover", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_RECOVER]),SHOW_LONG_STATUS}, {"Com_xa_rollback", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_ROLLBACK]),SHOW_LONG_STATUS}, {"Com_xa_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_START]),SHOW_LONG_STATUS}, +#ifdef HAVE_COMPRESS + {"Compression", (char*) 0, SHOW_NET_COMPRESSION}, +#endif /* HAVE_COMPRESS */ {"Connections", (char*) &thread_id, SHOW_LONG_CONST}, {"Created_tmp_disk_tables", (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS}, {"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG}, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 929bf36d305..4b3242cbe12 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1632,6 +1632,11 @@ static bool show_status_array(THD *thd, const char *wild, value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache; end= longlong10_to_str(*(longlong*) value, buff, 10); break; +#ifdef HAVE_COMPRESS + case SHOW_NET_COMPRESSION: + end= strmov(buff, thd->net.compress ? "ON" : "OFF"); + break; +#endif /* HAVE_COMPRESS */ case SHOW_UNDEF: // Show never happen case SHOW_SYS: break; // Return empty string diff --git a/sql/structs.h b/sql/structs.h index e490a2de60c..52d80b3d0c0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -185,6 +185,9 @@ enum SHOW_TYPE SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL, SHOW_SSL_GET_CIPHER_LIST, #endif /* HAVE_OPENSSL */ +#ifdef HAVE_COMPRESS + SHOW_NET_COMPRESSION, +#endif /* HAVE_COMPRESS */ SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS From e6043231ea7be2e5a7f72eac5e8e66593825768e Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Tue, 4 Oct 2005 22:24:04 +0200 Subject: [PATCH 023/322] Importing BUILD/compile-pentium64-valgrind-max from 5.0 (unchanged), and speeding up 'bk citool' for me --- BUILD/compile-pentium64-valgrind-max | 29 ++++++++++++++++++++++++++++ BitKeeper/etc/config | 1 + 2 files changed, 30 insertions(+) create mode 100755 BUILD/compile-pentium64-valgrind-max diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max new file mode 100755 index 00000000000..2e4ff8e0082 --- /dev/null +++ b/BUILD/compile-pentium64-valgrind-max @@ -0,0 +1,29 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs" + +# We want to test isam when building with valgrind +extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-raid --with-ndbcluster" + +. "$path/FINISH.sh" + +if test -z "$just_print" +then + set +v +x + echo "\ +****************************************************************************** +Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with +--enable-assembler. When Valgrind detects an error involving an assembly +function (for example an uninitialized value used as an argument of an +assembly function), Valgrind will not print the stacktrace and 'valgrind +--gdb-attach=yes' will not work either. If you need a stacktrace in those +cases, you have to run BUILD/compile-pentium-valgrind-max with the +--disable-assembler argument. +******************************************************************************" +fi diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config index af93117a517..5fa877c5e3a 100644 --- a/BitKeeper/etc/config +++ b/BitKeeper/etc/config @@ -72,5 +72,6 @@ hours: [nick:]checkout:get [jonas:]checkout:get [tomas:]checkout:get +[guilhem:]checkout:get checkout:edit eoln:unix From 8a291efb75b32865c1f6b0510ab2d983feda413d Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 5 Oct 2005 12:21:53 +0200 Subject: [PATCH 024/322] The "exit" command of mysqltest is quite useful when writing tests for 4.1 so I'm porting it from 5.0 to 4.1. --- client/mysqltest.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 19a44b0f24c..35408368a73 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -294,6 +294,7 @@ Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, +Q_EXIT, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, Q_IF, @@ -381,6 +382,7 @@ const char *command_names[]= "character_set", "disable_ps_protocol", "enable_ps_protocol", + "exit", "disable_reconnect", "enable_reconnect", "if", @@ -3744,7 +3746,7 @@ int main(int argc, char **argv) { int error = 0; struct st_query *q; - my_bool require_file=0, q_send_flag=0, query_executed= 0; + my_bool require_file=0, q_send_flag=0, query_executed= 0, abort_flag= 0; char save_file[FN_REFLEN]; MY_STAT res_info; MY_INIT(argv[0]); @@ -3825,7 +3827,7 @@ int main(int argc, char **argv) */ var_set_errno(-1); - while (!read_query(&q)) + while (!abort_flag && !read_query(&q)) { int current_line_inc = 1, processed = 0; if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND) @@ -4028,6 +4030,9 @@ int main(int argc, char **argv) case Q_ENABLE_RECONNECT: cur_con->mysql.reconnect= 1; break; + case Q_EXIT: + abort_flag= 1; + break; default: processed = 0; break; } From 0c75bbbc41b53cf9697f2903bce6f89803f9f558 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 5 Oct 2005 17:45:23 +0500 Subject: [PATCH 025/322] item_cmpfunc.cc: sorry, another wrong variable --- sql/item_cmpfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 7f50e5d0163..2c76c7ec7b3 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2460,7 +2460,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref) code instead of Unicode code as "escape" argument. Convert to "cs" if charset of escape differs. */ - CHARSET_INFO *cs= cmp_collation.collation; + CHARSET_INFO *cs= cmp.cmp_collation.collation; uint32 unused; if (escape_str->needs_conversion(escape_str->length(), escape_str->charset(), cs, &unused)) From 593192770840cb99db689d01bb440709d0a1cbda Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 5 Oct 2005 19:20:49 +0500 Subject: [PATCH 026/322] Bug#12476 Some big5 codes are still missing. ctype-big5.c: Adding extra cp950 characters into Unicode mapping. ctype_big5.result, ctype_big5.test: Adding test case --- mysql-test/r/ctype_big5.result | 19 +++++++++++++++++++ mysql-test/t/ctype_big5.test | 15 +++++++++++++++ strings/ctype-big5.c | 21 +++++++++++---------- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index a31289775fe..4c5832a57e9 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -170,3 +170,22 @@ SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE HEX(a) A741ADCCA66EB6DC20A7DAADCCABDCA66E DROP TABLE t1; +set names big5; +create table t1 (a char character set big5); +insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9); +insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC); +select hex(a) a, hex(@u:=convert(a using utf8)) b, +hex(convert(@u using big5)) c from t1 order by a; +a b c +F9D6 E7A281 F9D6 +F9D7 E98AB9 F9D7 +F9D8 E8A38F F9D8 +F9D9 E5A2BB F9D9 +F9DA E68192 F9DA +F9DB E7B2A7 F9DB +F9DC E5ABBA F9DC +alter table t1 convert to character set utf8; +select hex(a) from t1 where a = _big5 0xF9DC; +hex(a) +E5ABBA +drop table t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index 1788dce755b..ffe2a12234e 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -38,4 +38,19 @@ INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E); SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE); DROP TABLE t1; +# +# Bug#12476 Some big5 codes are still missing. +# +set names big5; +create table t1 (a char character set big5); +insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9); +insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC); +# Check round trip +select hex(a) a, hex(@u:=convert(a using utf8)) b, +hex(convert(@u using big5)) c from t1 order by a; +# Check that there is no "illegal mix of collations" error with Unicode. +alter table t1 convert to character set utf8; +select hex(a) from t1 where a = _big5 0xF9DC; +drop table t1; + # End of 4.1 tests diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 08b0ff009ee..e15554fa576 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -1695,7 +1695,7 @@ static uint16 tab_big5_uni0[]={ 0x2467,0x2468,0x2469,0x2474,0x2475,0x2476,0x2477,0x2478, 0x2479,0x247A,0x247B,0x247C,0x247D}; -/* page 1 0xC940-0xF9D5 */ +/* page 1 0xC940-0xF9DC */ static uint16 tab_big5_uni1[]={ 0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,0x4E47, 0x4E8D,0x56D7,0xFA0C,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E, @@ -3251,12 +3251,13 @@ static uint16 tab_big5_uni1[]={ 0x9E17,0x9F48,0x6207,0x6B1E,0x7227,0x864C,0x8EA8,0x9482, 0x9480,0x9481,0x9A69,0x9A68,0x9B2E,0x9E19,0x7229,0x864B, 0x8B9F,0x9483,0x9C79,0x9EB7,0x7675,0x9A6B,0x9C7A,0x9E1D, -0x7069,0x706A,0x9EA4,0x9F7E,0x9F49,0x9F98}; +0x7069,0x706A,0x9EA4,0x9F7E,0x9F49,0x9F98,0x7881,0x92B9, +0x88CF,0x58BB,0x6052,0x7CA7,0x5AFA}; static int func_big5_uni_onechar(int code){ if ((code>=0xA140)&&(code<=0xC7FC)) return(tab_big5_uni0[code-0xA140]); - if ((code>=0xC940)&&(code<=0xF9D5)) + if ((code>=0xC940)&&(code<=0xF9DC)) return(tab_big5_uni1[code-0xC940]); return(0); } @@ -3885,7 +3886,7 @@ static uint16 tab_uni_big57[]={ 0xE54D,0xE552, 0,0xE54E, 0,0xE551,0xBC5C, 0, 0xBEA5,0xBC5B, 0,0xE54A,0xE550, 0,0xBC5A,0xE54F, 0,0xE54C, 0,0xBC58, 0, 0, 0, 0, - 0, 0,0xE94D, 0,0xE94F,0xE94A,0xBEC1,0xE94C, + 0, 0,0xE94D,0xF9D9,0xE94F,0xE94A,0xBEC1,0xE94C, 0,0xBEC0,0xE94E, 0, 0,0xBEC3,0xE950,0xBEC2, 0xE949,0xE94B, 0, 0, 0, 0,0xC0A5,0xECCC, 0,0xC0A4,0xECCD,0xC0A3,0xECCB,0xC0A2,0xECCA, 0, @@ -3957,7 +3958,7 @@ static uint16 tab_uni_big57[]={ 0xE175,0xB9DE,0xE174,0xB9E4, 0,0xE16D,0xB9DF, 0, 0xE17B,0xB9E0,0xE16F,0xE172,0xE177,0xE171,0xE16C, 0, 0, 0, 0,0xE173,0xE555,0xBC61,0xE558,0xE557, -0xE55A,0xE55C, 0,0xBC5F, 0,0xE556, 0,0xE554, +0xE55A,0xE55C,0xF9DC,0xBC5F, 0,0xE556, 0,0xE554, 0,0xE55D,0xE55B,0xE559, 0,0xE55F, 0,0xE55E, 0xBC63,0xBC5E, 0,0xBC60,0xBC62, 0, 0,0xE560, 0xE957, 0, 0,0xE956,0xE955, 0,0xE958,0xE951, @@ -4128,7 +4129,7 @@ static uint16 tab_uni_big57[]={ 0,0xCEC0, 0, 0, 0, 0, 0, 0, 0xCECA,0xD1A1,0xCECB,0xABEE,0xCECE,0xCEC4,0xABED,0xCEC6, 0,0xCEC7, 0, 0,0xCEC9,0xABE9, 0, 0, -0xAEA3, 0, 0,0xCEC5,0xCEC1,0xAEA4, 0, 0, +0xAEA3, 0,0xF9DA,0xCEC5,0xCEC1,0xAEA4, 0, 0, 0xCECF,0xAE7E,0xD17D,0xCEC8, 0,0xD17C,0xCEC3,0xCECC, 0, 0,0xABEC,0xAEA1,0xABF2,0xAEA2,0xCED0,0xD17E, 0xABEB,0xAEA6,0xABF1,0xABF0,0xABEF,0xAEA5,0xCED1,0xAEA7, @@ -4902,7 +4903,7 @@ static uint16 tab_uni_big57[]={ 0xDACF,0xDACE,0xDACB,0xB2B8,0xB577,0xDAC9,0xDACC,0xB578, 0xDACD,0xDACA, 0, 0, 0, 0, 0, 0, 0,0xDEEE, 0,0xDEF2,0xB84E, 0,0xE2F0,0xB851, -0xDEF0, 0, 0,0xDEED,0xDEE8,0xDEEA,0xDEEB,0xDEE4, +0xDEF0,0xF9D6, 0,0xDEED,0xDEE8,0xDEEA,0xDEEB,0xDEE4, 0,0xB84D, 0, 0,0xB84C, 0,0xB848,0xDEE7, 0,0xB84F, 0,0xB850,0xDEE6,0xDEE9,0xDEF1,0xB84A, 0xB84B,0xDEEF,0xDEE5, 0, 0, 0,0xE2F2,0xBAD0, @@ -5034,7 +5035,7 @@ static uint16 tab_uni_big57[]={ 0xD34D,0xAFBB,0xD34B, 0,0xD34C,0xD34E, 0, 0, 0,0xD34A,0xB2C9, 0,0xD6DE,0xB2CB,0xD6E0,0xB2CA, 0xD6DF, 0, 0, 0, 0, 0,0xDAE8,0xB5AF, - 0,0xDAEA,0xDAE7,0xD6E1, 0,0xB5B0, 0, 0, + 0,0xDAEA,0xDAE7,0xD6E1, 0,0xB5B0, 0,0xF9DB, 0xDAE9, 0, 0, 0, 0, 0, 0,0xDF56, 0,0xB864,0xDF54,0xB865,0xDF55,0xB866, 0, 0, 0,0xBAE9,0xE361,0xE35E,0xE360,0xBAEA,0xBAEB,0xE35F, @@ -5423,7 +5424,7 @@ static uint16 tab_uni_big57[]={ 0,0xB5F6,0xDBCD, 0, 0, 0,0xDBC9,0xDBCB, 0xDBC6,0xDBC5,0xDBC3, 0,0xDBCA,0xDBCC,0xDBC8, 0, 0xDBC7,0xB5F4,0xB5F5, 0, 0, 0, 0, 0, - 0,0xDBCF,0xB8CD,0xDFF2,0xDFF8,0xDFF3,0xDFF4, 0, + 0,0xDBCF,0xB8CD,0xDFF2,0xDFF8,0xDFF3,0xDFF4,0xF9D8, 0xDFF9, 0,0xB8CF, 0,0xB8C7,0xB8CE,0xDFF1,0xDBC4, 0xB8CA,0xB8C8,0xDFF7,0xDFF6,0xB8C9,0xB8CB,0xDFF5,0xB8C6, 0,0xB8CC, 0, 0, 0, 0, 0,0xE3F6, @@ -5741,7 +5742,7 @@ static uint16 tab_uni_big57[]={ 0xE47B,0xE4AF,0xE4AC,0xE4A7,0xE477,0xE476,0xE4A1,0xE4B4, 0xBBCF,0xE4B7,0xE47D,0xE4A3,0xBE52, 0, 0, 0, 0, 0,0xBE5A,0xBE55,0xE8A4,0xE8A1,0xE867,0xBE50, - 0, 0, 0,0xBE4F,0xBE56, 0, 0, 0, + 0,0xF9D7, 0,0xBE4F,0xBE56, 0, 0, 0, 0xE865,0xBE54,0xE871,0xE863,0xE864,0xBE4E,0xE8A3,0xBE58, 0xE874,0xE879,0xE873,0xEBEE,0xE86F,0xE877,0xE875,0xE868, 0xE862,0xE87D,0xBE57,0xE87E, 0,0xE878, 0,0xE86D, From 5640d19432952604e29952ee0fbbce85749e3568 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Wed, 5 Oct 2005 16:39:37 +0200 Subject: [PATCH 027/322] Fixed BUG#13616: "CALL ." executes properly, but displays error When returning to the old database (which may be ""), don't do access check - mysql_change_db() would then generate the error "No database selected". Note: No test case added; it seems a db is always selected when running tests. --- sql/sp_head.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 671acbc2a0c..95e050a5ac7 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1051,8 +1051,10 @@ int sp_head::execute(THD *thd) original thd->db will then have been freed */ if (dbchanged) { + /* No access check when changing back to where we came from. + (It would generate an error from mysql_change_db() when olddb=="") */ if (! thd->killed) - ret= mysql_change_db(thd, olddb, 0); + ret= mysql_change_db(thd, olddb, 1); } m_flags&= ~IS_INVOKED; DBUG_RETURN(ret); From 78e828d32f4c94a7135b7ddcf749ddc9e5bd0d3d Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 6 Oct 2005 17:54:43 +0300 Subject: [PATCH 028/322] Review of code pushed since last 5.0 pull: Ensure that ccache is also used for C programs mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter Fixed test cases by adding missing DROP's and rename views to be of type 'v#' Removed MY_UNIX_PATH from fn_format() Removed current_db_used from TABLE_LIST Removed usage of 'current_thd' in Item_splocal Removed some compiler warnings A bit faster longlong2str code --- BUILD/FINISH.sh | 2 +- BUILD/SETUP.sh | 4 + client/mysql.cc | 76 +++++++---- client/mysqldump.c | 59 +++++---- client/mysqltest.c | 8 +- include/my_sys.h | 1 - mysql-test/r/alter_table.result | 10 +- mysql-test/r/func_str.result | 3 + mysql-test/r/information_schema.result | 23 ++-- mysql-test/r/information_schema_inno.result | 2 +- mysql-test/r/multi_statement.result | 1 + mysql-test/r/mysql.result | 1 + mysql-test/r/mysqldump.result | 70 +++++----- mysql-test/r/mysqlshow.result | 1 + mysql-test/r/temp_table.result | 29 +++-- mysql-test/t/alter_table.test | 10 +- mysql-test/t/func_str.test | 1 + mysql-test/t/information_schema.test | 11 +- mysql-test/t/information_schema_inno.test | 2 +- mysql-test/t/multi_statement.test | 4 + mysql-test/t/mysql.test | 2 +- mysql-test/t/mysqlshow.test | 4 + mysql-test/t/temp_table.test | 25 ++-- mysys/mf_format.c | 16 +-- sql/ha_federated.cc | 1 - sql/item.cc | 46 +++---- sql/item.h | 15 +-- sql/item_func.cc | 25 ++-- sql/log_event.cc | 5 +- sql/opt_range.cc | 10 +- sql/sp_head.cc | 1 + sql/sql_class.cc | 14 +- sql/sql_parse.cc | 18 +-- sql/sql_prepare.cc | 100 +++++++------- sql/structs.h | 2 +- sql/table.cc | 3 +- sql/table.h | 2 - strings/decimal.c | 2 +- strings/longlong2str-x86.s | 137 ++++++++++---------- strings/my_strtoll10.c | 4 +- 40 files changed, 384 insertions(+), 366 deletions(-) diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index 8cd78bf4165..2fc8015ea28 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -14,7 +14,7 @@ path=`dirname $0` if [ -z "$just_clean" ] then commands="$commands -CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \ +CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \ $configure" fi diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 1603cfadbed..b9d96cf10b1 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -98,6 +98,10 @@ else make=make fi +if test -z "$CC" ; then + CC=gcc +fi + if test -z "$CXX" ; then CXX=gcc fi diff --git a/client/mysql.cc b/client/mysql.cc index f4361f77f4c..8a3e669c51d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -320,7 +320,7 @@ static void initialize_readline (char *name); static void fix_history(String *final_command); #endif -static COMMANDS *find_command (char *name,char cmd_name); +static COMMANDS *find_command(char *name,char cmd_name); static bool add_line(String &buffer,char *line,char *in_string, bool *ml_comment); static void remove_cntrl(String &buffer); @@ -1085,10 +1085,12 @@ static int read_and_execute(bool interactive) } -static COMMANDS *find_command (char *name,char cmd_char) +static COMMANDS *find_command(char *name,char cmd_char) { uint len; char *end; + DBUG_ENTER("find_command"); + DBUG_PRINT("enter",("name: '%s' char: %d", name ? name : "NULL", cmd_char)); if (!name) { @@ -1100,12 +1102,16 @@ static COMMANDS *find_command (char *name,char cmd_char) while (my_isspace(charset_info,*name)) name++; /* - As special case we allow row that starts with word delimiter - to be able to change delimiter if someone has delimiter 'delimiter'. + If there is an \\g in the row or if the row has a delimiter but + this is not a delimiter command, let add_line() take care of + parsing the row and calling find_command() */ if (strstr(name, "\\g") || (strstr(name, delimiter) && - strncmp(name, "delimiter", 9))) - return ((COMMANDS *) 0); + strlen(name) >= 9 && + my_strnncoll(charset_info,(uchar*) name, + 9, + (const uchar*) "delimiter", 9))) + DBUG_RETURN((COMMANDS *) 0); if ((end=strcont(name," \t"))) { len=(uint) (end - name); @@ -1121,15 +1127,18 @@ static COMMANDS *find_command (char *name,char cmd_char) for (uint i= 0; commands[i].name; i++) { if (commands[i].func && - ((name && + ((name && !my_strnncoll(charset_info,(uchar*)name,len, (uchar*)commands[i].name,len) && !commands[i].name[len] && (!end || (end && commands[i].takes_params))) || !name && commands[i].cmd_char == cmd_char)) - return (&commands[i]); + { + DBUG_PRINT("exit",("found command: %s", commands[i].name)); + DBUG_RETURN(&commands[i]); + } } - return ((COMMANDS *) 0); + DBUG_RETURN((COMMANDS *) 0); } @@ -1140,15 +1149,16 @@ static bool add_line(String &buffer,char *line,char *in_string, char buff[80], *pos, *out; COMMANDS *com; bool need_space= 0; + DBUG_ENTER("add_line"); if (!line[0] && buffer.is_empty()) - return 0; + DBUG_RETURN(0); #ifdef HAVE_READLINE if (status.add_to_history && line[0] && not_in_history(line)) add_history(line); #endif #ifdef USE_MB - char *strend=line+(uint) strlen(line); + char *end_of_line=line+(uint) strlen(line); #endif for (pos=out=line ; (inchar= (uchar) *pos) ; pos++) @@ -1157,13 +1167,14 @@ static bool add_line(String &buffer,char *line,char *in_string, buffer.is_empty()) continue; #ifdef USE_MB - int l; + int length; if (use_mb(charset_info) && - (l = my_ismbchar(charset_info, pos, strend))) { - while (l--) - *out++ = *pos++; - pos--; - continue; + (length= my_ismbchar(charset_info, pos, end_of_line))) + { + while (length--) + *out++ = *pos++; + pos--; + continue; } #endif if (!*ml_comment && inchar == '\\') @@ -1183,7 +1194,7 @@ static bool add_line(String &buffer,char *line,char *in_string, const String tmp(line,(uint) (out-line), charset_info); buffer.append(tmp); if ((*com->func)(&buffer,pos-1) > 0) - return 1; // Quit + DBUG_RETURN(1); // Quit if (com->takes_params) { for (pos++ ; @@ -1201,29 +1212,40 @@ static bool add_line(String &buffer,char *line,char *in_string, { sprintf(buff,"Unknown command '\\%c'.",inchar); if (put_info(buff,INFO_ERROR) > 0) - return 1; + DBUG_RETURN(1); *out++='\\'; *out++=(char) inchar; continue; } } - - else if (!*ml_comment && (*pos == *delimiter && - is_prefix(pos + 1, delimiter + 1)) && - !*in_string) + else if (!*ml_comment && !*in_string && + (*pos == *delimiter && is_prefix(pos + 1, delimiter + 1) || + buffer.length() == 0 && (out - line) >= 9 && + !my_strcasecmp(charset_info, line, "delimiter"))) { uint old_delimiter_length= delimiter_length; if (out != line) buffer.append(line, (uint) (out - line)); // Add this line if ((com= find_command(buffer.c_ptr(), 0))) { + if (com->func == com_delimiter) + { + /* + Delimiter wants the get rest of the given line as argument to + allow one to change ';' to ';;' and back + */ + char *end= strend(pos); + buffer.append(pos, (uint) (end - pos)); + /* Ensure pos will point at \0 after the pos+= below */ + pos= end - old_delimiter_length + 1; + } if ((*com->func)(&buffer, buffer.c_ptr()) > 0) - return 1; // Quit + DBUG_RETURN(1); // Quit } else { if (com_go(&buffer, 0) > 0) // < 0 is not fatal - return 1; + DBUG_RETURN(1); } buffer.length(0); out= line; @@ -1275,9 +1297,9 @@ static bool add_line(String &buffer,char *line,char *in_string, if (buffer.length() + length >= buffer.alloced_length()) buffer.realloc(buffer.length()+length+IO_SIZE); if (!(*ml_comment) && buffer.append(line,length)) - return 1; + DBUG_RETURN(1); } - return 0; + DBUG_RETURN(0); } /***************************************************************** diff --git a/client/mysqldump.c b/client/mysqldump.c index 322acbd26c0..9cf21230929 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1188,23 +1188,25 @@ static void print_xml_row(FILE *xml_file, const char *row_name, This function has logic to print the appropriate syntax depending on whether this is a procedure or functions - RETURN 0 succes, 1 if error + RETURN + 0 Success + 1 Error */ -static uint dump_routines_for_db (char *db) +static uint dump_routines_for_db(char *db) { char query_buff[512]; - const char *routine_type[]={"FUNCTION", "PROCEDURE"}; - char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3], *routine_name; + const char *routine_type[]= {"FUNCTION", "PROCEDURE"}; + char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3]; + char *routine_name; int i; - FILE *sql_file = md_result_file; + FILE *sql_file= md_result_file; MYSQL_RES *routine_res, *routine_list_res; MYSQL_ROW row, routine_list_row; - DBUG_ENTER("dump_routines_for_db"); + DBUG_PRINT("enter", ("db: '%s'", db)); mysql_real_escape_string(sock, db_name_buff, db, strlen(db)); - DBUG_PRINT("enter", ("db: '%s'", db_name_buff)); /* nice comments */ if (opt_comments) @@ -1217,10 +1219,10 @@ static uint dump_routines_for_db (char *db) if (lock_tables) mysql_query(sock, "LOCK TABLES mysql.proc READ"); - fprintf(sql_file, "DELIMITER //\n"); + fprintf(sql_file, "DELIMITER ;;\n"); /* 0, retrieve and dump functions, 1, procedures */ - for (i=0; i <= 1; i++) + for (i= 0; i <= 1; i++) { my_snprintf(query_buff, sizeof(query_buff), "SHOW %s STATUS WHERE Db = '%s'", @@ -1232,18 +1234,18 @@ static uint dump_routines_for_db (char *db) if (mysql_num_rows(routine_list_res)) { - while((routine_list_row= mysql_fetch_row(routine_list_res))) + while ((routine_list_row= mysql_fetch_row(routine_list_res))) { DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type[i], name_buff)); - routine_name=quote_name(routine_list_row[1], name_buff, 0); + routine_name= quote_name(routine_list_row[1], name_buff, 0); my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE %s %s", routine_type[i], routine_name); if (mysql_query_with_error_report(sock, &routine_res, query_buff)) DBUG_RETURN(1); - while ((row=mysql_fetch_row(routine_res))) + while ((row= mysql_fetch_row(routine_res))) { /* if the user has EXECUTE privilege he see routine names, but NOT the @@ -1254,16 +1256,18 @@ static uint dump_routines_for_db (char *db) if (strlen(row[2])) { if (opt_drop) - fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */ //\n", + fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;;\n", routine_type[i], routine_name); /* - we need to change sql_mode only for the CREATE PROCEDURE/FUNCTION - otherwise we may need to re-quote routine_name + we need to change sql_mode only for the CREATE + PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name */; - fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n", + fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/;;\n", row[1] /* sql_mode */); - fprintf(sql_file, "/*!50003 %s */ //\n", row[2]); - fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //\n"); + fprintf(sql_file, "/*!50003 %s */;;\n", row[2]); + fprintf(sql_file, + "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/" + ";;\n"); } } /* end of routine printing */ } /* end of list of routines */ @@ -1741,7 +1745,6 @@ static void dump_triggers_for_table (char *table, char *db) char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3]; char query_buff[512]; FILE *sql_file = md_result_file; - DBUG_ENTER("dump_triggers_for_table"); DBUG_PRINT("enter", ("db: %s, table: %s", db, table)); result_table= quote_name(table, table_buff, 1); @@ -1759,11 +1762,11 @@ static void dump_triggers_for_table (char *table, char *db) } if (mysql_num_rows(result)) fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\ -DELIMITER //;\n"); +DELIMITER ;;\n"); while ((row=mysql_fetch_row(result))) { - fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\" */ //\n\ -/*!50003 CREATE TRIGGER %s %s %s ON %s FOR EACH ROW%s */ //\n\n", + fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n\ +/*!50003 CREATE TRIGGER %s %s %s ON %s FOR EACH ROW%s */;;\n\n", row[6], /* sql_mode */ quote_name(row[0], name_buff, 0), /* Trigger */ row[4], /* Timing */ @@ -1773,8 +1776,8 @@ DELIMITER //;\n"); } if (mysql_num_rows(result)) fprintf(sql_file, - "DELIMITER ;//\n\ -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;"); + "DELIMITER ;\n" + "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;\n"); mysql_free_result(result); DBUG_VOID_RETURN; } @@ -1800,10 +1803,10 @@ static char *add_load_option(char *ptr,const char *object, /* -** Allow the user to specify field terminator strings like: -** "'", "\", "\\" (escaped backslash), "\t" (tab), "\n" (newline) -** This is done by doubleing ' and add a end -\ if needed to avoid -** syntax errors from the SQL parser. + Allow the user to specify field terminator strings like: + "'", "\", "\\" (escaped backslash), "\t" (tab), "\n" (newline) + This is done by doubling ' and add a end -\ if needed to avoid + syntax errors from the SQL parser. */ static char *field_escape(char *to,const char *from,uint length) diff --git a/client/mysqltest.c b/client/mysqltest.c index 0cad29bd8de..ce7b16fb121 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -135,7 +135,8 @@ typedef struct long code; } st_error; -static st_error global_error[] = { +static st_error global_error[] = +{ #include { 0, 0 } }; @@ -210,7 +211,8 @@ static int ps_match_re(char *); static char *ps_eprint(int); static void ps_free_reg(void); -static const char *embedded_server_groups[] = { +static const char *embedded_server_groups[]= +{ "server", "embedded", "mysqltest_SERVER", @@ -1273,7 +1275,7 @@ int do_modify_var(struct st_query *query, const char *name, if (*p != '$') die("First argument to %s must be a variable (start with $)", name); v= var_get(p, &p, 1, 0); - switch (operator){ + switch (operator) { case DO_DEC: v->int_val--; break; diff --git a/include/my_sys.h b/include/my_sys.h index c46da655fa4..11e8a36f5fa 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -98,7 +98,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_RETURN_REAL_PATH 32 /* return full path for file */ #define MY_SAFE_PATH 64 /* Return NULL if too long path */ #define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */ -#define MY_UNIX_PATH 256 /* convert path to UNIX format */ /* My seek flags */ #define MY_SEEK_SET 0 diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6a710a8de10..2cc56975056 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -541,16 +541,16 @@ create table t1 ( a timestamp ); alter table t1 add unique ( a(1) ); ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys drop table t1; -create database mysqltest1; +create database mysqltest; create table t1 (c1 int); -alter table t1 rename mysqltest1.t1; +alter table t1 rename mysqltest.t1; drop table t1; ERROR 42S02: Unknown table 't1' -alter table mysqltest1.t1 rename t1; +alter table mysqltest.t1 rename t1; drop table t1; create table t1 (c1 int); -use mysqltest1; -drop database mysqltest1; +use mysqltest; +drop database mysqltest; alter table test.t1 rename t1; ERROR 3D000: No database selected alter table test.t1 rename test.t1; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 577f943ebde..b027cb33185 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -818,6 +818,9 @@ lpad(12345, 5, "#") SELECT conv(71, 10, 36), conv('1Z', 36, 10); conv(71, 10, 36) conv('1Z', 36, 10) 1Z 71 +SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10); +conv(71, 10, 37) conv('1Z', 37, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10) +NULL NULL NULL NULL NULL create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb'); create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e2812283901..d7ce6a7a96a 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1,4 +1,5 @@ -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; show variables where variable_name like "skip_show_database"; Variable_name Value skip_show_database OFF @@ -638,8 +639,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -647,29 +648,29 @@ select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select column_name from information_schema.columns where table_schema='test'; column_name f1 Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select index_name from information_schema.statistics where table_schema='test'; index_name f1_key select constraint_name from information_schema.table_constraints where table_schema='test'; constraint_name -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; select * from information_schema.table_names; ERROR 42S02: Unknown table 'table_names' in information_schema diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index 9dd92baf62f..fb6584673f6 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id, id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE, diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 3a8d86bf349..ff19cbdd698 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1; select 1; 1 1 diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index eeb6abd9f41..76faa12373a 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -1,6 +1,7 @@ drop table if exists t1; create table t1(a int); insert into t1 values(1); +ERROR at line 9: DELIMITER must be followed by a 'delimiter' character or string Test default delimiter ; a diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 48e6ded689e..de59ec74135 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1828,31 +1828,32 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; -DELIMITER //; -/*!50003 SET SESSION SQL_MODE="" */ // +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="" */;; /*!50003 CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end */ // +end */;; -/*!50003 SET SESSION SQL_MODE="" */ // +/*!50003 SET SESSION SQL_MODE="" */;; /*!50003 CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin if old.a % 2 = 0 then set new.b := 12; end if; -end */ // +end */;; -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ // +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; /*!50003 CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW begin if new.a = -1 then set @fired:= "Yes"; end if; -end */ // +end */;; -DELIMITER ;// -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;DROP TABLE IF EXISTS `t2`; +DELIMITER ; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -1864,17 +1865,18 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; -DELIMITER //; -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ // +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; /*!50003 CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin if new.a > 10 then set @fired:= "No"; end if; -end */ // +end */;; -DELIMITER ;// +DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; + /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; @@ -2036,37 +2038,37 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; -DELIMITER // -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +DELIMITER ;; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) -RETURN a+b */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +RETURN a+b */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) begin set f1= concat( 'hello', f1 ); return f1; -end */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `a'b` */ // -/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ // +end */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;; +/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/;; /*!50003 CREATE PROCEDURE "a'b"() -select 1 */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +select 1 */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) -BEGIN SELECT a+b INTO c; end */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +BEGIN SELECT a+b INTO c; end */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; -END */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // +END */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result index a04a7081b34..355c20fdad3 100644 --- a/mysql-test/r/mysqlshow.result +++ b/mysql-test/r/mysqlshow.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1),(2),(3); CREATE TABLE t2 (a int, b int); diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 726861bb525..82479504b10 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop view if exists v1; CREATE TABLE t1 (c int not null, d char (10) not null); insert into t1 values(1,""),(2,"a"),(3,"b"); CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); @@ -99,32 +100,32 @@ Variable_name Value Created_tmp_disk_tables 0 Created_tmp_tables 2 drop table t1; -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; A This is temp. table -show create table t1; +show create table v1; Table Create Table -t1 CREATE TEMPORARY TABLE `t1` ( +v1 CREATE TEMPORARY TABLE `v1` ( `A` varchar(19) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -show create view t1; +show create view v1; View Create View -t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select _latin1'This is view' AS `A` -drop view t1; -select * from t1; +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` +drop view v1; +select * from v1; A This is temp. table -create view t1 as select 'This is view again' A; -select * from t1; +create view v1 as select 'This is view again' A; +select * from v1; A This is temp. table -drop table t1; -select * from t1; +drop table v1; +select * from v1; A This is view again -drop view t1; +drop view v1; create table t1 (a int, b int, index(a), index(b)); create table t2 (c int auto_increment, d varchar(255), primary key (c)); insert into t1 values (3,1),(3,2); diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5695822be6b..2e5b68c1dc7 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -373,24 +373,24 @@ drop table t1; # Bug#11493 - Alter table rename to default database does not work without # db name qualifying # -create database mysqltest1; +create database mysqltest; create table t1 (c1 int); # Move table to other database. -alter table t1 rename mysqltest1.t1; +alter table t1 rename mysqltest.t1; # Assure that it has moved. --error 1051 drop table t1; # Move table back. -alter table mysqltest1.t1 rename t1; +alter table mysqltest.t1 rename t1; # Assure that it is back. drop table t1; # Now test for correct message if no database is selected. # Create t1 in 'test'. create table t1 (c1 int); # Change to other db. -use mysqltest1; +use mysqltest; # Drop the current db. This de-selects any db. -drop database mysqltest1; +drop database mysqltest; # Now test for correct message. --error 1046 alter table test.t1 rename t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 4a6c98c8d7f..8b14e674b2e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -467,6 +467,7 @@ SELECT lpad(12345, 5, "#"); # SELECT conv(71, 10, 36), conv('1Z', 36, 10); +SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10); # # Bug in SUBSTRING when mixed with CONCAT and ORDER BY (Bug #3089) diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 51cca0a3db1..f351d315680 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -5,7 +5,8 @@ # show databases --disable_warnings -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; --enable_warnings @@ -364,8 +365,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -378,8 +379,8 @@ where table_schema='test'; select index_name from information_schema.statistics where table_schema='test'; select constraint_name from information_schema.table_constraints where table_schema='test'; -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; # diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index dd7015bfd9a..9cd64a54ad9 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -1,6 +1,6 @@ -- source include/have_innodb.inc --disable_warnings -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; --enable_warnings # diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index eb8d867f3f0..785aa749f5e 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -1,6 +1,10 @@ # PS doesn't support multi-statements --disable_ps_protocol +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + select 1; delimiter ||||; select 2; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index c1d9813ea39..31918cae619 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -14,7 +14,7 @@ create table t1(a int); insert into t1 values(1); # Test delimiters ---exec $MYSQL test < "./t/mysql_delimiter.sql" +--exec $MYSQL test 2>&1 < "./t/mysql_delimiter.sql" --disable_query_log # Test delimiter : supplied on the command line diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test index 33ae8aef9a0..1e2e97a4e07 100644 --- a/mysql-test/t/mysqlshow.test +++ b/mysql-test/t/mysqlshow.test @@ -1,6 +1,10 @@ # Can't run test of external client with embedded server -- source include/not_embedded.inc +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + # ## Bug #5036 mysqlshow is missing a column # diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 9a7678ed712..6b3991c9c78 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -4,6 +4,7 @@ --disable_warnings drop table if exists t1,t2; +drop view if exists v1; --enable_warnings CREATE TABLE t1 (c int not null, d char (10) not null); @@ -91,18 +92,18 @@ show status like "created_tmp%tables"; drop table t1; # Fix for BUG#8921: Check that temporary table is ingored by view commands. -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; -show create table t1; -show create view t1; -drop view t1; -select * from t1; -create view t1 as select 'This is view again' A; -select * from t1; -drop table t1; -select * from t1; -drop view t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; +show create table v1; +show create view v1; +drop view v1; +select * from v1; +create view v1 as select 'This is view again' A; +select * from v1; +drop table v1; +select * from v1; +drop view v1; # Bug #8497: tmpdir with extra slashes would cause failures # diff --git a/mysys/mf_format.c b/mysys/mf_format.c index 0fec9d27b1d..50f354df1cd 100644 --- a/mysys/mf_format.c +++ b/mysys/mf_format.c @@ -17,13 +17,12 @@ #include "mysys_priv.h" #include - /* - Formats a filename with possible replace of directory of extension - Function can handle the case where 'to' == 'name' - For a description of the flag values, consult my_sys.h - The arguments should be in unix format. - */ - +/* + Formats a filename with possible replace of directory of extension + Function can handle the case where 'to' == 'name' + For a description of the flag values, consult my_sys.h + The arguments should be in unix format. +*/ my_string fn_format(my_string to, const char *name, const char *dir, const char *extension, uint flag) @@ -54,8 +53,7 @@ my_string fn_format(my_string to, const char *name, const char *dir, pack_dirname(dev,dev); /* Put in ./.. and ~/.. */ if (flag & MY_UNPACK_FILENAME) (void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */ - if (flag & MY_UNIX_PATH) - to_unix_path(dev); /* Fix to MySQL representation */ + if ((pos= (char*) strchr(name,FN_EXTCHAR)) != NullS) { if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */ diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 2590e7881a4..49a82ec0225 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -1315,7 +1315,6 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) query.append(FEDERATED_FROM); query.append(FEDERATED_BTICK); - if (!(share= (FEDERATED_SHARE *) my_multi_malloc(MYF(MY_WME), &share, sizeof(*share), diff --git a/sql/item.cc b/sql/item.cc index df57c301327..aa11793dd61 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -817,9 +817,12 @@ String *Item_splocal::val_str(String *sp) { DBUG_ASSERT(fixed); Item *it= this_item(); - String *ret= it->val_str(sp); + String *res= it->val_str(sp); null_value= it->null_value; + if (!res) + return NULL; + /* This way we mark returned value of val_str as const, so that various functions (e.g. CONCAT) won't try to @@ -836,12 +839,11 @@ String *Item_splocal::val_str(String *sp) Item_param class contain some more details on the topic. */ - if (!ret) - return NULL; - - str_value_ptr.set(ret->ptr(), ret->length(), - ret->charset()); - return &str_value_ptr; + if (res != &str_value) + str_value.set(res->ptr(), res->length(), res->charset()); + else + res->mark_as_const(); + return &str_value; } @@ -858,17 +860,13 @@ my_decimal *Item_splocal::val_decimal(my_decimal *decimal_value) bool Item_splocal::is_null() { Item *it= this_item(); - bool ret= it->is_null(); - null_value= it->null_value; - return ret; + return it->is_null(); } Item * Item_splocal::this_item() { - THD *thd= current_thd; - return thd->spcont->get_item(m_offset); } @@ -882,25 +880,23 @@ Item_splocal::this_item_addr(THD *thd, Item **addr) Item * Item_splocal::this_const_item() const { - THD *thd= current_thd; - return thd->spcont->get_item(m_offset); } Item::Type Item_splocal::type() const { - THD *thd= current_thd; - - if (thd->spcont) + if (thd && thd->spcont) return thd->spcont->get_item(m_offset)->type(); return NULL_ITEM; // Anything but SUBSELECT_ITEM } -bool Item_splocal::fix_fields(THD *, Item **) +bool Item_splocal::fix_fields(THD *thd_arg, Item **ref) { - Item *it= this_item(); + Item *it; + thd= thd_arg; // Must be set before this_item() + it= this_item(); DBUG_ASSERT(it->fixed); max_length= it->max_length; decimals= it->decimals; @@ -927,6 +923,7 @@ void Item_splocal::print(String *str) /***************************************************************************** Item_name_const methods *****************************************************************************/ + double Item_name_const::val_real() { DBUG_ASSERT(fixed); @@ -965,9 +962,7 @@ my_decimal *Item_name_const::val_decimal(my_decimal *decimal_value) bool Item_name_const::is_null() { - bool ret= value_item->is_null(); - null_value= value_item->null_value; - return ret; + return value_item->is_null(); } Item::Type Item_name_const::type() const @@ -976,7 +971,7 @@ Item::Type Item_name_const::type() const } -bool Item_name_const::fix_fields(THD *thd, Item **) +bool Item_name_const::fix_fields(THD *thd, Item **ref) { char buf[128]; String *item_name; @@ -2776,7 +2771,7 @@ int Item_copy_string::save_in_field(Field *field, bool no_conversions) */ /* ARGSUSED */ -bool Item::fix_fields(THD *thd, Item ** ref) +bool Item::fix_fields(THD *thd, Item **ref) { // We do not check fields which are fixed during construction @@ -4758,8 +4753,7 @@ String *Item_ref::val_str(String* tmp) bool Item_ref::is_null() { DBUG_ASSERT(fixed); - (void) (*ref)->val_int_result(); - return (*ref)->null_value; + return (*ref)->is_null(); } diff --git a/sql/item.h b/sql/item.h index 381ba98e193..6485e4e7555 100644 --- a/sql/item.h +++ b/sql/item.h @@ -718,13 +718,7 @@ class Item_splocal : public Item public: LEX_STRING m_name; - - /* - Buffer, pointing to the string value of the item. We need it to - protect internal buffer from changes. See comment to analogous - member in Item_param for more details. - */ - String str_value_ptr; + THD *thd; /* Position of this reference to SP variable in the statement (the @@ -736,10 +730,10 @@ public: Value of 0 means that this object doesn't corresponding to reference to SP variable in query text. */ - int pos_in_query; + uint pos_in_query; - Item_splocal(LEX_STRING name, uint offset, int pos_in_q=0) - : m_offset(offset), m_name(name), pos_in_query(pos_in_q) + Item_splocal(LEX_STRING name, uint offset, uint pos_in_q=0) + : m_offset(offset), m_name(name), thd(0), pos_in_query(pos_in_q) { maybe_null= TRUE; } @@ -1502,6 +1496,7 @@ public: my_decimal *val_decimal(my_decimal *); int save_in_field(Field *field, bool no_conversions); enum Item_result result_type () const { return STRING_RESULT; } + enum Item_result cast_to_int_type() const { return INT_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } // to prevent drop fixed flag (no need parent cleanup call) void cleanup() {} diff --git a/sql/item_func.cc b/sql/item_func.cc index 518fb011e0f..59036d8ecb3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2015,7 +2015,6 @@ String *Item_func_min_max::val_str(String *str) { String *res; LINT_INIT(res); - null_value= 0; for (uint i=0; i < arg_count ; i++) { if (i == 0) @@ -2030,14 +2029,11 @@ String *Item_func_min_max::val_str(String *str) if ((cmp_sign < 0 ? cmp : -cmp) < 0) res=res2; } - else - res= 0; } if ((null_value= args[i]->null_value)) - break; + return 0; } - if (res) // If !NULL - res->set_charset(collation.collation); + res->set_charset(collation.collation); return res; } case ROW_RESULT: @@ -2054,7 +2050,6 @@ double Item_func_min_max::val_real() { DBUG_ASSERT(fixed == 1); double value=0.0; - null_value= 0; for (uint i=0; i < arg_count ; i++) { if (i == 0) @@ -2076,7 +2071,6 @@ longlong Item_func_min_max::val_int() { DBUG_ASSERT(fixed == 1); longlong value=0; - null_value= 0; for (uint i=0; i < arg_count ; i++) { if (i == 0) @@ -2097,21 +2091,21 @@ longlong Item_func_min_max::val_int() my_decimal *Item_func_min_max::val_decimal(my_decimal *dec) { DBUG_ASSERT(fixed == 1); - my_decimal tmp_buf, *tmp, *res= NULL; - null_value= 0; + my_decimal tmp_buf, *tmp, *res; + LINT_INIT(res); + for (uint i=0; i < arg_count ; i++) { if (i == 0) res= args[i]->val_decimal(dec); else { - tmp= args[i]->val_decimal(&tmp_buf); - if (args[i]->null_value) - res= 0; - else if ((my_decimal_cmp(tmp, res) * cmp_sign) < 0) + tmp= args[i]->val_decimal(&tmp_buf); // Zero if NULL + if (tmp && (my_decimal_cmp(tmp, res) * cmp_sign) < 0) { if (tmp == &tmp_buf) { + /* Move value out of tmp_buf as this will be reused on next loop */ my_decimal2decimal(tmp, dec); res= dec; } @@ -2120,7 +2114,10 @@ my_decimal *Item_func_min_max::val_decimal(my_decimal *dec) } } if ((null_value= args[i]->null_value)) + { + res= 0; break; + } } return res; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 5cb4c289a10..55c761d4c6e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -121,8 +121,9 @@ static char *pretty_print_str(char *packet, char *str, int len) static inline char* slave_load_file_stem(char*buf, uint file_id, int event_server_id) { - fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", - MY_UNPACK_FILENAME | MY_UNIX_PATH); + fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", MY_UNPACK_FILENAME); + to_unix_path(buf); + buf = strend(buf); buf = int10_to_str(::server_id, buf, 10); *buf++ = '-'; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index cb250251155..4d2020fd335 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7039,19 +7039,15 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) */ if (thd->query_id == cur_field->query_id) { - bool is_covered= FALSE; KEY_PART_INFO *key_part= cur_index_info->key_part; KEY_PART_INFO *key_part_end= key_part + cur_index_info->key_parts; - for (; key_part != key_part_end ; key_part++) + for (;;) { if (key_part->field == cur_field) - { - is_covered= TRUE; break; - } + if (++key_part == key_part_end) + goto next_index; // Field was not part of key } - if (!is_covered) - goto next_index; } } } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 1a7599d7bbc..80151862bbb 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -779,6 +779,7 @@ static bool subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) splocal < sp_vars_uses.back(); splocal++) { Item *val; + (*splocal)->thd= thd; // fix_fields() is not yet done /* append the text between sp ref occurences */ res|= qbuf.append(cur + prev_pos, (*splocal)->pos_in_query - prev_pos); prev_pos= (*splocal)->pos_in_query + (*splocal)->m_name.length; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2699a4fa628..7eb0dcd2baf 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1709,15 +1709,19 @@ Statement_map::Statement_map() : int Statement_map::insert(Statement *statement) { - int rc= my_hash_insert(&st_hash, (byte *) statement); + int res= my_hash_insert(&st_hash, (byte *) statement); + if (res) + return res; if (statement->name.str) { - if ((rc= my_hash_insert(&names_hash, (byte*)statement))) + if ((res= my_hash_insert(&names_hash, (byte*)statement))) + { hash_delete(&st_hash, (byte*)statement); + return res; + } } - if (rc == 0) - last_found_statement= statement; - return rc; + last_found_statement= statement; + return res; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e83530b7239..2ada88c47d3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4483,7 +4483,8 @@ end_with_restore_list: command[thd->lex->create_view_mode].length); view_store_options(thd, first_table, &buff); buff.append("VIEW ", 5); - if (!first_table->current_db_used) + /* Test if user supplied a db (ie: we did not use thd->db) */ + if (first_table->db != thd->db && first_table->db[0]) { append_identifier(thd, &buff, first_table->db, first_table->db_length); @@ -4808,7 +4809,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, bool db_is_pattern= test(want_access & GRANT_ACL); #endif ulong dummy; - const char *db_name; DBUG_ENTER("check_access"); DBUG_PRINT("enter",("db: %s want_access: %lu master_access: %lu", db ? db : "", want_access, thd->master_access)); @@ -4826,11 +4826,11 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, DBUG_RETURN(TRUE); /* purecov: tested */ } - db_name= db ? db : thd->db; if (schema_db) { if (want_access & ~(SELECT_ACL | EXTRA_ACL)) { + const char *db_name= db ? db : thd->db; if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), thd->priv_user, thd->priv_host, db_name); @@ -6084,14 +6084,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, { ptr->db= thd->db; ptr->db_length= thd->db_length; - ptr->current_db_used= 1; } else { /* The following can't be "" as we may do 'casedn_str()' on it */ ptr->db= empty_c_string; ptr->db_length= 0; - ptr->current_db_used= 1; } if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute()) ptr->db= thd->strdup(ptr->db); @@ -7398,15 +7396,13 @@ bool default_view_definer(THD *thd, st_lex_user *definer) { definer->user.str= thd->priv_user; definer->user.length= strlen(thd->priv_user); - if (*thd->priv_host != 0) - { - definer->host.str= thd->priv_host; - definer->host.length= strlen(thd->priv_host); - } - else + if (!*thd->priv_host) { my_error(ER_NO_VIEW_USER, MYF(0)); return TRUE; } + + definer->host.str= thd->priv_host; + definer->host.length= strlen(thd->priv_host); return FALSE; } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6eea101de8f..e9777951db4 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -88,6 +88,11 @@ When one supplies long data for a placeholder: class Prepared_statement: public Statement { public: + enum flag_values + { + IS_IN_USE= 1 + }; + THD *thd; Protocol *protocol; Item_param **param_array; @@ -116,19 +121,8 @@ public: bool execute(String *expanded_query, bool open_cursor); /* Destroy this statement */ bool deallocate(); - - /* Possible values of flags */ -#if defined(_MSC_VER) && _MSC_VER < 1300 - static const int IS_IN_USE; -#else - static const int IS_IN_USE= 1; -#endif }; -/* VC6 can't handle initializing in declaration */ -#if defined(_MSC_VER) && _MSC_VER < 1300 -const int Prepared_statement::IS_IN_USE= 1; -#endif /****************************************************************************** Implementation @@ -1830,7 +1824,7 @@ static void cleanup_stmt_and_thd_after_use(Statement *stmt, THD *thd) void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) { Prepared_statement *stmt= new Prepared_statement(thd, &thd->protocol_prep); - bool rc; + bool error; DBUG_ENTER("mysql_stmt_prepare"); DBUG_PRINT("prep_query", ("%s", packet)); @@ -1853,12 +1847,12 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),QUERY_PRIOR); - rc= stmt->prepare(packet, packet_length); + error= stmt->prepare(packet, packet_length); if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),WAIT_PRIOR); - if (rc) + if (error) { /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); @@ -1900,7 +1894,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) CHARSET_INFO *to_cs= thd->variables.collation_connection; bool needs_conversion; user_var_entry *entry; - String *pstr= &str; + String *var_value= &str; uint32 unused, len; /* Convert @var contents to string in connection character set. Although @@ -1914,13 +1908,13 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) && entry->value) { my_bool is_var_null; - pstr= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC); + var_value= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC); /* NULL value of variable checked early as entry->value so here we can't get NULL in normal conditions */ DBUG_ASSERT(!is_var_null); - if (!pstr) + if (!var_value) goto end; } else @@ -1932,22 +1926,25 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) str.set("NULL", 4, &my_charset_latin1); } - needs_conversion= String::needs_conversion(pstr->length(), - pstr->charset(), to_cs, &unused); + needs_conversion= String::needs_conversion(var_value->length(), + var_value->charset(), to_cs, + &unused); - len= needs_conversion ? pstr->length() * to_cs->mbmaxlen : pstr->length(); + len= (needs_conversion ? var_value->length() * to_cs->mbmaxlen : + var_value->length()); if (!(query_str= alloc_root(thd->mem_root, len+1))) goto end; if (needs_conversion) { uint dummy_errors; - len= copy_and_convert(query_str, len, to_cs, pstr->ptr(), pstr->length(), - pstr->charset(), &dummy_errors); + len= copy_and_convert(query_str, len, to_cs, var_value->ptr(), + var_value->length(), var_value->charset(), + &dummy_errors); } else - memcpy(query_str, pstr->ptr(), pstr->length()); - query_str[len]= '\0'; + memcpy(query_str, var_value->ptr(), var_value->length()); + query_str[len]= '\0'; // Safety (mostly for debug) *query_len= len; } else @@ -1997,10 +1994,9 @@ void mysql_sql_stmt_prepare(THD *thd) Prepared_statement *stmt; const char *query; uint query_len; - DBUG_ENTER("mysql_sql_stmt_prepare"); - DBUG_ASSERT(thd->protocol == &thd->protocol_simple); + if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) { /* @@ -2182,7 +2178,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) uchar *packet_end= (uchar *) packet + packet_length - 1; #endif Prepared_statement *stmt; - bool rc; + bool error; DBUG_ENTER("mysql_stmt_execute"); packet+= 9; /* stmt_id + 5 bytes of flags */ @@ -2217,11 +2213,11 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) #endif if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),QUERY_PRIOR); - rc= stmt->execute(&expanded_query, + error= stmt->execute(&expanded_query, test(flags & (ulong) CURSOR_TYPE_READ_ONLY)); if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); - if (rc) + if (error) goto err; mysql_log.write(thd, COM_STMT_EXECUTE, "[%lu] %s", stmt->id, thd->query); @@ -2263,9 +2259,7 @@ void mysql_sql_stmt_execute(THD *thd) LEX_STRING *name= &lex->prepared_stmt_name; /* Query text for binary, general or slow log, if any of them is open */ String expanded_query; - DBUG_ENTER("mysql_sql_stmt_execute"); - DBUG_PRINT("info", ("EXECUTE: %.*s\n", name->length, name->str)); if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) @@ -2412,7 +2406,6 @@ void mysql_stmt_close(THD *thd, char *packet) /* There is always space for 4 bytes in packet buffer */ ulong stmt_id= uint4korr(packet); Prepared_statement *stmt; - DBUG_ENTER("mysql_stmt_close"); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close"))) @@ -2422,7 +2415,7 @@ void mysql_stmt_close(THD *thd, char *packet) The only way currently a statement can be deallocated when it's in use is from within Dynamic SQL. */ - DBUG_ASSERT(! (stmt->flags & Prepared_statement::IS_IN_USE)); + DBUG_ASSERT(! (stmt->flags & (uint) Prepared_statement::IS_IN_USE)); (void) stmt->deallocate(); DBUG_VOID_RETURN; @@ -2466,7 +2459,7 @@ void mysql_sql_stmt_close(THD *thd) mysql_stmt_get_longdata() thd Thread handle packet String to append - packet_length Length of string + packet_length Length of string (including end \0) DESCRIPTION Get a part of a long data. To make the protocol efficient, we are @@ -2483,13 +2476,12 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) Prepared_statement *stmt; Item_param *param; char *packet_end= packet + packet_length - 1; - DBUG_ENTER("mysql_stmt_get_longdata"); statistic_increment(thd->status_var.com_stmt_send_long_data, &LOCK_status); #ifndef EMBEDDED_LIBRARY /* Minimal size of long data packet is 6 bytes */ - if ((ulong) (packet_end - packet) < MYSQL_LONG_DATA_HEADER) + if (packet_length <= MYSQL_LONG_DATA_HEADER) { my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_send_long_data"); DBUG_VOID_RETURN; @@ -2542,7 +2534,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg) param_array(0), param_count(0), last_errno(0), - flags(IS_IN_USE) + flags((uint) IS_IN_USE) { *last_error= '\0'; } @@ -2676,7 +2668,7 @@ bool Prepared_statement::set_name(LEX_STRING *name_arg) bool Prepared_statement::prepare(const char *packet, uint packet_len) { - bool rc; + bool error; Statement stmt_backup; Query_arena *old_stmt_arena; DBUG_ENTER("Prepared_statement::prepare"); @@ -2707,7 +2699,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) lex->safe_to_cache_query= FALSE; lex->stmt_prepare_mode= TRUE; - rc= yyparse((void *)thd) || thd->is_fatal_error || + error= yyparse((void *)thd) || thd->is_fatal_error || thd->net.report_error || init_param_array(this); /* While doing context analysis of the query (in check_prepared_statement) @@ -2731,10 +2723,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) */ DBUG_ASSERT(thd->free_list == NULL); - if (rc == 0) - rc= check_prepared_statement(this, name.str != 0); + if (error == 0) + error= check_prepared_statement(this, name.str != 0); - if (rc && thd->lex->sphead) + if (error && thd->lex->sphead) { delete thd->lex->sphead; thd->lex->sphead= NULL; @@ -2745,14 +2737,14 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) thd->restore_backup_statement(this, &stmt_backup); thd->stmt_arena= old_stmt_arena; - if (rc == 0) + if (error == 0) { setup_set_params(); init_stmt_after_parse(lex); state= Query_arena::PREPARED; - flags&= ~IS_IN_USE; + flags&= ~ (uint) IS_IN_USE; } - DBUG_RETURN(rc); + DBUG_RETURN(error); } /* @@ -2774,6 +2766,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) Preconditions, postconditions. ------------------------------ See the comment for Prepared_statement::prepare(). + + RETURN + FALSE ok + TRUE Error */ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) @@ -2781,7 +2777,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) Statement stmt_backup; Query_arena *old_stmt_arena; Item *old_free_list; - bool rc= 1; + bool error= TRUE; statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status); @@ -2791,13 +2787,11 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) my_message(last_errno, last_error, MYF(0)); return 1; } - if (flags & IS_IN_USE) + if (flags & (uint) IS_IN_USE) { my_error(ER_PS_NO_RECURSION, MYF(0)); return 1; } - /* In case the command has a call to SP which re-uses this statement name */ - flags|= IS_IN_USE; if (cursor && cursor->is_open()) close_cursor(); @@ -2891,11 +2885,11 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) if (state == Query_arena::PREPARED) state= Query_arena::EXECUTED; - rc= 0; + error= FALSE; error: thd->lock_id= &thd->main_lock_id; - flags&= ~IS_IN_USE; - return rc; + flags&= ~ (uint) IS_IN_USE; + return error; } @@ -2905,7 +2899,7 @@ bool Prepared_statement::deallocate() { /* We account deallocate in the same manner as mysql_stmt_close */ statistic_increment(thd->status_var.com_stmt_close, &LOCK_status); - if (flags & IS_IN_USE) + if (flags & (uint) IS_IN_USE) { my_error(ER_PS_NO_RECURSION, MYF(0)); return TRUE; diff --git a/sql/structs.h b/sql/structs.h index 03176b47360..199eceda30f 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -20,7 +20,7 @@ struct st_table; class Field; -#define STRING_WITH_LEN(X) X, (sizeof(X)-1) +#define STRING_WITH_LEN(X) ((char*) X), (sizeof(X)-1) typedef struct st_lex_string { diff --git a/sql/table.cc b/sql/table.cc index 74ffe58e42e..6319afcd01b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -287,7 +287,8 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, keynames=(char*) key_part; strpos+= (strmov(keynames, (char *) strpos) - keynames)+1; - share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; + share->null_bytes= ((uint) (null_pos - (uchar*) outparam->null_flags) + + (null_bit_pos + 7) / 8); share->reclength = uint2korr((head+16)); if (*(head+26) == 1) diff --git a/sql/table.h b/sql/table.h index 43b6fddeee6..4a28e6d17a5 100644 --- a/sql/table.h +++ b/sql/table.h @@ -582,8 +582,6 @@ typedef struct st_table_list bool compact_view_format; /* Use compact format for SHOW CREATE VIEW */ /* view where processed */ bool where_processed; - /* db part was not defined in table definition */ - bool current_db_used; /* 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/strings/decimal.c b/strings/decimal.c index 7816f340eef..b7ad81ab53c 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -2018,7 +2018,7 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) if (to->buf < buf1) { dec1 *cur_d= to->buf; - for (; d_to_move; d_to_move--, cur_d++, buf1++) + for (; d_to_move--; cur_d++, buf1++) *cur_d= *buf1; } return error; diff --git a/strings/longlong2str-x86.s b/strings/longlong2str-x86.s index 1840bab3f47..168dab38a85 100644 --- a/strings/longlong2str-x86.s +++ b/strings/longlong2str-x86.s @@ -26,95 +26,88 @@ .type longlong2str_with_dig_vector,@function longlong2str_with_dig_vector: - subl $80,%esp + subl $80,%esp # Temporary buffer for up to 64 radix-2 digits pushl %ebp pushl %esi pushl %edi pushl %ebx - movl 100(%esp),%esi # Lower part of val - movl 112(%esp),%ebx # Radix - movl 104(%esp),%ebp # Higher part of val - movl %ebx,%eax - movl 108(%esp),%edi # get dst - testl %eax,%eax - jge .L144 + movl 100(%esp),%esi # esi = Lower part of val + movl 112(%esp),%ebx # ebx = Radix + movl 104(%esp),%ebp # ebp = Higher part of val + movl 108(%esp),%edi # edi = dst - addl $36,%eax - cmpl $34,%eax - ja .Lerror # Wrong radix - testl %ebp,%ebp - jge .L146 + testl %ebx,%ebx + jge .L144 # Radix was positive + negl %ebx # Change radix to positive + testl %ebp,%ebp # Test if given value is negative + jge .L144 movb $45,(%edi) # Add sign incl %edi # Change sign of val negl %esi adcl $0,%ebp negl %ebp -.L146: - negl %ebx # Change radix to positive - jmp .L148 - .align 4 -.L144: - addl $-2,%eax + +.L144: # Test that radix is between 2 and 36 + movl %ebx, %eax + addl $-2,%eax # Test that radix is between 2 and 36 cmpl $34,%eax - ja .Lerror # Radix in range + ja .Lerror # Radix was not in range -.L148: - movl %esi,%eax # Test if zero (for easy loop) - orl %ebp,%eax - jne .L150 - movb $48,(%edi) - incl %edi - jmp .L10_end - .align 4 - -.L150: leal 92(%esp),%ecx # End of buffer movl %edi, 108(%esp) # Store possible modified dest movl 116(%esp), %edi # dig_vec_upper - jmp .L155 - .align 4 + testl %ebp,%ebp # Test if value > 0xFFFFFFFF + jne .Llongdiv + cmpl %ebx, %esi # Test if <= radix, for easy loop + movl %esi, %eax # Value in eax (for Llow) + jae .Llow -.L153: - # val is stored in in ebp:esi + # Value is one digit (negative or positive) + movb (%eax,%edi),%bl + movl 108(%esp),%edi # get dst + movb %bl,(%edi) + incl %edi # End null here + jmp .L10_end - movl %ebp,%eax # High part of value +.Llongdiv: + # Value in ebp:esi. div the high part by the radix, + # then div remainder + low part by the radix. + movl %ebp,%eax # edx=0,eax=high(from ebp) xorl %edx,%edx + decl %ecx divl %ebx - movl %eax,%ebp + movl %eax,%ebp # edx=result of last, eax=low(from esi) movl %esi,%eax divl %ebx - decl %ecx - movl %eax,%esi # quotent in ebp:esi - movb (%edx,%edi),%al # al is faster than dl - movb %al,(%ecx) # store value in buff - .align 4 -.L155: + movl %eax,%esi # ebp:esi = quotient + movb (%edx,%edi),%dl # Store result number in temporary buffer testl %ebp,%ebp - ja .L153 - testl %esi,%esi # rest value - jl .L153 - je .L160 # Ready - movl %esi,%eax + movb %dl,(%ecx) # store value in buff + ja .Llongdiv # (Higher part of val still > 0) + .align 4 - -.L154: # Do rest with integer precision - cltd - divl %ebx +.Llow: # Do rest with integer precision + # Value in 0:eax. div 0 + low part by the radix. + xorl %edx,%edx decl %ecx + divl %ebx movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36 testl %eax,%eax movb %dl,(%ecx) - jne .L154 + jne .Llow .L160: movl 108(%esp),%edi # get dst - -.L10_mov: - movl %ecx,%esi - leal 92(%esp),%ecx # End of buffer - subl %esi,%ecx - rep - movsb + +.Lcopy_end: + leal 92(%esp),%esi # End of buffer +.Lmov: # mov temporary buffer to result (%ecx -> %edi) + movb (%ecx), %al + movb %al, (%edi) + incl %ecx + incl %edi + cmpl %ecx,%esi + jne .Lmov .L10_end: movl %edi,%eax # Pointer to end null @@ -166,21 +159,23 @@ longlong10_to_str: negl %esi # Change sign of val (ebp:esi) adcl $0,%ebp negl %ebp - .align 4 .L10_10: leal 92(%esp),%ecx # End of buffer - movl %esi,%eax # Test if zero (for easy loop) - orl %ebp,%eax - jne .L10_30 # Not zero + testl %ebp,%ebp # Test if value > 0xFFFFFFFF + jne .L10_longdiv + cmpl $10, %esi # Test if <= radix, for easy loop + movl %esi, %ebx # Value in eax (for L10_low) + jae .L10_low - # Here when value is zero - movb $48,(%edi) + # Value is one digit (negative or positive) + addb $48, %bl + movb %bl,(%edi) incl %edi jmp .L10_end .align 4 -.L10_20: +.L10_longdiv: # val is stored in in ebp:esi movl %ebp,%eax # High part of value xorl %edx,%edx @@ -195,17 +190,15 @@ longlong10_to_str: .L10_30: testl %ebp,%ebp - ja .L10_20 - testl %esi,%esi # rest value - jl .L10_20 # Unsigned, do ulonglong div once more - je .L10_mov # Ready + ja .L10_longdiv movl %esi,%ebx # Move val to %ebx +.L10_low: # The following code uses some tricks to change division by 10 to # multiplication and shifts movl $0xcccccccd,%esi -.L10_40: +.L10_40: # Divide %ebx with 10 movl %ebx,%eax mull %esi decl %ecx @@ -218,7 +211,7 @@ longlong10_to_str: movl %edx,%ebx testl %ebx,%ebx jne .L10_40 - jmp .L10_mov # Shared end with longlong10_to_str + jmp .Lcopy_end # Shared end with longlong2str .L10end: .size longlong10_to_str,.L10end-longlong10_to_str diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 1f4cf1435fe..c1ad9bf1027 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -21,8 +21,8 @@ #undef ULONGLONG_MAX /* Needed under MetroWerks Compiler, since MetroWerks compiler does not properly handle a constant expression containing a mod operator */ #if defined(__NETWARE__) && defined(__MWERKS__) -ulonglong tmp; -#define ULONGLONG_MAX (tmp =(~(ulonglong) 0)) +static ulonglong ulonglong_max= ~(ulonglong) 0; +#define ULONGLONG_MAX ulonglong_max #else #define ULONGLONG_MAX (~(ulonglong) 0) #endif /* __NETWARE__ && __MWERKS__ */ From 77fbc72f472467cb67397e6a3ed7dec5dab644fb Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Oct 2005 16:15:53 -0700 Subject: [PATCH 029/322] Handle errors returned by system crypt() in ENCRYPT(). (Bug #13619) --- mysql-test/r/func_crypt.result | 3 +++ mysql-test/t/func_crypt.test | 6 ++++++ sql/item_strfunc.cc | 8 +++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 2ee3e770a2e..afdec0f4d06 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -92,3 +92,6 @@ 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 password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` +select encrypt('1234','_.'); +encrypt('1234','_.') +# diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index 5e0283feb28..cc3cdb9564d 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -49,4 +49,10 @@ select old_password(' i d k f a '); explain extended select password('idkfa '), old_password('idkfa'); +# +# Bug #13619: Crash on FreeBSD with salt like '_.' +# +--replace_column 1 # +select encrypt('1234','_.'); + # End of 4.1 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 6962ba7c4ac..6ca6ce62c54 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1497,7 +1497,13 @@ String *Item_func_encrypt::val_str(String *str) salt_ptr= salt_str->c_ptr(); } pthread_mutex_lock(&LOCK_crypt); - char *tmp=crypt(res->c_ptr(),salt_ptr); + char *tmp= crypt(res->c_ptr(),salt_ptr); + if (!tmp) + { + pthread_mutex_unlock(&LOCK_crypt); + null_value= 1; + return 0; + } str->set(tmp,(uint) strlen(tmp),res->charset()); str->copy(); pthread_mutex_unlock(&LOCK_crypt); From 82855517a1bc71243384cc6c202095670fb3c9a4 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 7 Oct 2005 03:12:15 +0300 Subject: [PATCH 030/322] Review of new code since last pull - Use %lx instead of %p as %p is not portable - Don't replace ROW item with Item_null --- myisam/mi_rkey.c | 4 ++-- myisam/mi_search.c | 45 +++++++++++++++++++++----------------- mysql-test/r/select.result | 7 ++++++ mysql-test/t/select.test | 4 ++++ sql/item.cc | 33 ++++++++++------------------ 5 files changed, 49 insertions(+), 44 deletions(-) diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c index 9aa2be3c706..de4cefb19b6 100644 --- a/myisam/mi_rkey.c +++ b/myisam/mi_rkey.c @@ -31,8 +31,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, HA_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", - info, buf, inx, search_flag)); + DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d search_flag: %d", + (long) info, (long) buf, inx, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 82177d331b7..71a623dc9c0 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -257,15 +257,16 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (length == 0 || page > end) { my_errno=HA_ERR_CRASHED; - DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p", - length, page, end)); + DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx", + length, (long) page, (long) end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, ¬_used)) >= 0) break; #ifdef EXTRA_DEBUG - DBUG_PRINT("loop",("page: %p key: '%s' flag: %d", page, t_buff, flag)); + DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d", (long) page, t_buff, + flag)); #endif memcpy(buff,t_buff,length); *ret_pos=page; @@ -273,7 +274,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (flag == 0) memcpy(buff,t_buff,length); /* Result is first key */ *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos)); DBUG_RETURN(flag); } /* _mi_seq_search */ @@ -412,8 +413,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (page > end) { my_errno=HA_ERR_CRASHED; - DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p", - length, page, end)); + DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx", + length, (long) page, (long) end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } @@ -546,7 +547,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos)); DBUG_RETURN(flag); } /* _mi_prefix_search */ @@ -807,8 +808,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (length > keyseg->length) { DBUG_PRINT("error", - ("Found too long null packed key: %u of %u at %p", - length, keyseg->length, *page_pos)); + ("Found too long null packed key: %u of %u at %lx", + length, keyseg->length, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; return 0; @@ -863,8 +864,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, } if (length > (uint) keyseg->length) { - DBUG_PRINT("error",("Found too long packed key: %u of %u at %p", - length, keyseg->length, *page_pos)); + DBUG_PRINT("error",("Found too long packed key: %u of %u at %lx", + length, keyseg->length, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; return 0; /* Error */ @@ -928,8 +929,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, { if (length > keyinfo->maxlength) { - DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %p", - length, keyinfo->maxlength, *page_pos)); + DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %lx", + length, keyinfo->maxlength, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); /* Wrong key */ @@ -975,8 +976,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, length-=tmp; from=page; from_end=page_end; } - DBUG_PRINT("info",("key: %p from: %p length: %u", - key, from, length)); + DBUG_PRINT("info",("key: %lx from: %lx length: %u", + (long) key, (long) from, length)); memcpy_overlap((byte*) key, (byte*) from, (size_t) length); key+=length; from+=length; @@ -1031,7 +1032,8 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, } } } - DBUG_PRINT("exit",("page: %p length: %u", page, *return_key_length)); + DBUG_PRINT("exit",("page: %lx length: %u", (long) page, + *return_key_length)); DBUG_RETURN(page); } /* _mi_get_key */ @@ -1082,7 +1084,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uint nod_flag; uchar *lastpos; DBUG_ENTER("_mi_get_last_key"); - DBUG_PRINT("enter",("page: %p endpos: %p", page, endpos)); + DBUG_PRINT("enter",("page: %lx endpos: %lx", (long) page, (long) endpos)); nod_flag=mi_test_if_nod(page); if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) @@ -1102,13 +1104,15 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey); if (*return_key_length == 0) { - DBUG_PRINT("error",("Couldn't find last key: page: %p", page)); + DBUG_PRINT("error",("Couldn't find last key: page: %lx", + (long) page)); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); } } } - DBUG_PRINT("exit",("lastpos: %p length: %u", lastpos, *return_key_length)); + DBUG_PRINT("exit",("lastpos: %lx length: %u", (long) lastpos, + *return_key_length)); DBUG_RETURN(lastpos); } /* _mi_get_last_key */ @@ -1644,7 +1648,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ref_length=0; next_length_pack=0; } - DBUG_PRINT("test",("length: %d next_key: %p", length, next_key)); + DBUG_PRINT("test",("length: %d next_key: %lx", length, + (long) next_key)); { uint tmp_length; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 64cbaf4fa67..4effb8d173c 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2625,4 +2625,11 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index bdadd5c536b..e6f91389d7b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2172,6 +2172,10 @@ create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); drop table t1,t2; # End of 4.1 tests diff --git a/sql/item.cc b/sql/item.cc index 03ab38fc970..78e9c02f5f3 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2872,32 +2872,21 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) } else if (res_type == ROW_RESULT) { + Item_row *item_row= (Item_row*) item; + Item_row *comp_item_row= (Item_row*) comp_item; + uint col; new_item= 0; /* If item and comp_item are both Item_rows and have same number of cols - then process items in Item_row one by one. If Item_row contain nulls - substitute it by Item_null. Otherwise just return. + then process items in Item_row one by one. + We can't ignore NULL values here as this item may be used with <=>, in + which case NULL's are significant. */ - if (item->result_type() == comp_item->result_type() && - ((Item_row*)item)->cols() == ((Item_row*)comp_item)->cols()) - { - Item_row *item_row= (Item_row*)item,*comp_item_row= (Item_row*)comp_item; - if (item_row->null_inside()) - new_item= (Item*) new Item_null(name); - else - { - int i= item_row->cols() - 1; - for (; i >= 0; i--) - { - if (item_row->maybe_null && item_row->el(i)->is_null()) - { - new_item= (Item*) new Item_null(name); - break; - } - resolve_const_item(thd, item_row->addr(i), comp_item_row->el(i)); - } - } - } + DBUG_ASSERT(item->result_type() == comp_item->result_type()); + DBUG_ASSERT(item_row->cols() == comp_item_row->cols()); + col= item_row->cols(); + while (col-- > 0) + resolve_const_item(thd, item_row->addr(col), comp_item_row->el(col)); } else { // It must REAL_RESULT From 4a893c96e37ca2b8cd4469d6d81f4f9309a242b1 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Oct 2005 17:37:24 -0700 Subject: [PATCH 031/322] Fix use of "%*s" *printf() specifiers that were really meant to be "%.*s". (Bug #13650) --- sql/sp.cc | 31 ++++++++++++++++--------------- sql/sp_cache.cc | 2 +- sql/sp_head.cc | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/sql/sp.cc b/sql/sp.cc index 4f7b544f5c7..8386c5d58a2 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -208,7 +208,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table) { byte key[MAX_KEY_LENGTH]; // db, name, optional key length type DBUG_ENTER("db_find_routine_aux"); - DBUG_PRINT("enter", ("type: %d name: %*s", + DBUG_PRINT("enter", ("type: %d name: %.*s", type, name->m_name.length, name->m_name.str)); /* @@ -275,7 +275,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp) ulong sql_mode; Open_tables_state open_tables_state_backup; DBUG_ENTER("db_find_routine"); - DBUG_PRINT("enter", ("type: %d name: %*s", + DBUG_PRINT("enter", ("type: %d name: %.*s", type, name->m_name.length, name->m_name.str)); *sphp= 0; // In case of errors @@ -479,7 +479,8 @@ db_create_routine(THD *thd, int type, sp_head *sp) char olddb[128]; bool dbchanged; DBUG_ENTER("db_create_routine"); - DBUG_PRINT("enter", ("type: %d name: %*s",type,sp->m_name.length,sp->m_name.str)); + DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length, + sp->m_name.str)); dbchanged= FALSE; if ((ret= sp_use_new_db(thd, sp->m_db.str, olddb, sizeof(olddb), @@ -606,7 +607,7 @@ db_drop_routine(THD *thd, int type, sp_name *name) TABLE *table; int ret; DBUG_ENTER("db_drop_routine"); - DBUG_PRINT("enter", ("type: %d name: %*s", + DBUG_PRINT("enter", ("type: %d name: %.*s", type, name->m_name.length, name->m_name.str)); if (!(table= open_proc_table_for_update(thd))) @@ -628,7 +629,7 @@ db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) int ret; bool opened; DBUG_ENTER("db_update_routine"); - DBUG_PRINT("enter", ("type: %d name: %*s", + DBUG_PRINT("enter", ("type: %d name: %.*s", type, name->m_name.length, name->m_name.str)); if (!(table= open_proc_table_for_update(thd))) @@ -922,7 +923,7 @@ sp_find_procedure(THD *thd, sp_name *name, bool cache_only) { sp_head *sp; DBUG_ENTER("sp_find_procedure"); - DBUG_PRINT("enter", ("name: %*s.%*s", + DBUG_PRINT("enter", ("name: %.*s.%.*s", name->m_db.length, name->m_db.str, name->m_name.length, name->m_name.str)); @@ -980,7 +981,7 @@ sp_create_procedure(THD *thd, sp_head *sp) { int ret; DBUG_ENTER("sp_create_procedure"); - DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str)); ret= db_create_routine(thd, TYPE_ENUM_PROCEDURE, sp); DBUG_RETURN(ret); @@ -992,7 +993,7 @@ sp_drop_procedure(THD *thd, sp_name *name) { int ret; DBUG_ENTER("sp_drop_procedure"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); ret= db_drop_routine(thd, TYPE_ENUM_PROCEDURE, name); if (!ret) @@ -1006,7 +1007,7 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics) { int ret; DBUG_ENTER("sp_update_procedure"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name, chistics); if (!ret) @@ -1020,7 +1021,7 @@ sp_show_create_procedure(THD *thd, sp_name *name) { sp_head *sp; DBUG_ENTER("sp_show_create_procedure"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); if ((sp= sp_find_procedure(thd, name))) { @@ -1072,7 +1073,7 @@ sp_find_function(THD *thd, sp_name *name, bool cache_only) { sp_head *sp; DBUG_ENTER("sp_find_function"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); if (!(sp= sp_cache_lookup(&thd->sp_func_cache, name)) && !cache_only) @@ -1089,7 +1090,7 @@ sp_create_function(THD *thd, sp_head *sp) { int ret; DBUG_ENTER("sp_create_function"); - DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str)); ret= db_create_routine(thd, TYPE_ENUM_FUNCTION, sp); DBUG_RETURN(ret); @@ -1101,7 +1102,7 @@ sp_drop_function(THD *thd, sp_name *name) { int ret; DBUG_ENTER("sp_drop_function"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); ret= db_drop_routine(thd, TYPE_ENUM_FUNCTION, name); if (!ret) @@ -1115,7 +1116,7 @@ sp_update_function(THD *thd, sp_name *name, st_sp_chistics *chistics) { int ret; DBUG_ENTER("sp_update_procedure"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name, chistics); if (!ret) @@ -1129,7 +1130,7 @@ sp_show_create_function(THD *thd, sp_name *name) { sp_head *sp; DBUG_ENTER("sp_show_create_function"); - DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str)); + DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); if ((sp= sp_find_function(thd, name))) { diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index 495f969eeac..fea6a67f32c 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -132,7 +132,7 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp) return; // End of memory error c->version= Cversion; // No need to lock when reading long variable } - DBUG_PRINT("info",("sp_cache: inserting: %*s", sp->m_qname.length, + DBUG_PRINT("info",("sp_cache: inserting: %.*s", sp->m_qname.length, sp->m_qname.str)); c->insert(sp); *cp= c; // Update *cp if it was NULL diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 671acbc2a0c..af6acfc7448 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -280,7 +280,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type, DBUG_PRINT("info", ("STRING_RESULT: null")); goto return_null_item; } - DBUG_PRINT("info",("STRING_RESULT: %*s", + DBUG_PRINT("info",("STRING_RESULT: %.*s", s->length(), s->c_ptr_quick())); /* Reuse mechanism in sp_eval_func_item() is only employed for assignments @@ -354,7 +354,7 @@ sp_name::init_qname(THD *thd) return; m_qname.length= m_sroutines_key.length - 1; m_qname.str= m_sroutines_key.str + 1; - sprintf(m_qname.str, "%*s.%*s", + sprintf(m_qname.str, "%.*s.%.*s", m_db.length, (m_db.length ? m_db.str : ""), m_name.length, m_name.str); } From 62ad8922b84ee93db1fc4b9c7b76b7c99d9d6976 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 7 Oct 2005 09:52:15 +0500 Subject: [PATCH 032/322] ctype_utf8.result, ctype_utf8.test: Adding test case. item_func.cc: Bug#13751 find_in_set: Illegal mix of collations. Character set conversion was forgotten in find_in_set. --- mysql-test/r/ctype_utf8.result | 5 +++++ mysql-test/t/ctype_utf8.test | 8 ++++++++ sql/item_func.cc | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index aeea574ef6c..c7606b918df 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1056,3 +1056,8 @@ hex(a) 5B E880BD drop table t1; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +a +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 23824a58dab..dcb7469d46e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -865,4 +865,12 @@ insert into t1 values (_utf8 0x5b); select hex(a) from t1; drop table t1; +# +# Bug#13751 find_in_set: Illegal mix of collations +# +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +drop table t1; + # End of 4.1 tests diff --git a/sql/item_func.cc b/sql/item_func.cc index ebb200ec4da..288859443ff 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1454,7 +1454,7 @@ void Item_func_find_in_set::fix_length_and_dec() } } } - agg_arg_collations_for_comparison(cmp_collation, args, 2); + agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV); } static const char separator=','; From 3a32f96e31461a039a27996dc9592ab1033c7e8f Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 7 Oct 2005 12:50:29 +0200 Subject: [PATCH 033/322] Increase the version number. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 97eb0cb0edf..c4ea20a0453 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.15) +AM_INIT_AUTOMAKE(mysql, 4.1.16) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 -NDB_VERSION_BUILD=15 +NDB_VERSION_BUILD=16 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 33f38f7ed85a7be28017d0e0cf776d774bae19dc Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 7 Oct 2005 13:08:07 +0200 Subject: [PATCH 034/322] make_binary_distribution.sh: Copy zlib.a and valgrind.supp if exists Copy disabled.def --- scripts/make_binary_distribution.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0ab26f33c53..d622dfed9d3 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -167,7 +167,8 @@ copyfileto $BASE/lib \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a # convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then @@ -204,10 +205,12 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD copyfileto $BASE/mysql-test \ mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib +$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ $BASE/mysql-test/std_data From 01a374d9550cc23ab2c70a51e090d09108ea0e7c Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 7 Oct 2005 16:37:53 +0200 Subject: [PATCH 035/322] Copy zlib.a and valgrind.supp if exists. Copy disabled.def (Backport of Kent's change from the main tree to the 4.1.15 build clone. Original changeset: 2005/10/07 13:08:07+02:00 kent@mysql.com ) --- scripts/make_binary_distribution.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0ab26f33c53..d622dfed9d3 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -167,7 +167,8 @@ copyfileto $BASE/lib \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a # convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then @@ -204,10 +205,12 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD copyfileto $BASE/mysql-test \ mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib +$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ $BASE/mysql-test/std_data From fcc51afb6a5f5522def6f8f2076979e420197205 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Fri, 7 Oct 2005 20:14:34 +0500 Subject: [PATCH 036/322] Populate t1 in order to get more predictable explain results. --- mysql-test/r/subselect2.result | 1 + mysql-test/t/subselect2.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 148c670c589..8fcfa06a8ae 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -14,6 +14,7 @@ DOCID VARCHAR(32)BINARY NOT NULL , PRIMARY KEY ( DOCID ) ) ENGINE=InnoDB ; +INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL diff --git a/mysql-test/t/subselect2.test b/mysql-test/t/subselect2.test index 839e94206d0..b21eda176b6 100644 --- a/mysql-test/t/subselect2.test +++ b/mysql-test/t/subselect2.test @@ -25,6 +25,8 @@ DOCID VARCHAR(32)BINARY NOT NULL ) ENGINE=InnoDB ; +INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); + CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL From f577ebb88fc4f56f440ee3736b54512d528ca0a9 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Sat, 8 Oct 2005 00:57:40 +0300 Subject: [PATCH 037/322] Simple changes during review of code Added back flag that I accidently removed in last patch --- sql/ha_federated.cc | 78 +++++++++++++++------------------------------ sql/sql_prepare.cc | 2 ++ sql/sql_table.cc | 18 +++++------ 3 files changed, 37 insertions(+), 61 deletions(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 49a82ec0225..258c67f476a 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -441,6 +441,7 @@ static int check_foreign_data_source( String query(query_buffer, sizeof(query_buffer), &my_charset_bin); MYSQL *mysql; DBUG_ENTER("ha_federated::check_foreign_data_source"); + /* Zero the length, otherwise the string will have misc chars */ query.length(0); @@ -525,6 +526,7 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) char buf[FEDERATED_QUERY_BUFFER_SIZE]; int buf_len; DBUG_ENTER("ha_federated parse_url_error"); + if (share->scheme) { DBUG_PRINT("info", @@ -533,11 +535,9 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) my_free((gptr) share->scheme, MYF(0)); share->scheme= 0; } - buf_len= (table->s->connect_string.length > (FEDERATED_QUERY_BUFFER_SIZE - 1)) - ? FEDERATED_QUERY_BUFFER_SIZE - 1 : table->s->connect_string.length; - - strnmov(buf, table->s->connect_string.str, buf_len); - buf[buf_len]= '\0'; + buf_len= min(table->s->connect_string.length, + FEDERATED_QUERY_BUFFER_SIZE-1); + strmake(buf, table->s->connect_string.str, buf_len); my_error(error_num, MYF(0), buf); DBUG_RETURN(error_num); } @@ -748,12 +748,9 @@ uint ha_federated::convert_row_to_internal_format(byte *record, MYSQL_ROW row) { ulong *lengths; Field **field; - DBUG_ENTER("ha_federated::convert_row_to_internal_format"); - // num_fields= mysql_num_fields(stored_result); lengths= mysql_fetch_lengths(stored_result); - memset(record, 0, table->s->null_bytes); for (field= table->field; *field; field++) @@ -1108,8 +1105,8 @@ bool ha_federated::create_where_from_key(String *to, char tmpbuff[FEDERATED_QUERY_BUFFER_SIZE]; String tmp(tmpbuff, sizeof(tmpbuff), system_charset_info); const key_range *ranges[2]= { start_key, end_key }; - DBUG_ENTER("ha_federated::create_where_from_key"); + tmp.length(0); if (start_key == NULL && end_key == NULL) DBUG_RETURN(1); @@ -1369,8 +1366,8 @@ error: static int free_share(FEDERATED_SHARE *share) { DBUG_ENTER("free_share"); - pthread_mutex_lock(&federated_mutex); + pthread_mutex_lock(&federated_mutex); if (!--share->use_count) { if (share->scheme) @@ -1565,7 +1562,6 @@ int ha_federated::write_row(byte *buf) values_string.length(0); insert_string.length(0); insert_field_value_string.length(0); - DBUG_ENTER("ha_federated::write_row"); DBUG_PRINT("info", ("table charset name %s csname %s", @@ -1692,7 +1688,6 @@ int ha_federated::optimize(THD* thd, HA_CHECK_OPT* check_opt) { char query_buffer[STRING_BUFFER_USUAL_SIZE]; String query(query_buffer, sizeof(query_buffer), &my_charset_bin); - DBUG_ENTER("ha_federated::optimize"); query.length(0); @@ -1716,7 +1711,6 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt) { char query_buffer[STRING_BUFFER_USUAL_SIZE]; String query(query_buffer, sizeof(query_buffer), &my_charset_bin); - DBUG_ENTER("ha_federated::repair"); query.length(0); @@ -1762,14 +1756,16 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt) int ha_federated::update_row(const byte *old_data, byte *new_data) { /* - This used to control how the query was built. If there was a primary key, - the query would be built such that there was a where clause with only - that column as the condition. This is flawed, because if we have a multi-part - primary key, it would only use the first part! We don't need to do this anyway, - because read_range_first will retrieve the correct record, which is what is used - to build the WHERE clause. We can however use this to append a LIMIT to the end - if there is NOT a primary key. Why do this? Because we only are updating one - record, and LIMIT enforces this. + This used to control how the query was built. If there was a + primary key, the query would be built such that there was a where + clause with only that column as the condition. This is flawed, + because if we have a multi-part primary key, it would only use the + first part! We don't need to do this anyway, because + read_range_first will retrieve the correct record, which is what + is used to build the WHERE clause. We can however use this to + append a LIMIT to the end if there is NOT a primary key. Why do + this? Because we only are updating one record, and LIMIT enforces + this. */ bool has_a_primary_key= (table->s->primary_key == 0 ? TRUE : FALSE); /* @@ -1796,7 +1792,6 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) String where_string(where_buffer, sizeof(where_buffer), &my_charset_bin); - DBUG_ENTER("ha_federated::update_row"); /* set string lengths to 0 to avoid misc chars in string @@ -1991,12 +1986,10 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key, sizeof(sql_query_buffer), &my_charset_bin); key_range range; + DBUG_ENTER("ha_federated::index_read_idx"); index_string.length(0); sql_query.length(0); - - DBUG_ENTER("ha_federated::index_read_idx"); - statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); @@ -2085,8 +2078,8 @@ int ha_federated::read_range_first(const key_range *start_key, String sql_query(sql_query_buffer, sizeof(sql_query_buffer), &my_charset_bin); - DBUG_ENTER("ha_federated::read_range_first"); + if (start_key == NULL && end_key == NULL) DBUG_RETURN(0); @@ -2401,7 +2394,6 @@ void ha_federated::info(uint flag) MYSQL_RES *result= 0; MYSQL_ROW row; String status_query_string(status_buf, sizeof(status_buf), &my_charset_bin); - DBUG_ENTER("ha_federated::info"); error_code= ER_QUERY_ON_FOREIGN_DATA_SOURCE; @@ -2492,10 +2484,10 @@ error: int ha_federated::delete_all_rows() { - DBUG_ENTER("ha_federated::delete_all_rows"); - char query_buffer[FEDERATED_QUERY_BUFFER_SIZE]; String query(query_buffer, sizeof(query_buffer), &my_charset_bin); + DBUG_ENTER("ha_federated::delete_all_rows"); + query.length(0); query.set_charset(system_charset_info); @@ -2590,32 +2582,14 @@ THR_LOCK_DATA **ha_federated::store_lock(THD *thd, int ha_federated::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info) { - int retval= 0; - /* - only a temporary share, to test the url - */ - FEDERATED_SHARE tmp_share; + int retval; + FEDERATED_SHARE tmp_share; // Only a temporary share, to test the url DBUG_ENTER("ha_federated::create"); - if ((retval= parse_url(&tmp_share, table_arg, 1))) - goto error; + if (!(retval= parse_url(&tmp_share, table_arg, 1))) + retval= check_foreign_data_source(&tmp_share, 1); - if ((retval= check_foreign_data_source(&tmp_share, 1))) - goto error; - - if (tmp_share.scheme) - { - my_free((gptr) tmp_share.scheme, MYF(0)); - tmp_share.scheme= 0; - } - DBUG_RETURN(retval); - -error: - if (tmp_share.scheme) - { - my_free((gptr) tmp_share.scheme, MYF(0)); - tmp_share.scheme= 0; - } + my_free((gptr) tmp_share.scheme, MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(retval); } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index e9777951db4..16e769438d3 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2792,6 +2792,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) my_error(ER_PS_NO_RECURSION, MYF(0)); return 1; } + /* In case the command has a call to SP which re-uses this statement name */ + flags|= (uint) IS_IN_USE; if (cursor && cursor->is_open()) close_cursor(); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 635b512fe23..31be8872c94 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1571,7 +1571,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, DBUG_RETURN(TRUE); } if (wait_if_global_read_lock(thd, 0, 1)) - DBUG_RETURN(error); + DBUG_RETURN(TRUE); VOID(pthread_mutex_lock(&LOCK_open)); if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE)) { @@ -1636,20 +1636,20 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, mysql_bin_log.write(&qinfo); } error= FALSE; - goto end; - -warn: - error= 0; - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR), - alias); - create_info->table_existed= 1; // Mark that table existed end: VOID(pthread_mutex_unlock(&LOCK_open)); start_waiting_global_read_lock(thd); thd->proc_info="After create"; DBUG_RETURN(error); + +warn: + error= FALSE; + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR), + alias); + create_info->table_existed= 1; // Mark that table existed + goto end; } /* From 9bca1b91247b0ed82af73015f3b90186dc2fe378 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 9 Oct 2005 01:32:09 +0200 Subject: [PATCH 038/322] func_group.test: Test requires innodb --- mysql-test/t/func_group.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index f833f482f73..dc647dbcfeb 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -2,6 +2,8 @@ # simple test of all group functions # +--source include/have_innodb.inc + --disable_warnings drop table if exists t1,t2; --enable_warnings From 6bfc2d4b895120378a26e24eaa1b732f103d7ae2 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Sun, 9 Oct 2005 23:05:44 +0400 Subject: [PATCH 039/322] Fix bug#7672 Unknown column error in order clause When fixing Item_func_plus in ORDER BY clause field c is searched in all opened tables, but because c is an alias it wasn't found there. This patch adds a flag to select_lex which allows Item_field::fix_fields() to look up in select's item_list to find aliased fields. --- mysql-test/r/select.result | 10 ++++++++++ mysql-test/t/select.test | 9 +++++++++ sql/item.cc | 11 +++++++++++ sql/sql_lex.cc | 1 + sql/sql_lex.h | 2 +- sql/sql_select.cc | 6 ++++++ 6 files changed, 38 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3c7a74c0c57..299e0b6bf33 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2431,3 +2431,13 @@ AND FK_firma_id = 2; COUNT(*) 0 drop table t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 6626397e9e5..2adf4f1749c 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1983,3 +1983,12 @@ AND FK_firma_id = 2; drop table t1; +# +# Bug 7672 Unknown column error in order clause +# +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +(SELECT a, b AS c FROM t1) ORDER BY b+1; +SELECT a, b AS c FROM t1 ORDER BY c+1; +SELECT a, b AS c FROM t1 ORDER BY b+1; +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index 8737cc06bbd..c3845db904c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -348,7 +348,18 @@ bool Item_field::fix_fields(THD *thd,TABLE_LIST *tables) { Field *tmp; if (!(tmp=find_field_in_tables(thd,this,tables))) + { + if (thd->lex.select_lex.is_item_list_lookup) + { + Item** res= find_item_in_list(this, thd->lex.select_lex.item_list); + if (res && *res && (*res)->type() == Item::FIELD_ITEM) + { + set_field((*((Item_field**)res))->field); + return 0; + } + } return 1; + } set_field(tmp); } else if (thd && thd->set_query_id && field->query_id != thd->query_id) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 20aacf42be0..9fb35e3f914 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -154,6 +154,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length) lex->slave_thd_opt=0; lex->sql_command=SQLCOM_END; bzero((char *)&lex->mi,sizeof(lex->mi)); + lex->select_lex.is_item_list_lookup= 0; return lex; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index ab78555262f..d4b20c69bf2 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -121,7 +121,7 @@ typedef struct st_select_lex ignore_index, *ignore_index_ptr; List ftfunc_list; uint in_sum_expr, sort_default; - bool create_refs, braces; + bool create_refs, braces, is_item_list_lookup; st_select_lex *next; } SELECT_LEX; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 29c15741347..5292a1fc0e0 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6845,8 +6845,14 @@ find_order_in_list(THD *thd,TABLE_LIST *tables,ORDER *order,List &fields, return 0; } order->in_field_list=0; + /* Allow lookup in select's item_list to find aliased fields */ + thd->lex.select_lex.is_item_list_lookup= 1; if ((*order->item)->fix_fields(thd,tables) || thd->fatal_error) + { + thd->lex.select_lex.is_item_list_lookup= 0; return 1; // Wrong field + } + thd->lex.select_lex.is_item_list_lookup= 0; all_fields.push_front(*order->item); // Add new field to field list order->item=(Item**) all_fields.head_ref(); return 0; From 82615d8b9dc1e6aeb7a9e138a60daf00cd0c3afd Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 10 Oct 2005 00:21:10 +0200 Subject: [PATCH 040/322] Makefile.am: Copy "disabled.def" --- mysql-test/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index e7abcd3fc95..d062ee79827 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -48,7 +48,10 @@ mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ $(distdir)/std_data $(distdir)/lib - $(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.test $(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 $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data @@ -67,7 +70,9 @@ install-data-local: $(DESTDIR)$(testdir)/std_data \ $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) + -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t From 57978f52fce339954d6d3a635939522aa4f6a5b1 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 10 Oct 2005 12:25:29 +0200 Subject: [PATCH 041/322] Bug #13611 double [TCP DEFAULT] in config.ini crashes ndb_mgmd - Added error printout and nice exit for duplicate default sections --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 94f07ab0ca1..f643349a493 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -565,8 +565,12 @@ InitConfigFileParser::storeSection(Context& ctx){ } } } - if(ctx.type == InitConfigFileParser::DefaultSection) - require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)); + if(ctx.type == InitConfigFileParser::DefaultSection && + !ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)) + { + ctx.reportError("Duplicate default section not allowed"); + return false; + } if(ctx.type == InitConfigFileParser::Section) require(ctx.m_config->put(ctx.pname, ctx.m_currentSection)); delete ctx.m_currentSection; ctx.m_currentSection = NULL; From e8f291f52b4de9242e776cd4832bcb8e2f5f8553 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 10 Oct 2005 12:27:48 +0200 Subject: [PATCH 042/322] Bug #13611 double [TCP DEFAULT] in config.ini crashes ndb_mgmd - Added error printout and nice exit for duplicate default sections --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index e0163b966c0..b2c290df9fc 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -558,8 +558,12 @@ InitConfigFileParser::storeSection(Context& ctx){ } } } - if(ctx.type == InitConfigFileParser::DefaultSection) - require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)); + if(ctx.type == InitConfigFileParser::DefaultSection && + !ctx.m_defaults->put(ctx.pname, ctx.m_currentSection)) + { + ctx.reportError("Duplicate default section not allowed"); + return false; + } if(ctx.type == InitConfigFileParser::Section) require(ctx.m_config->put(ctx.pname, ctx.m_currentSection)); delete ctx.m_currentSection; ctx.m_currentSection = NULL; From 998380521fa2d3d249a0c160c09dba61e1898b1f Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 15:10:14 +0200 Subject: [PATCH 043/322] BUG#12618: Removing fake locking --- mysql-test/r/rpl_multi_update3.result | 72 ++++++++++++++++++ mysql-test/t/rpl_multi_update3.test | 59 +++++++++++++++ sql/sql_parse.cc | 102 +++++--------------------- sql/sql_update.cc | 3 - 4 files changed, 151 insertions(+), 85 deletions(-) diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/r/rpl_multi_update3.result index 1b757b1400c..b81af7c6e39 100644 --- a/mysql-test/r/rpl_multi_update3.result +++ b/mysql-test/r/rpl_multi_update3.result @@ -122,3 +122,75 @@ SELECT * FROM t1; i j x y z 1 2 23 24 71 DROP TABLE t1, t2, t3; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( +idp int(11) NOT NULL default '0', +idpro int(11) default NULL, +price decimal(19,4) default NULL, +PRIMARY KEY (idp) +); +CREATE TABLE t2 ( +idpro int(11) NOT NULL default '0', +price decimal(19,4) default NULL, +nbprice int(11) default NULL, +PRIMARY KEY (idpro) +); +INSERT INTO t1 VALUES +(1,1,'3.0000'), +(2,2,'1.0000'), +(3,1,'1.0000'), +(4,1,'4.0000'), +(5,3,'2.0000'), +(6,2,'4.0000'); +INSERT INTO t2 VALUES +(1,'0.0000',0), +(2,'0.0000',0), +(3,'0.0000',0); +update +t2 +join +( select idpro, min(price) as min_price, count(*) as nbr_price +from t1 +where idpro>0 and price>0 +group by idpro +) as table_price +on t2.idpro = table_price.idpro +set t2.price = table_price.min_price, +t2.nbprice = table_price.nbr_price; +select "-- MASTER AFTER JOIN --" as ""; + +-- MASTER AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 +select "-- SLAVE AFTER JOIN --" as ""; + +-- SLAVE AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test index 64e46882c16..36ac7a59cb3 100644 --- a/mysql-test/t/rpl_multi_update3.test +++ b/mysql-test/t/rpl_multi_update3.test @@ -158,4 +158,63 @@ SELECT * FROM t1; connection master; DROP TABLE t1, t2, t3; +############################################################################## +# +# BUG#12618 +# +# TEST: Replication of a statement containing a join in a multi-update. + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1 ( + idp int(11) NOT NULL default '0', + idpro int(11) default NULL, + price decimal(19,4) default NULL, + PRIMARY KEY (idp) +); + +CREATE TABLE t2 ( + idpro int(11) NOT NULL default '0', + price decimal(19,4) default NULL, + nbprice int(11) default NULL, + PRIMARY KEY (idpro) +); + +INSERT INTO t1 VALUES + (1,1,'3.0000'), + (2,2,'1.0000'), + (3,1,'1.0000'), + (4,1,'4.0000'), + (5,3,'2.0000'), + (6,2,'4.0000'); + +INSERT INTO t2 VALUES + (1,'0.0000',0), + (2,'0.0000',0), + (3,'0.0000',0); + +# This update sets t2 to the minimal prices for each product +update + t2 + join + ( select idpro, min(price) as min_price, count(*) as nbr_price + from t1 + where idpro>0 and price>0 + group by idpro + ) as table_price +on t2.idpro = table_price.idpro +set t2.price = table_price.min_price, + t2.nbprice = table_price.nbr_price; + +select "-- MASTER AFTER JOIN --" as ""; +select * from t1; +select * from t2; + +sync_slave_with_master; + +select "-- SLAVE AFTER JOIN --" as ""; +select * from t1; +select * from t2; + # End of 4.1 tests diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3a538a7629b..54d51e42895 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1941,8 +1941,6 @@ mysql_execute_command(THD *thd) { int res= 0; LEX *lex= thd->lex; - bool slave_fake_lock= 0; - MYSQL_LOCK *fake_prev_lock= 0; SELECT_LEX *select_lex= &lex->select_lex; TABLE_LIST *tables= (TABLE_LIST*) select_lex->table_list.first; SELECT_LEX_UNIT *unit= &lex->unit; @@ -1971,35 +1969,21 @@ mysql_execute_command(THD *thd) #ifdef HAVE_REPLICATION if (thd->slave_thread) { - if (lex->sql_command == SQLCOM_UPDATE_MULTI) - { - DBUG_PRINT("info",("need faked locked tables")); - - if (check_multi_update_lock(thd, tables, &select_lex->item_list, - select_lex)) - goto error; - - /* Fix for replication, the tables are opened and locked, - now we pretend that we have performed a LOCK TABLES action */ - - fake_prev_lock= thd->locked_tables; - if (thd->lock) - thd->locked_tables= thd->lock; - thd->lock= 0; - slave_fake_lock= 1; - } /* - Skip if we are in the slave thread, some table rules have been - given and the table list says the query should not be replicated. + Check if statment should be skipped because of slave filtering + rules Exceptions are: + - UPDATE MULTI: For this statement, we want to check the filtering + rules later in the code - SET: we always execute it (Not that many SET commands exists in the binary log anyway -- only 4.1 masters write SET statements, in 5.0 there are no SET statements in the binary log) - DROP TEMPORARY TABLE IF EXISTS: we always execute it (otherwise we have stale files on slave caused by exclusion of one tmp table). */ - if (!(lex->sql_command == SQLCOM_SET_OPTION) && + if (!(lex->sql_command == SQLCOM_UPDATE_MULTI) && + !(lex->sql_command == SQLCOM_SET_OPTION) && !(lex->sql_command == SQLCOM_DROP_TABLE && lex->drop_temporary && lex->drop_if_exists) && all_tables_not_ok(thd,tables)) @@ -2852,6 +2836,20 @@ unsent_create_error: { if ((res= multi_update_precheck(thd, tables))) break; + + if ((res= mysql_multi_update_lock(thd, tables, &select_lex->item_list, + select_lex))) + break; + + /* Check slave filtering rules */ + if (thd->slave_thread) + if (all_tables_not_ok(thd,tables)) + { + /* we warn the slave SQL thread */ + my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); + break; + } + res= mysql_multi_update(thd,tables, &select_lex->item_list, &lex->value_list, @@ -3764,14 +3762,6 @@ purposes internal to the MySQL server", MYF(0)); send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); error: - if (unlikely(slave_fake_lock)) - { - DBUG_PRINT("info",("undoing faked lock")); - thd->lock= thd->locked_tables; - thd->locked_tables= fake_prev_lock; - if (thd->lock == thd->locked_tables) - thd->lock= 0; - } DBUG_VOID_RETURN; } @@ -5303,58 +5293,6 @@ bool check_simple_select() return 0; } -/* - Setup locking for multi-table updates. Used by the replication slave. - Replication slave SQL thread examines (all_tables_not_ok()) the - locking state of referenced tables to determine if the query has to - be executed or ignored. Since in multi-table update, the - 'default' lock is read-only, this lock is corrected early enough by - calling this function, before the slave decides to execute/ignore. - - SYNOPSIS - check_multi_update_lock() - thd Current thread - tables List of user-supplied tables - fields List of fields requiring update - - RETURN VALUES - 0 ok - 1 error -*/ -static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, - List *fields, SELECT_LEX *select_lex) -{ - bool res= 1; - TABLE_LIST *table; - DBUG_ENTER("check_multi_update_lock"); - - if (check_db_used(thd, tables)) - goto error; - - /* - Ensure that we have UPDATE or SELECT privilege for each table - The exact privilege is checked in mysql_multi_update() - */ - for (table= tables ; table ; table= table->next) - { - TABLE_LIST *save= table->next; - table->next= 0; - if ((check_access(thd, UPDATE_ACL, table->db, &table->grant.privilege,0,1) || - (grant_option && check_grant(thd, UPDATE_ACL, table,0,1,1))) && - check_one_table_access(thd, SELECT_ACL, table)) - goto error; - table->next= save; - } - - if (mysql_multi_update_lock(thd, tables, fields, select_lex)) - goto error; - - res= 0; - -error: - DBUG_RETURN(res); -} - Comp_creator *comp_eq_creator(bool invert) { diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 2857bce09ed..a978a5edc64 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -672,9 +672,6 @@ int mysql_multi_update(THD *thd, multi_update *result; DBUG_ENTER("mysql_multi_update"); - if ((res= mysql_multi_update_lock(thd, table_list, fields, select_lex))) - DBUG_RETURN(res); - /* Setup timestamp handling */ for (tl= update_list; tl; tl= tl->next) { From 65325ecbbbdeb21102157716e533e1f89e256d4c Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Mon, 10 Oct 2005 18:53:57 +0400 Subject: [PATCH 044/322] Fix bug#13327 check_equality() wasn't checking view's fields check_equality() finds equalities among field items. It checks input items to be Item_fields thus skipping view's fields, which are represented by Item_direct_view_ref. Because of this index wasn't applied in all cases it can be. To fix this problem check_equality() now takes real item of Item_direct_view_ref, except outer view refs (with depended_from set). --- mysql-test/r/view.result | 22 ++++++++++++++++++++++ mysql-test/t/view.test | 20 ++++++++++++++++++++ sql/sql_select.cc | 15 +++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e52ec950c8c..3503e885aa8 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2298,3 +2298,25 @@ a 3 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 (a INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1),(2),(3); +CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b; +CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a; +EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index +EXPLAIN SELECT * FROM v1 WHERE a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref a a 5 const 1 Using where; Using index +1 PRIMARY t2 ref a a 10 const,test.t1.b 2 Using where; Using index +EXPLAIN SELECT * FROM v2 WHERE a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref a a 5 const 1 Using where; Using index +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +DROP VIEW v1,v2; +DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 15c8cccf69c..5f483401cff 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2167,3 +2167,23 @@ SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); DROP VIEW v1; DROP TABLE t1; + +# +# Bug #13327 view wasn't using index for const condition +# + +CREATE TABLE t1 (a INT, b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 (a INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1),(2),(3); +CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b; +CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a; +EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1; +EXPLAIN SELECT * FROM v1 WHERE a=1; +EXPLAIN SELECT * FROM v2 WHERE a=1; +DROP VIEW v1,v2; +DROP TABLE t1,t2,t3; + + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1b1a35d2584..4b69e2c6987 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6254,6 +6254,21 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal) { Item *left_item= ((Item_func*) item)->arguments()[0]; Item *right_item= ((Item_func*) item)->arguments()[1]; + + if (left_item->type() == Item::REF_ITEM && + ((Item_ref*)left_item)->ref_type() == Item_ref::VIEW_REF) + { + if (((Item_ref*)left_item)->depended_from) + return FALSE; + left_item= left_item->real_item(); + } + if (right_item->type() == Item::REF_ITEM && + ((Item_ref*)right_item)->ref_type() == Item_ref::VIEW_REF) + { + if (((Item_ref*)right_item)->depended_from) + return FALSE; + right_item= right_item->real_item(); + } if (left_item->type() == Item::FIELD_ITEM && right_item->type() == Item::FIELD_ITEM && !((Item_field*)left_item)->depended_from && From cd0e0a993308231c314caf7aae2420441d71dd80 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 19:23:13 +0200 Subject: [PATCH 045/322] Added missing HAVE_REPLICATION define --- sql/sql_parse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 54d51e42895..a2ad8a414f8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2006,7 +2006,7 @@ mysql_execute_command(THD *thd) } #endif } -#endif /* !HAVE_REPLICATION */ +#endif /* HAVE_REPLICATION */ /* When option readonly is set deny operations which change tables. @@ -2841,6 +2841,7 @@ unsent_create_error: select_lex))) break; +#ifdef HAVE_REPLICATION /* Check slave filtering rules */ if (thd->slave_thread) if (all_tables_not_ok(thd,tables)) @@ -2849,6 +2850,7 @@ unsent_create_error: my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); break; } +#endif /* HAVE_REPLICATION */ res= mysql_multi_update(thd,tables, &select_lex->item_list, From af951aa6629e8f812bea3b3170433d32d54722fd Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 19:38:58 +0200 Subject: [PATCH 046/322] After merge fixes --- mysql-test/r/select.result | 7 +++++++ mysql-test/r/subselect2.result | 2 ++ sql/sql_parse.cc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3e4f29d7a01..c72bc332041 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2628,6 +2628,13 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 drop table t1,t2; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 19047725528..026bcb4b370 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -15,6 +15,8 @@ DOCID VARCHAR(32)BINARY NOT NULL ) ENGINE=InnoDB ; INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); +Warnings: +Warning 1364 Field 'UUID' doesn't have a default value CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 659a20325ff..999fc792229 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3209,7 +3209,7 @@ end_with_restore_list: break; /* Check slave filtering rules */ - if (thd->slave_thread && all_tables_not_ok(thd,tables)) + if (thd->slave_thread && all_tables_not_ok(thd, all_tables)) { /* we warn the slave SQL thread */ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); From eb8ab300463fbfffd92f436496ecf9915de8a64e Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com" <> Date: Mon, 10 Oct 2005 23:01:45 +0500 Subject: [PATCH 047/322] Store and read engine type string in extra block of .frm. --- sql/handler.cc | 16 ++++++++---- sql/handler.h | 1 + sql/table.cc | 66 ++++++++++++++++++++++++++++++++------------------ sql/unireg.cc | 22 ++++++++++++++--- 4 files changed, 72 insertions(+), 33 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index d449a0b90f2..1b54ae59687 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -183,15 +183,18 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen) THD *thd= current_thd; show_table_alias_st *table_alias; handlerton **types; - const char *ptr= name; - if (thd && !my_strcasecmp(&my_charset_latin1, ptr, "DEFAULT")) + if (thd && !my_strnncoll(&my_charset_latin1, + (const uchar *)name, namelen, + (const uchar *)"DEFAULT", 7)) return (enum db_type) thd->variables.table_type; retest: for (types= sys_table_types; *types; types++) { - if (!my_strcasecmp(&my_charset_latin1, ptr, (*types)->name)) + if (!my_strnncoll(&my_charset_latin1, + (const uchar *)name, namelen, + (const uchar *)(*types)->name, strlen((*types)->name))) return (enum db_type) (*types)->db_type; } @@ -200,9 +203,12 @@ retest: */ for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { - if (!my_strcasecmp(&my_charset_latin1, ptr, table_alias->alias)) + if (!my_strnncoll(&my_charset_latin1, + (const uchar *)name, namelen, + (const uchar *)table_alias->alias, strlen(table_alias->alias))) { - ptr= table_alias->type; + name= table_alias->type; + namelen= strlen(name); goto retest; } } diff --git a/sql/handler.h b/sql/handler.h index d58d28ad7b0..af80f021e75 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -436,6 +436,7 @@ typedef struct st_ha_create_information uint options; /* OR of HA_CREATE_ options */ uint raid_type,raid_chunks; uint merge_insert_method; + uint extra_size; /* length of extra data segment */ bool table_existed; /* 1 in create if table existed */ bool frm_only; /* 1 if no ha_create_table() */ bool varchar; /* 1 if table has a VARCHAR */ diff --git a/sql/table.cc b/sql/table.cc index 0b3423d0750..c9a1544e4d2 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -300,6 +300,44 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, } #endif + record_offset= (ulong) (uint2korr(head+6)+ + ((uint2korr(head+14) == 0xffff ? + uint4korr(head+47) : uint2korr(head+14)))); + + if ((n_length= uint2korr(head+55))) + { + /* Read extra data segment */ + char *buff, *next_chunk, *buff_end; + if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME)))) + goto err; + if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength, + MYF(MY_NABP))) + { + my_free(buff, MYF(0)); + goto err; + } + if (share->db_type == DB_TYPE_FEDERATED_DB) + { + share->connect_string.length= uint2korr(buff); + if (! (share->connect_string.str= strmake_root(&outparam->mem_root, + next_chunk + 2, share->connect_string.length))) + { + my_free(buff, MYF(0)); + goto err; + } + next_chunk+= share->connect_string.length + 2; + } + buff_end= buff + n_length; + if (next_chunk + 2 < buff_end) + { + uint str_db_type_length= uint2korr(next_chunk); + share->db_type= ha_resolve_by_name(next_chunk + 2, str_db_type_length); + DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n", share->db_type, + str_db_type_length, str_db_type_length, next_chunk + 2)); + next_chunk+= str_db_type_length + 2; + } + my_free(buff, MYF(0)); + } /* Allocate handler */ if (!(outparam->file= get_new_handler(outparam, share->db_type))) goto err; @@ -322,9 +360,6 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, goto err; /* purecov: inspected */ share->default_values= (byte *) record; - record_offset= (ulong) (uint2korr(head+6)+ - ((uint2korr(head+14) == 0xffff ? - uint4korr(head+47) : uint2korr(head+14)))); if (my_pread(file,(byte*) record, (uint) share->reclength, record_offset, MYF(MY_NABP))) goto err; /* purecov: inspected */ @@ -342,20 +377,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, else outparam->record[1]= outparam->record[0]; // Safety } - - if ((n_length= uint2korr(head+55))) - { - /* Read extra block information */ - char *buff; - if (!(buff= alloc_root(&outparam->mem_root, n_length))) - goto err; - if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength, - MYF(MY_NABP))) - goto err; - share->connect_string.length= uint2korr(buff); - share->connect_string.str= buff+2; - } - + #ifdef HAVE_purify /* We need this because when we read var-length rows, we are not updating @@ -1371,15 +1393,10 @@ File create_frm(THD *thd, my_string name, const char *db, ulong length; char fill[IO_SIZE]; int create_flags= O_RDWR | O_TRUNC; - uint extra_size; if (create_info->options & HA_LEX_CREATE_TMP_TABLE) create_flags|= O_EXCL | O_NOFOLLOW; - extra_size= 0; - if (create_info->connect_string.length) - extra_size= 2+create_info->connect_string.length; - #if SIZEOF_OFF_T > 4 /* Fix this when we have new .frm files; Current limit is 4G rows (QQ) */ if (create_info->max_rows > ~(ulong) 0) @@ -1407,7 +1424,8 @@ File create_frm(THD *thd, my_string name, const char *db, fileinfo[4]=1; int2store(fileinfo+6,IO_SIZE); /* Next block starts here */ key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16; - length= next_io_size((ulong) (IO_SIZE+key_length+reclength+extra_size)); + length= next_io_size((ulong) (IO_SIZE+key_length+reclength+ + create_info->extra_size)); int4store(fileinfo+10,length); tmp_key_length= (key_length < 0xffff) ? key_length : 0xffff; int2store(fileinfo+14,tmp_key_length); @@ -1429,7 +1447,7 @@ File create_frm(THD *thd, my_string name, const char *db, int4store(fileinfo+47, key_length); tmp= MYSQL_VERSION_ID; // Store to avoid warning from int4store int4store(fileinfo+51, tmp); - int2store(fileinfo+55, extra_size); + int2store(fileinfo+55, create_info->extra_size); bzero(fill,IO_SIZE); for (; length > IO_SIZE ; length-= IO_SIZE) { diff --git a/sql/unireg.cc b/sql/unireg.cc index d297b143d3b..402d24a665b 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -75,6 +75,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, uint keys, KEY *key_info, handler *db_file) { + LEX_STRING str_db_type; uint reclength,info_length,screens,key_info_length,maxlength; ulong key_buff_length; File file; @@ -82,6 +83,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, uchar fileinfo[64],forminfo[288],*keybuff; TYPELIB formnames; uchar *screen_buff; + char buff[2]; DBUG_ENTER("mysql_create_frm"); formnames.type_names=0; @@ -116,6 +118,13 @@ bool mysql_create_frm(THD *thd, my_string file_name, } reclength=uint2korr(forminfo+266); + /* Calculate extra data segment length */ + str_db_type.str= (char *)ha_get_storage_engine(create_info->db_type); + str_db_type.length= strlen(str_db_type.str); + create_info->extra_size= 2 + str_db_type.length; + if (create_info->db_type == DB_TYPE_FEDERATED_DB) + create_info->extra_size+= create_info->connect_string.length + 2; + if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys)) < 0) { @@ -149,16 +158,21 @@ bool mysql_create_frm(THD *thd, my_string file_name, if (make_empty_rec(thd,file,create_info->db_type,create_info->table_options, create_fields,reclength, data_offset)) goto err; - if (create_info->connect_string.length) + + if (create_info->db_type == DB_TYPE_FEDERATED_DB) { - char buff[2]; - int2store(buff,create_info->connect_string.length); + int2store(buff, create_info->connect_string.length); if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || my_write(file, (const byte*)create_info->connect_string.str, create_info->connect_string.length, MYF(MY_NABP))) goto err; } - + int2store(buff, str_db_type.length); + if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || + my_write(file, (const byte*)str_db_type.str, + str_db_type.length, MYF(MY_NABP))) + goto err; + VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0))); if (my_write(file,(byte*) forminfo,288,MYF_RW) || my_write(file,(byte*) screen_buff,info_length,MYF_RW) || From 83043c3c830a8ef20a5817337a34a7a849d16a64 Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com" <> Date: Mon, 10 Oct 2005 23:53:53 +0500 Subject: [PATCH 048/322] Always save/restore connect string. --- sql/table.cc | 15 ++++++--------- sql/unireg.cc | 15 ++++++--------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index c9a1544e4d2..f78e196a29e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -316,17 +316,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, my_free(buff, MYF(0)); goto err; } - if (share->db_type == DB_TYPE_FEDERATED_DB) + share->connect_string.length= uint2korr(buff); + if (! (share->connect_string.str= strmake_root(&outparam->mem_root, + next_chunk + 2, share->connect_string.length))) { - share->connect_string.length= uint2korr(buff); - if (! (share->connect_string.str= strmake_root(&outparam->mem_root, - next_chunk + 2, share->connect_string.length))) - { - my_free(buff, MYF(0)); - goto err; - } - next_chunk+= share->connect_string.length + 2; + my_free(buff, MYF(0)); + goto err; } + next_chunk+= share->connect_string.length + 2; buff_end= buff + n_length; if (next_chunk + 2 < buff_end) { diff --git a/sql/unireg.cc b/sql/unireg.cc index 402d24a665b..e4f5c8251dc 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -122,8 +122,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, str_db_type.str= (char *)ha_get_storage_engine(create_info->db_type); str_db_type.length= strlen(str_db_type.str); create_info->extra_size= 2 + str_db_type.length; - if (create_info->db_type == DB_TYPE_FEDERATED_DB) - create_info->extra_size+= create_info->connect_string.length + 2; + create_info->extra_size+= create_info->connect_string.length + 2; if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys)) < 0) @@ -159,14 +158,12 @@ bool mysql_create_frm(THD *thd, my_string file_name, create_fields,reclength, data_offset)) goto err; - if (create_info->db_type == DB_TYPE_FEDERATED_DB) - { - int2store(buff, create_info->connect_string.length); - if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || - my_write(file, (const byte*)create_info->connect_string.str, - create_info->connect_string.length, MYF(MY_NABP))) + int2store(buff, create_info->connect_string.length); + if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || + my_write(file, (const byte*)create_info->connect_string.str, + create_info->connect_string.length, MYF(MY_NABP))) goto err; - } + int2store(buff, str_db_type.length); if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || my_write(file, (const byte*)str_db_type.str, From 5456afc60366b33d8ddce8ae5e491ba2d41caed1 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 21:42:14 +0200 Subject: [PATCH 049/322] Added missing HAVE_REPLICATION define --- sql/sql_parse.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 999fc792229..88718f6c8c9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3208,6 +3208,7 @@ end_with_restore_list: if ((res= mysql_multi_update_prepare(thd))) break; +#ifdef HAVE_REPLICATION /* Check slave filtering rules */ if (thd->slave_thread && all_tables_not_ok(thd, all_tables)) { @@ -3215,6 +3216,7 @@ end_with_restore_list: my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); break; } +#endif /* HAVE_REPLICATION */ res= mysql_multi_update(thd, all_tables, &select_lex->item_list, From ab8abdb85cab181b5dbd00eb1d2fcb50ce1bd5b0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 11 Oct 2005 01:07:50 +0200 Subject: [PATCH 050/322] Many files: Added Visual Studio .Net targets and 'vcproj' files for "isam", "isamchk", "mysqlshutdown", "mysqlwatch" and "pack_isam" --- VC++Files/isam/isam.vcproj | 1283 ++++++++++++++++++ VC++Files/isamchk/isamchk.vcproj | 272 ++++ VC++Files/mysql.sln | 142 ++ VC++Files/mysqlshutdown/mysqlshutdown.vcproj | 162 +++ VC++Files/mysqlwatch/mysqlwatch.vcproj | 109 ++ VC++Files/pack_isam/pack_isam.vcproj | 244 ++++ 6 files changed, 2212 insertions(+) create mode 100644 VC++Files/isam/isam.vcproj create mode 100644 VC++Files/isamchk/isamchk.vcproj create mode 100644 VC++Files/mysqlshutdown/mysqlshutdown.vcproj create mode 100644 VC++Files/mysqlwatch/mysqlwatch.vcproj create mode 100644 VC++Files/pack_isam/pack_isam.vcproj diff --git a/VC++Files/isam/isam.vcproj b/VC++Files/isam/isam.vcproj new file mode 100644 index 00000000000..aada6539a1f --- /dev/null +++ b/VC++Files/isam/isam.vcproj @@ -0,0 +1,1283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/isamchk/isamchk.vcproj b/VC++Files/isamchk/isamchk.vcproj new file mode 100644 index 00000000000..d0a66635c8f --- /dev/null +++ b/VC++Files/isamchk/isamchk.vcproj @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index 56919806840..70defe111cb 100644 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -55,6 +55,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "my_print_defaults", "my_pri {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isam", "isam\isam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam", "myisam\myisam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D2}" ProjectSection(ProjectDependencies) = postProject EndProjectSection @@ -67,6 +71,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam_ftdump", "myisam_ftd {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isamchk", "isamchk\isamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0E}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D3} = {262280A8-37D5-4037-BDFB-242468DFB3D3} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamchk", "myisamchk\myisamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0F}" ProjectSection(ProjectDependencies) = postProject {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} @@ -89,6 +102,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisammrg", "myisammrg\myis ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pack_isam", "pack_isam\pack_isam.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CD}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D3} = {262280A8-37D5-4037-BDFB-242468DFB3D3} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisampack", "myisampack\myisampack.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CC}" ProjectSection(ProjectDependencies) = postProject {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} @@ -148,6 +170,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldemb", "mysqldemb\mysq ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlshutdown", "mysqlshutdown\mysqlshutdown.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92D}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlwatch", "mysqlwatch\mysqlwatch.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92C}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldump", "client\mysqldump.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92B}" ProjectSection(ProjectDependencies) = postProject {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} @@ -505,6 +541,28 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Debug.ActiveCfg = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Debug.Build.0 = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Classic.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Pro.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Release.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.ActiveCfg = Release|Win32 @@ -549,6 +607,28 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic.ActiveCfg = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic.Build.0 = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.Build.0 = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Classic.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Pro.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.Build.0 = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.Build.0 = classic|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.ActiveCfg = Release|Win32 @@ -619,6 +699,28 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic.Build.0 = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Debug.Build.0 = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Pro.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.Build.0 = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.Build.0 = classic|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.ActiveCfg = Release|Win32 @@ -795,6 +897,46 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.Build.0 = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.Build.0 = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.Build.0 = classic|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.ActiveCfg = classic|Win32 diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.vcproj b/VC++Files/mysqlshutdown/mysqlshutdown.vcproj new file mode 100644 index 00000000000..60b6a810b61 --- /dev/null +++ b/VC++Files/mysqlshutdown/mysqlshutdown.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqlwatch/mysqlwatch.vcproj b/VC++Files/mysqlwatch/mysqlwatch.vcproj new file mode 100644 index 00000000000..b922ed921bc --- /dev/null +++ b/VC++Files/mysqlwatch/mysqlwatch.vcproj @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/pack_isam/pack_isam.vcproj b/VC++Files/pack_isam/pack_isam.vcproj new file mode 100644 index 00000000000..15a47439924 --- /dev/null +++ b/VC++Files/pack_isam/pack_isam.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 215ecd332246b0922e9f2736fbbf950b2fa5b788 Mon Sep 17 00:00:00 2001 From: "eric@mysql.com" <> Date: Mon, 10 Oct 2005 17:41:36 -0700 Subject: [PATCH 051/322] BUG#13724 conditionally added CONNECTION='connect string' for SHOW CREATE TABLE --- mysql-test/r/federated.result | 6 ++++++ mysql-test/t/federated.test | 2 ++ sql/sql_show.cc | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index e0e0bba3271..f40919a41a4 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -74,6 +74,12 @@ CREATE TABLE federated.t2 ( ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +SHOW CREATE TABLE federated.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(20) NOT NULL, + `name` varchar(32) NOT NULL default '' +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1' INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); SELECT * FROM federated.t2; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index c401468a940..453343e6f09 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -75,6 +75,8 @@ eval CREATE TABLE federated.t2 ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; +SHOW CREATE TABLE federated.t2; + INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2d98e834de7..807b72595db 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1023,6 +1023,11 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet) packet->append(" COMMENT=", 9); append_unescaped(packet, share->comment, strlen(share->comment)); } + if (share->connect_string.length) + { + packet->append(" CONNECTION=", 12); + append_unescaped(packet, share->connect_string.str, share->connect_string.length); + } if (file->raid_type) { uint length; From 083c032ec3866697900d504e8e0c0c39da1a59a3 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 10 Oct 2005 19:39:16 -0700 Subject: [PATCH 052/322] Fix minimum value of query_prealloc_size to be the same as its default. (Bug #13334) --- mysql-test/r/variables.result | 5 +++++ mysql-test/t/variables.test | 10 +++++++++- sql/mysqld.cc | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 67c78d82a24..0aa7ea7f83c 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -499,3 +499,8 @@ set names latin1; select @@have_innodb; @@have_innodb # +set @test = @@query_prealloc_size; +set @@query_prealloc_size = @test; +select @@query_prealloc_size = @test; +@@query_prealloc_size = @test +1 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a8844070207..8322c0f84bd 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -388,7 +388,6 @@ set character_set_results=NULL; select ifnull(@@character_set_results,"really null"); set names latin1; -# End of 4.1 tests # # Bug #9613: @@have_innodb @@ -396,3 +395,12 @@ set names latin1; --replace_column 1 # select @@have_innodb; + +# +# Bug #13334: query_prealloc_size default less than minimum +# +set @test = @@query_prealloc_size; +set @@query_prealloc_size = @test; +select @@query_prealloc_size = @test; + +# End of 4.1 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6a91ac32ee..4d5a85e3fdc 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5280,7 +5280,8 @@ The minimum value for this variable is 4096.", "Persistent buffer for query parsing and execution", (gptr*) &global_system_variables.query_prealloc_size, (gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 16384, ~0L, 0, 1024, 0}, + REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE, + ~0L, 0, 1024, 0}, {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, "Allocation block size for storing ranges during optimization", (gptr*) &global_system_variables.range_alloc_block_size, From 735f424b5ca7a150f5025d0f5c9c0b88beab9494 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Tue, 11 Oct 2005 12:09:38 +0500 Subject: [PATCH 053/322] Bug#12547: Inserting long string into varchar causes table crash in cp932 ctype-cp932.c: Decrement for "pos" variable disappered somehow. Restoring it back. ctype_cp932.test: ctype_cp932.result: Adding test case. --- mysql-test/r/ctype_cp932.result | 17 +++++++++++++++++ mysql-test/t/ctype_cp932.test | 10 ++++++++++ strings/ctype-cp932.c | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/ctype_cp932.result index 08206a91b7b..1afceb86381 100755 --- a/mysql-test/r/ctype_cp932.result +++ b/mysql-test/r/ctype_cp932.result @@ -11349,3 +11349,20 @@ cp932_bin 6109 cp932_bin 61 cp932_bin 6120 drop table t1; +create table t1 (col1 varchar(1)) character set cp932; +insert into t1 values ('a'); +insert into t1 values ('ab'); +Warnings: +Warning 1265 Data truncated for column 'col1' at row 1 +select * from t1; +col1 +a +a +insert into t1 values ('abc'); +Warnings: +Warning 1265 Data truncated for column 'col1' at row 1 +select * from t1; +col1 +a +a +a diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/t/ctype_cp932.test index 3d630311b3a..082786e38af 100644 --- a/mysql-test/t/ctype_cp932.test +++ b/mysql-test/t/ctype_cp932.test @@ -424,3 +424,13 @@ SET collation_connection='cp932_japanese_ci'; -- source include/ctype_filesort.inc SET collation_connection='cp932_bin'; -- source include/ctype_filesort.inc + +# +# Bug#12547: Inserting long string into varchar causes table crash in cp932 +# +create table t1 (col1 varchar(1)) character set cp932; +insert into t1 values ('a'); +insert into t1 values ('ab'); +select * from t1; +insert into t1 values ('abc'); +select * from t1; diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index b5f36c030bd..3e5403446ce 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -5417,7 +5417,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)), { const char *b0= b; *error= 0; - while (pos && b < e) + while (pos-- && b < e) { /* Cast to int8 for extra safety. From 8d01ea1be76d87bed416778ea842175acf126834 Mon Sep 17 00:00:00 2001 From: "gluh@eagle.intranet.mysql.r18.ru" <> Date: Tue, 11 Oct 2005 16:26:00 +0500 Subject: [PATCH 054/322] Fix for bug#9270 multiple SSL race conditions (for 5.0 tree) The fix is needed to perform locking on shared data structures This is modification of patch proposed by Leandro Santi (see http://webs.sinectis.com.ar/lesanti/misc/mysql-4.0.23a-openssl_locking.patch) --- sql/mysqld.cc | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6a91ac32ee..55077b22320 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -514,8 +514,22 @@ HANDLE smem_event_connect_request= 0; #include "sslopt-vars.h" #ifdef HAVE_OPENSSL +#include + +typedef struct CRYPTO_dynlock_value +{ + rw_lock_t lock; +} openssl_lock_t; + char *des_key_file; struct st_VioSSLAcceptorFd *ssl_acceptor_fd; +static openssl_lock_t *openssl_stdlocks; + +static openssl_lock_t *openssl_dynlock_create(const char *, int); +static void openssl_dynlock_destroy(openssl_lock_t *, const char *, int); +static void openssl_lock_function(int, int, const char *, int); +static void openssl_lock(int, openssl_lock_t *, const char *, int); +static unsigned long openssl_id_function(); #endif /* HAVE_OPENSSL */ @@ -1097,6 +1111,9 @@ static void clean_up_mutexes() (void) pthread_mutex_destroy(&LOCK_user_conn); #ifdef HAVE_OPENSSL (void) pthread_mutex_destroy(&LOCK_des_key_file); + for (int i= 0; i < CRYPTO_num_locks(); ++i) + (void) rwlock_destroy(&openssl_stdlocks[i].lock); + OPENSSL_free(openssl_stdlocks); #endif #ifdef HAVE_REPLICATION (void) pthread_mutex_destroy(&LOCK_rpl_status); @@ -2675,10 +2692,90 @@ static int init_thread_environment() sql_print_error("Can't create thread-keys"); return 1; } +#ifdef HAVE_OPENSSL + openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * + sizeof(openssl_lock_t)); + for (int i= 0; i < CRYPTO_num_locks(); ++i) + (void) my_rwlock_init(&openssl_stdlocks[i].lock, NULL); + CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); + CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); + CRYPTO_set_dynlock_lock_callback(openssl_lock); + CRYPTO_set_locking_callback(openssl_lock_function); + CRYPTO_set_id_callback(openssl_id_function); +#endif return 0; } +#ifdef HAVE_OPENSSL +static unsigned long openssl_id_function() +{ + return (unsigned long) pthread_self(); +} + + +static openssl_lock_t *openssl_dynlock_create(const char *file, int line) +{ + openssl_lock_t *lock= new openssl_lock_t; + my_rwlock_init(&lock->lock, NULL); + return lock; +} + + +static void openssl_dynlock_destroy(openssl_lock_t *lock, const char *file, + int line) +{ + rwlock_destroy(&lock->lock); + delete lock; +} + + +static void openssl_lock_function(int mode, int n, const char *file, int line) +{ + if (n < 0 || n > CRYPTO_num_locks()) + { + /* Lock number out of bounds. */ + sql_print_error("Fatal: OpenSSL interface problem (n = %d)", n); + abort(); + } + openssl_lock(mode, &openssl_stdlocks[n], file, line); +} + + +static void openssl_lock(int mode, openssl_lock_t *lock, const char *file, + int line) +{ + int err; + char const *what; + + switch (mode) { + case CRYPTO_LOCK|CRYPTO_READ: + what = "read lock"; + err = rw_rdlock(&lock->lock); + break; + case CRYPTO_LOCK|CRYPTO_WRITE: + what = "write lock"; + err = rw_wrlock(&lock->lock); + break; + case CRYPTO_UNLOCK|CRYPTO_READ: + case CRYPTO_UNLOCK|CRYPTO_WRITE: + what = "unlock"; + err = rw_unlock(&lock->lock); + break; + default: + /* Unknown locking mode. */ + sql_print_error("Fatal: OpenSSL interface problem (mode=0x%x)", mode); + abort(); + } + if (err) + { + sql_print_error("Fatal: can't %s OpenSSL %s lock", what); + abort(); + } +} +#endif /* HAVE_OPENSSL */ + + static void init_ssl() { #ifdef HAVE_OPENSSL From cb7d5f4488104771fe043d3ebc5d355c6c8890fc Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 11 Oct 2005 16:39:35 +0500 Subject: [PATCH 055/322] Merging --- mysql-test/r/type_float.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 21886609b5c..c10cb7d71f7 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -225,10 +225,6 @@ select * from t1 where reckey=1.09E2; reckey recdesc 109 Has 109 as key drop table t1; -create table t1 (s1 float(0,2)); -ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). -create table t1 (s1 float(1,2)); -ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (d double(10,1)); create table t2 (d double(10,9)); insert into t1 values ("100000000.0"); @@ -244,3 +240,7 @@ t3 CREATE TABLE `t3` ( `d` double(22,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; +create table t1 (s1 float(0,2)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). +create table t1 (s1 float(1,2)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). From d99146ce2cfc202788b519050b4e5628e01e99fe Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Tue, 11 Oct 2005 16:56:42 +0500 Subject: [PATCH 056/322] complete.c: Fixed compilation problem on FreeBSD, after discussion with Jani. Doesn't FreeBSD follow the standard? --- cmd-line-utils/readline/complete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 41ea22d815e..df0a698b81f 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -21,7 +21,7 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#ifndef _XOPEN_SOURCE +#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) #define _XOPEN_SOURCE 500 #endif From 554970c058fc7d8c0c4e1f2a4147e3363cc9d3ff Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Tue, 11 Oct 2005 15:01:24 +0200 Subject: [PATCH 057/322] To help people avoid BUG#2122 "changing hostname confuses master or slave" until it's fixed, we now issue a warning (at slave's server startup only) when a relay log is named using the implicit hostname-relay-bin naming. Like we already do for binlogs. --- sql/slave.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sql/slave.cc b/sql/slave.cc index 0e810b798f9..45f71826ebd 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1722,9 +1722,26 @@ static int init_relay_log_info(RELAY_LOG_INFO* rli, { char buf[FN_REFLEN]; const char *ln; + static bool name_warning_sent= 0; ln= rli->relay_log.generate_name(opt_relay_logname, "-relay-bin", 1, buf); - + /* We send the warning only at startup, not after every RESET SLAVE */ + if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent) + { + /* + User didn't give us info to name the relay log index file. + Picking `hostname`-relay-bin.index like we do, causes replication to + fail if this slave's hostname is changed later. So, we would like to + instead require a name. But as we don't want to break many existing + setups, we only give warning, not error. + */ + sql_print_warning("Neither --relay-log nor --relay-log-index were used;" + " so replication " + "may break when this MySQL server acts as a " + "slave and has his hostname changed!! Please " + "use '--relay-log=%s' to avoid this problem.", ln); + name_warning_sent= 1; + } /* note, that if open() fails, we'll still have index file open but a destructor will take care of that From 2456c0c6684668fc0f4675c56e061677b63464b0 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Tue, 11 Oct 2005 15:01:38 +0200 Subject: [PATCH 058/322] Fixed BUG#13510: Setting password local variable changes current password Disallow conflicting use of variables named "password" and "names". If such a variable is declared, and "SET ... = ..." is used for them, an error is returned; the user must resolve the conflict by either using `var` (indicating that the local variable is set) or by renaming the variable. This is necessary since setting "password" and "names" are treated as special cases by the parser. --- mysql-test/r/sp-error.result | 38 ++++++++++++++++++++++++++ mysql-test/t/sp-error.test | 53 ++++++++++++++++++++++++++++++++++++ sql/share/errmsg.txt | 2 ++ sql/sql_yacc.yy | 23 ++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 05b6a2788ea..43430ca312b 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -834,3 +834,41 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger create trigger bug12712 before insert on t1 for each row set session autocommit = 0; ERROR HY000: Not allowed to set autocommit from a stored function or trigger +drop procedure if exists bug13510_1| +drop procedure if exists bug13510_2| +drop procedure if exists bug13510_3| +drop procedure if exists bug13510_4| +create procedure bug13510_1() +begin +declare password varchar(10); +set password = 'foo1'; +select password; +end| +ERROR 42000: Variable 'password' must be quoted with `...`, or renamed +create procedure bug13510_2() +begin +declare names varchar(10); +set names = 'foo2'; +select names; +end| +ERROR 42000: Variable 'names' must be quoted with `...`, or renamed +create procedure bug13510_3() +begin +declare password varchar(10); +set `password` = 'foo3'; +select password; +end| +create procedure bug13510_4() +begin +declare names varchar(10); +set `names` = 'foo4'; +select names; +end| +call bug13510_3()| +password +foo3 +call bug13510_4()| +names +foo4 +drop procedure bug13510_3| +drop procedure bug13510_4| diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index fa74c318db3..b3caa093487 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1212,6 +1212,59 @@ call bug9367(); drop procedure bug9367; drop table t1; --enable_parsing + +# +# BUG#13510: Setting password local variable changes current password +# +delimiter |; +--disable_warnings +drop procedure if exists bug13510_1| +drop procedure if exists bug13510_2| +drop procedure if exists bug13510_3| +drop procedure if exists bug13510_4| +--enable_warnings + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_1() +begin + declare password varchar(10); + + set password = 'foo1'; + select password; +end| + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_2() +begin + declare names varchar(10); + + set names = 'foo2'; + select names; +end| + +create procedure bug13510_3() +begin + declare password varchar(10); + + set `password` = 'foo3'; + select password; +end| + +create procedure bug13510_4() +begin + declare names varchar(10); + + set `names` = 'foo4'; + select names; +end| + +call bug13510_3()| +call bug13510_4()| + +drop procedure bug13510_3| +drop procedure bug13510_4| +delimiter ;| + # # BUG#NNNN: New bug synopsis # diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 10f0d0691d1..ccf11248a1f 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5420,3 +5420,5 @@ ER_ROW_IS_REFERENCED_2 23000 eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" ER_NO_REFERENCED_ROW_2 23000 eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)" +ER_SP_BAD_VAR_SHADOW 42000 + eng "Variable '%-.64s' must be quoted with `...`, or renamed" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f28fbe5c803..447530d633b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7992,6 +7992,18 @@ option_value: $2= $2 ? $2: global_system_variables.character_set_client; lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2)); } + | NAMES_SYM equal expr + { + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + LEX_STRING names; + + names.str= (char *)"names"; + names.length= 5; + if (spc && spc->find_pvar(&names)) + my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), names.str); + YYABORT; + } | NAMES_SYM charset_name_or_default opt_collate { LEX *lex= Lex; @@ -8009,6 +8021,17 @@ option_value: { THD *thd=YYTHD; LEX_USER *user; + LEX *lex= Lex; + sp_pcontext *spc= lex->spcont; + LEX_STRING pw; + + pw.str= (char *)"password"; + pw.length= 8; + if (spc && spc->find_pvar(&pw)) + { + my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str); + YYABORT; + } if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER)))) YYABORT; user->host=null_lex_str; From 2b0a3b478043805978918126efec1b8bad45f73c Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Tue, 11 Oct 2005 15:48:07 +0200 Subject: [PATCH 059/322] Bug #9249 NDBD crashes when mapping SHM segment w/o correct permission --- ndb/include/mgmapi/ndbd_exit_codes.h | 1 + .../transporter/TransporterCallback.hpp | 72 ++++++++------ .../common/transporter/SHM_Transporter.cpp | 22 +++-- .../common/transporter/SHM_Transporter.hpp | 2 + .../transporter/SHM_Transporter.unix.cpp | 28 +++++- .../transporter/SHM_Transporter.win32.cpp | 6 ++ ndb/src/common/transporter/Transporter.hpp | 3 +- .../transporter/TransporterRegistry.cpp | 4 +- ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 10 ++ ndb/src/kernel/error/ndbd_exit_codes.c | 1 + ndb/src/kernel/vm/FastScheduler.cpp | 15 +-- ndb/src/kernel/vm/TransporterCallback.cpp | 94 +++++++++++++++---- ndb/src/kernel/vm/VMSignal.hpp | 10 ++ ndb/src/mgmsrv/ConfigInfo.cpp | 5 +- ndb/src/ndbapi/TransporterFacade.cpp | 13 ++- 15 files changed, 208 insertions(+), 78 deletions(-) diff --git a/ndb/include/mgmapi/ndbd_exit_codes.h b/ndb/include/mgmapi/ndbd_exit_codes.h index 794329ce637..4cb3fa7cde3 100644 --- a/ndb/include/mgmapi/ndbd_exit_codes.h +++ b/ndb/include/mgmapi/ndbd_exit_codes.h @@ -100,6 +100,7 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification; #define NDBD_EXIT_SIGNAL_LOST 6051 #define NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL 6052 #define NDBD_EXIT_ILLEGAL_SIGNAL 6053 +#define NDBD_EXIT_CONNECTION_SETUP_FAILED 6054 /* NDBCNTR 6100-> */ #define NDBD_EXIT_RESTART_TIMEOUT 6100 diff --git a/ndb/include/transporter/TransporterCallback.hpp b/ndb/include/transporter/TransporterCallback.hpp index f2432edd394..ef9be8c5a69 100644 --- a/ndb/include/transporter/TransporterCallback.hpp +++ b/ndb/include/transporter/TransporterCallback.hpp @@ -81,7 +81,9 @@ reportConnect(void * callbackObj, NodeId nodeId); void reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo); - + +#define TE_DO_DISCONNECT 0x8000 + enum TransporterError { TE_NO_ERROR = 0, /** @@ -111,7 +113,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisconnect) */ - TE_INVALID_MESSAGE_LENGTH = 0x8003, + TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT, /** * TE_INVALID_CHECKSUM @@ -120,7 +122,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - TE_INVALID_CHECKSUM = 0x8004, + TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT, /** * TE_COULD_NOT_CREATE_SOCKET @@ -129,7 +131,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - TE_COULD_NOT_CREATE_SOCKET = 0x8005, + TE_COULD_NOT_CREATE_SOCKET = 0x5, /** * TE_COULD_NOT_BIND_SOCKET @@ -138,7 +140,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - TE_COULD_NOT_BIND_SOCKET = 0x8006, + TE_COULD_NOT_BIND_SOCKET = 0x6, /** * TE_LISTEN_FAILED @@ -147,7 +149,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - TE_LISTEN_FAILED = 0x8007, + TE_LISTEN_FAILED = 0x7, /** * TE_ACCEPT_RETURN_ERROR @@ -158,7 +160,7 @@ enum TransporterError { * Recommended behavior: Ignore * (or possible do setPerformState(PerformDisconnect) */ - TE_ACCEPT_RETURN_ERROR = 0x8008 + TE_ACCEPT_RETURN_ERROR = 0x8 /** * TE_SHM_DISCONNECT @@ -167,7 +169,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SHM_DISCONNECT = 0x800b + ,TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT /** * TE_SHM_IPC_STAT @@ -178,7 +180,12 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SHM_IPC_STAT = 0x800c + ,TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT + + /** + * Permanent error + */ + ,TE_SHM_IPC_PERMANENT = 0x21 /** * TE_SHM_UNABLE_TO_CREATE_SEGMENT @@ -188,7 +195,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0x800d + ,TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd /** * TE_SHM_UNABLE_TO_ATTACH_SEGMENT @@ -198,7 +205,7 @@ enum TransporterError { * * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0x800e + ,TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe /** * TE_SHM_UNABLE_TO_REMOVE_SEGMENT @@ -208,12 +215,12 @@ enum TransporterError { * Recommended behavior: Ignore (not much to do) * Print warning to logfile */ - ,TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0x800f + ,TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf - ,TE_TOO_SMALL_SIGID = 0x0010 - ,TE_TOO_LARGE_SIGID = 0x0011 - ,TE_WAIT_STACK_FULL = 0x8012 - ,TE_RECEIVE_BUFFER_FULL = 0x8013 + ,TE_TOO_SMALL_SIGID = 0x10 + ,TE_TOO_LARGE_SIGID = 0x11 + ,TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT + ,TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT /** * TE_SIGNAL_LOST_SEND_BUFFER_FULL @@ -222,7 +229,7 @@ enum TransporterError { * a signal is dropped!! very bad very bad * */ - ,TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x8014 + ,TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT /** * TE_SIGNAL_LOST @@ -231,14 +238,14 @@ enum TransporterError { * a signal is dropped!! very bad very bad * */ - ,TE_SIGNAL_LOST = 0x8015 + ,TE_SIGNAL_LOST = 0x15 /** * TE_SEND_BUFFER_FULL * * The send buffer was full, but sleeping for a while solved it */ - ,TE_SEND_BUFFER_FULL = 0x0016 + ,TE_SEND_BUFFER_FULL = 0x16 /** * TE_SCI_UNABLE_TO_CLOSE_CHANNEL @@ -246,7 +253,7 @@ enum TransporterError { * Unable to close the sci channel and the resources allocated by * the sisci api. */ - ,TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x8016 + ,TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22 /** * TE_SCI_LINK_ERROR @@ -255,7 +262,7 @@ enum TransporterError { * No point in continuing. Must check the connections. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_LINK_ERROR = 0x8017 + ,TE_SCI_LINK_ERROR = 0x0017 /** * TE_SCI_UNABLE_TO_START_SEQUENCE @@ -264,14 +271,14 @@ enum TransporterError { * are exumed or no sequence has been created. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNABLE_TO_START_SEQUENCE = 0x8018 + ,TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT /** * TE_SCI_UNABLE_TO_REMOVE_SEQUENCE * * Could not remove a sequence */ - ,TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x8019 + ,TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT /** * TE_SCI_UNABLE_TO_CREATE_SEQUENCE @@ -280,7 +287,7 @@ enum TransporterError { * exempted. Must reboot. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x801a + ,TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT /** * TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR @@ -288,7 +295,7 @@ enum TransporterError { * Tried to send data on redundant link but failed. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x801b + ,TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT /** * TE_SCI_CANNOT_INIT_LOCALSEGMENT @@ -297,7 +304,7 @@ enum TransporterError { * gone wrong (no system resources). Must reboot. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x801c + ,TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT /** * TE_SCI_CANNOT_MAP_REMOTESEGMENT @@ -306,7 +313,7 @@ enum TransporterError { * Must reboot system. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x801d + ,TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNECT /** * TE_SCI_UNABLE_TO_UNMAP_SEGMENT @@ -314,7 +321,7 @@ enum TransporterError { * Cannot free the resources used by this segment (step 1). * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x801e + ,TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT /** * TE_SCI_UNABLE_TO_REMOVE_SEGMENT @@ -324,7 +331,7 @@ enum TransporterError { * to map more segment * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x801f + ,TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNECT /** * TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT @@ -332,15 +339,18 @@ enum TransporterError { * Cannot disconnect from a remote segment. * Recommended behavior: setPerformState(PerformDisonnect) */ - ,TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x8020 + ,TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT + /* Used 0x21 */ + /* Used 0x22 */ }; /** * Report error */ void -reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode); +reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode, + const char *info = 0); void transporter_recv_from(void* callbackObj, NodeId node); diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index a225988d37f..93d718b8713 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -47,6 +47,9 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, shmKey(_shmKey), shmSize(_shmSize) { +#ifndef NDB_WIN32 + shmId= 0; +#endif _shmSegCreated = false; _attached = false; @@ -202,7 +205,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) // Create if(!_shmSegCreated){ if (!ndb_shm_create()) { - report_error(TE_SHM_UNABLE_TO_CREATE_SEGMENT); + make_error_info(buf, sizeof(buf)); + report_error(TE_SHM_UNABLE_TO_CREATE_SEGMENT, buf); NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } @@ -212,7 +216,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) // Attach if(!_attached){ if (!ndb_shm_attach()) { - report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT); + make_error_info(buf, sizeof(buf)); + report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT, buf); NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } @@ -224,7 +229,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) m_transporter_registry.m_shm_own_pid); // Wait for ok from client - if (s_input.gets(buf, 256) == 0) + DBUG_PRINT("info", ("Wait for ok from client")); + if (s_input.gets(buf, sizeof(buf)) == 0) { NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); @@ -262,10 +268,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) SocketOutputStream s_output(sockfd); char buf[256]; -#if 1 -#endif - // Wait for server to create and attach + DBUG_PRINT("info", ("Wait for server to create and attach")); if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); DBUG_PRINT("error", ("Server id %d did not attach", @@ -293,7 +297,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) // Attach if(!_attached){ if (!ndb_shm_attach()) { - report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT); + make_error_info(buf, sizeof(buf)); + report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT, buf); NDB_CLOSE_SOCKET(sockfd); DBUG_PRINT("error", ("Failed attach of shm seg to node %d", remoteNodeId)); @@ -310,6 +315,7 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) if (r) { // Wait for ok from server + DBUG_PRINT("info", ("Wait for ok from server")); if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); DBUG_PRINT("error", ("No ok from server node %d", @@ -330,8 +336,6 @@ bool SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd) { if (!checkConnected()) { - DBUG_PRINT("error", ("Already connected to node %d", - remoteNodeId)); return false; } diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index e7a76225471..b25f9e538db 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -170,6 +170,8 @@ private: bool hasDataToRead() const { return reader->empty() == false; } + + void make_error_info(char info[], int sz); }; #endif diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp index 28882324fc0..7277f9e13ef 100644 --- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp @@ -26,6 +26,12 @@ #include #include +void SHM_Transporter::make_error_info(char info[], int sz) +{ + snprintf(info,sz,"Shm key=%d sz=%d id=%d", + shmKey, shmSize, shmId); +} + bool SHM_Transporter::ndb_shm_create() { @@ -64,12 +70,30 @@ SHM_Transporter::checkConnected(){ struct shmid_ds info; const int res = shmctl(shmId, IPC_STAT, &info); if(res == -1){ - report_error(TE_SHM_IPC_STAT); + char buf[128]; + int r= snprintf(buf, sizeof(buf), + "shmctl(%d, IPC_STAT) errno: %d(%s). ", shmId, + errno, strerror(errno)); + make_error_info(buf+r, sizeof(buf)-r); + DBUG_PRINT("error",(buf)); + switch (errno) + { + case EACCES: + report_error(TE_SHM_IPC_PERMANENT, buf); + break; + default: + report_error(TE_SHM_IPC_STAT, buf); + break; + } return false; } if(info.shm_nattch != 2){ + char buf[128]; + make_error_info(buf, sizeof(buf)); report_error(TE_SHM_DISCONNECT); + DBUG_PRINT("error", ("Already connected to node %d", + remoteNodeId)); return false; } return true; @@ -91,6 +115,8 @@ SHM_Transporter::disconnectImpl(){ if(isServer && _shmSegCreated){ const int res = shmctl(shmId, IPC_RMID, 0); if(res == -1){ + char buf[64]; + make_error_info(buf, sizeof(buf)); report_error(TE_SHM_UNABLE_TO_REMOVE_SEGMENT); return; } diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp index c289a85da0e..86029b17885 100644 --- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp @@ -26,6 +26,12 @@ #include +void SHM_Transporter::make_error_info(char info[], int sz) +{ + snprintf(info,sz,"Shm key=%d sz=%d", + shmKey, shmSize); +} + bool SHM_Transporter::connectServer(Uint32 timeOutMillis){ if(!_shmSegCreated) diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index c9f4e9bda42..9e8bbd687ee 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -161,7 +161,8 @@ protected: TransporterRegistry &m_transporter_registry; void *get_callback_obj() { return m_transporter_registry.callbackObj; }; void report_disconnect(int err){m_transporter_registry.report_disconnect(remoteNodeId,err);}; - void report_error(enum TransporterError err){reportError(get_callback_obj(),remoteNodeId,err);}; + void report_error(enum TransporterError err, const char *info = 0) + { reportError(get_callback_obj(), remoteNodeId, err, info); }; }; inline diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 3937f1fc98b..f0e50729f8d 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1508,8 +1508,8 @@ TransporterRegistry::startReceiving() { DBUG_PRINT("error",("Install failed")); g_eventLogger.error("Failed to install signal handler for" - " SHM transporter errno: %d (%s)", errno, - strerror(errno)); + " SHM transporter, signum %d, errno: %d (%s)", + g_ndb_shm_signum, errno, strerror(errno)); } } #endif // NDB_SHM_TRANSPORTER diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 0da7ac95309..7003d70e8b1 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -1823,11 +1823,14 @@ void Qmgr::execNDB_FAILCONF(Signal* signal) /*******************************/ /* DISCONNECT_REP */ /*******************************/ +const char *lookupConnectionError(Uint32 err); + void Qmgr::execDISCONNECT_REP(Signal* signal) { jamEntry(); const DisconnectRep * const rep = (DisconnectRep *)&signal->theData[0]; const Uint32 nodeId = rep->nodeId; + const Uint32 err = rep->err; c_connectedNodes.clear(nodeId); NodeRecPtr nodePtr; @@ -1838,10 +1841,17 @@ void Qmgr::execDISCONNECT_REP(Signal* signal) jam(); break; case ZINIT: + ndbrequire(false); case ZSTARTING: + progError(__LINE__, NDBD_EXIT_CONNECTION_SETUP_FAILED, + lookupConnectionError(err)); + ndbrequire(false); case ZPREPARE_FAIL: + ndbrequire(false); case ZFAIL_CLOSING: + ndbrequire(false); case ZAPI_ACTIVE: + ndbrequire(false); case ZAPI_INACTIVE: ndbrequire(false); } diff --git a/ndb/src/kernel/error/ndbd_exit_codes.c b/ndb/src/kernel/error/ndbd_exit_codes.c index 4d9a61d69d1..d4592f7ff82 100644 --- a/ndb/src/kernel/error/ndbd_exit_codes.c +++ b/ndb/src/kernel/error/ndbd_exit_codes.c @@ -95,6 +95,7 @@ static const ErrStruct errArray[] = {NDBD_EXIT_SIGNAL_LOST, XIE, "Signal lost (unknown reason)"}, {NDBD_EXIT_ILLEGAL_SIGNAL, XIE, "Illegal signal (version mismatch a possibility)"}, + {NDBD_EXIT_CONNECTION_SETUP_FAILED, XCE, "Connection setup failed"}, /* Ndbcntr */ {NDBD_EXIT_RESTART_TIMEOUT, XCE, diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp index 5c68cbe6480..ad24a6795a4 100644 --- a/ndb/src/kernel/vm/FastScheduler.cpp +++ b/ndb/src/kernel/vm/FastScheduler.cpp @@ -394,7 +394,8 @@ void print_restart(FILE * output, Signal* signal, Uint32 aLevel); void FastScheduler::dumpSignalMemory(FILE * output) { - Signal signal; + SignalT<25> signalT; + Signal &signal= *(Signal*)&signalT; Uint32 ReadPtr[5]; Uint32 tJob; Uint32 tLastJob; @@ -483,17 +484,17 @@ print_restart(FILE * output, Signal* signal, Uint32 aLevel) */ void FastScheduler::reportDoJobStatistics(Uint32 tMeanLoopCount) { - Signal signal; + SignalT<2> signalT; + Signal &signal= *(Signal*)&signalT; + memset(&signal.header, 0, sizeof(signal.header)); + signal.header.theLength = 2; + signal.header.theSendersSignalId = 0; + signal.header.theSendersBlockRef = numberToRef(0, 0); signal.theData[0] = NDB_LE_JobStatistic; signal.theData[1] = tMeanLoopCount; - memset(&signal.header, 0, sizeof(SignalHeader)); - signal.header.theLength = 2; - signal.header.theSendersSignalId = 0; - signal.header.theSendersBlockRef = numberToRef(0, 0); - execute(&signal, JBA, CMVMI, GSN_EVENT_REP); } diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index 0bdfcf16689..4ce460c1d94 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -39,6 +39,26 @@ */ SectionSegmentPool g_sectionSegmentPool; +struct ConnectionError +{ + enum TransporterError err; + const char *text; +}; + +static const ConnectionError connectionError[] = +{ + { TE_NO_ERROR, "No error"}, + { TE_SHM_UNABLE_TO_CREATE_SEGMENT, "Unable to create shared memory segment"}, + { (enum TransporterError) -1, "No connection error message available (please report a bug)"} +}; + +const char *lookupConnectionError(Uint32 err) +{ + int i= 0; + while ((Uint32)connectionError[i].err != err && (Uint32)connectionError[i].err != -1); + return connectionError[i].text; +} + bool import(Ptr & first, const Uint32 * src, Uint32 len){ /** @@ -306,30 +326,54 @@ checkJobBuffer() { } void -reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){ +reportError(void * callbackObj, NodeId nodeId, + TransporterError errorCode, const char *info) +{ #ifdef DEBUG_TRANSPORTER - char buf[255]; - sprintf(buf, "reportError (%d, 0x%x)", nodeId, errorCode); - ndbout << buf << endl; + ndbout_c("reportError (%d, 0x%x) %s", nodeId, errorCode, info ? info : "") #endif - if(errorCode == TE_SIGNAL_LOST_SEND_BUFFER_FULL){ - ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, - "", __FILE__, - NST_ErrorHandler); - } + DBUG_ENTER("reportError"); + DBUG_PRINT("info",("nodeId %d errorCode: 0x%x info: %s", + nodeId, errorCode, info)); - if(errorCode == TE_SIGNAL_LOST){ - ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST, - "", __FILE__, - NST_ErrorHandler); + switch (errorCode) + { + case TE_SIGNAL_LOST_SEND_BUFFER_FULL: + { + char msg[64]; + snprintf(msg, sizeof(msg), "Remote note id %d.%s%s", nodeId, + info ? " " : "", info ? info : ""); + ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, + msg, __FILE__, NST_ErrorHandler); } - - if(errorCode & 0x8000){ + case TE_SIGNAL_LOST: + { + char msg[64]; + snprintf(msg, sizeof(msg), "Remote node id %d,%s%s", nodeId, + info ? " " : "", info ? info : ""); + ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST, + msg, __FILE__, NST_ErrorHandler); + } + case TE_SHM_IPC_PERMANENT: + { + char msg[128]; + snprintf(msg, sizeof(msg), + "Remote node id %d.%s%s", + nodeId, info ? " " : "", info ? info : ""); + ErrorReporter::handleError(NDBD_EXIT_CONNECTION_SETUP_FAILED, + msg, __FILE__, NST_ErrorHandler); + } + default: + break; + } + + if(errorCode & & TE_DO_DISCONNECT){ reportDisconnect(callbackObj, nodeId, errorCode); } - Signal signal; + SignalT<3> signalT; + Signal &signal= *(Signal*)&signalT; memset(&signal.header, 0, sizeof(signal.header)); @@ -345,6 +389,8 @@ reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){ signal.header.theSendersSignalId = 0; signal.header.theSendersBlockRef = numberToRef(0, globalData.ownId); globalScheduler.execute(&signal, JBA, CMVMI, GSN_EVENT_REP); + + DBUG_VOID_RETURN; } /** @@ -354,7 +400,8 @@ void reportSendLen(void * callbackObj, NodeId nodeId, Uint32 count, Uint64 bytes){ - Signal signal; + SignalT<3> signalT; + Signal &signal= *(Signal*)&signalT; memset(&signal.header, 0, sizeof(signal.header)); signal.header.theLength = 3; @@ -373,7 +420,8 @@ void reportReceiveLen(void * callbackObj, NodeId nodeId, Uint32 count, Uint64 bytes){ - Signal signal; + SignalT<3> signalT; + Signal &signal= *(Signal*)&signalT; memset(&signal.header, 0, sizeof(signal.header)); signal.header.theLength = 3; @@ -392,7 +440,8 @@ reportReceiveLen(void * callbackObj, void reportConnect(void * callbackObj, NodeId nodeId){ - Signal signal; + SignalT<1> signalT; + Signal &signal= *(Signal*)&signalT; memset(&signal.header, 0, sizeof(signal.header)); signal.header.theLength = 1; @@ -409,7 +458,10 @@ reportConnect(void * callbackObj, NodeId nodeId){ void reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){ - Signal signal; + DBUG_ENTER("reportDisconnect"); + + SignalT signalT; + Signal &signal= *(Signal*)&signalT; memset(&signal.header, 0, sizeof(signal.header)); signal.header.theLength = DisconnectRep::SignalLength; @@ -422,6 +474,8 @@ reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){ rep->err = errNo; globalScheduler.execute(&signal, JBA, CMVMI, GSN_DISCONNECT_REP); + + DBUG_VOID_RETURN; } void diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp index 45543c5d174..33f8a9f25c0 100644 --- a/ndb/src/kernel/vm/VMSignal.hpp +++ b/ndb/src/kernel/vm/VMSignal.hpp @@ -42,6 +42,16 @@ struct NodeReceiverGroup { NodeBitmask m_nodes; }; +template struct SignalT +{ + SignalHeader header; + SegmentedSectionPtr m_sectionPtr[3]; + union { + Uint32 theData[T]; + Uint64 dummyAlign; + }; +}; + /** * class used for passing argumentes to blocks */ diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index a870c395bd2..98e5744fe32 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -150,7 +150,6 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixPortNumber, 0 }, // has to come after fixHostName { "SHM", fixPortNumber, 0 }, // has to come after fixHostName { "SCI", fixPortNumber, 0 }, // has to come after fixHostName - { "SHM", fixShmKey, 0 }, /** * fixExtConnection must be after fixNodeId @@ -164,6 +163,8 @@ ConfigInfo::m_SectionRules[] = { { "*", fixDepricated, 0 }, { "*", applyDefaultValues, "system" }, + { "SHM", fixShmKey, 0 }, // has to come after apply default values + { DB_TOKEN, checkLocalhostHostnameMix, 0 }, { API_TOKEN, checkLocalhostHostnameMix, 0 }, { MGM_TOKEN, checkLocalhostHostnameMix, 0 }, @@ -1798,7 +1799,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_USED, false, ConfigInfo::CI_INT, - "0", + UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 802e0785988..77750a3c3d0 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -63,13 +63,16 @@ TransporterFacade* TransporterFacade::theFacadeInstance = NULL; *****************************************************************************/ void -reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){ +reportError(void * callbackObj, NodeId nodeId, + TransporterError errorCode, const char *info) +{ #ifdef REPORT_TRANSPORTER - ndbout_c("REPORT_TRANSP: reportError (nodeId=%d, errorCode=%d)", - (int)nodeId, (int)errorCode); + ndbout_c("REPORT_TRANSP: reportError (nodeId=%d, errorCode=%d) %s", + (int)nodeId, (int)errorCode, info ? info : ""); #endif - if(errorCode & 0x8000) { - ndbout_c("reportError (%d, %d)\n", (int)nodeId, (int)errorCode); + if(errorCode & TE_DO_DISCONNECT) { + ndbout_c("reportError (%d, %d) %s", (int)nodeId, (int)errorCode, + info ? info : ""); ((TransporterFacade*)(callbackObj))->doDisconnect(nodeId); } } From c43121e253721829ab51faaceecb9d36fe7b8948 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Tue, 11 Oct 2005 15:51:39 +0200 Subject: [PATCH 060/322] corrected typo --- ndb/src/kernel/vm/TransporterCallback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index 4ce460c1d94..40dae89c379 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -368,7 +368,7 @@ reportError(void * callbackObj, NodeId nodeId, break; } - if(errorCode & & TE_DO_DISCONNECT){ + if(errorCode & TE_DO_DISCONNECT){ reportDisconnect(callbackObj, nodeId, errorCode); } From b78fa95d2a751e4397808b17ea21ae2c93328f98 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Tue, 11 Oct 2005 15:59:13 +0200 Subject: [PATCH 061/322] minor fix in ndb using a define --- ndb/src/kernel/vm/TransporterCallback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index 40dae89c379..aab81957d07 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -377,7 +377,7 @@ reportError(void * callbackObj, NodeId nodeId, memset(&signal.header, 0, sizeof(signal.header)); - if(errorCode & 0x8000) + if(errorCode & TE_DO_DISCONNECT) signal.theData[0] = NDB_LE_TransporterError; else signal.theData[0] = NDB_LE_TransporterWarning; From c8a6c2c6143dd8c92704920d455cc57050ce71ad Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Oct 2005 09:12:12 -0700 Subject: [PATCH 062/322] Fix wait_timeout (and kill) handling on Mac OS X by cleaning up how signal handlers are set up, the blocking flags for sockets are set, and which thread-related functions are used. (Bug #8731) --- configure.in | 16 +++--------- include/config-win.h | 2 +- include/my_pthread.h | 35 +++++++++++++++----------- mysql-test/r/wait_timeout.result | 8 ++++++ mysql-test/t/wait_timeout-master.opt | 1 + mysql-test/t/wait_timeout.test | 11 +++++++++ mysys/my_pthread.c | 17 ------------- mysys/thr_alarm.c | 24 ++++++------------ sql/mysqld.cc | 37 ++++------------------------ vio/vio.c | 16 +++++++++--- vio/viosocket.c | 9 ++++++- 11 files changed, 77 insertions(+), 99 deletions(-) create mode 100644 mysql-test/r/wait_timeout.result create mode 100644 mysql-test/t/wait_timeout-master.opt create mode 100644 mysql-test/t/wait_timeout.test diff --git a/configure.in b/configure.in index 97eb0cb0edf..44bfcb46746 100644 --- a/configure.in +++ b/configure.in @@ -1102,7 +1102,7 @@ case $SYSTEM_TYPE in *darwin5*) if test "$ac_cv_prog_gcc" = "yes" then - FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH" + FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH" CFLAGS="$CFLAGS $FLAGS" CXXFLAGS="$CXXFLAGS $FLAGS" MAX_C_OPTIMIZE="-O" @@ -1112,23 +1112,13 @@ case $SYSTEM_TYPE in *darwin6*) if test "$ac_cv_prog_gcc" = "yes" then - FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH" + FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH" CFLAGS="$CFLAGS $FLAGS" CXXFLAGS="$CXXFLAGS $FLAGS" MAX_C_OPTIMIZE="-O" fi ;; - *darwin[[7-8]]*) - # don't forget to escape [] like above - if test "$ac_cv_prog_gcc" = "yes" - then - FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - fi - ;; - *darwin9*) + *darwin*) if test "$ac_cv_prog_gcc" = "yes" then FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT" diff --git a/include/config-win.h b/include/config-win.h index 0899d961d14..9663947683e 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -192,7 +192,7 @@ typedef uint rf_SetTimer; /* Convert some simple functions to Posix */ -#define sigset(A,B) signal((A),(B)) +#define my_sigset(A,B) signal((A),(B)) #define finite(A) _finite(A) #define sleep(A) Sleep((A)*1000) #define popen(A) popen(A,B) _popen((A),(B)) diff --git a/include/my_pthread.h b/include/my_pthread.h index d83ddf62a80..b6b65d4389a 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -289,8 +289,6 @@ extern int my_pthread_create_detached; #undef HAVE_PTHREAD_RWLOCK_RDLOCK #undef HAVE_SNPRINTF -#define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) -#define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_pthread_attr_setprio(A,B) #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ @@ -322,14 +320,26 @@ extern int my_pthread_cond_init(pthread_cond_t *mp, #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif -#if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) -#define sigset(A,B) do { struct sigaction s; sigset_t set; \ - sigemptyset(&set); \ - s.sa_handler = (B); \ - s.sa_mask = set; \ - s.sa_flags = 0; \ - sigaction((A), &s, (struct sigaction *) NULL); \ - } while (0) + + +/* + We define my_sigset() and use that instead of the system sigset() so that + we can favor an implementation based on sigaction(). On some systems, such + as Mac OS X, sigset() results in flags such as SA_RESTART being set, and + we want to make sure that no such flags are set. +*/ +#if defined(HAVE_SIGACTION) && !defined(my_sigset) +#define my_sigset(A,B) do { struct sigaction s; sigset_t set; \ + sigemptyset(&set); \ + s.sa_handler = (B); \ + s.sa_mask = set; \ + s.sa_flags = 0; \ + sigaction((A), &s, (struct sigaction *) NULL); \ + } while (0) +#elif defined(HAVE_SIGSET) && !defined(my_sigset) +#define my_sigset(A,B) sigset((A),(B)) +#elif !defined(my_sigset) +#define my_sigset(A,B) signal((A),(B)) #endif #ifndef my_pthread_setprio @@ -409,16 +419,13 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #endif -#ifdef HAVE_DARWIN_THREADS +#ifdef HAVE_DARWIN5_THREADS #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_kill(A,B) pthread_dummy(0) #define pthread_condattr_init(A) pthread_dummy(0) #define pthread_condattr_destroy(A) pthread_dummy(0) -#define pthread_signal(A,B) pthread_dummy(0) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } -#undef sigset -#define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #endif #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) diff --git a/mysql-test/r/wait_timeout.result b/mysql-test/r/wait_timeout.result new file mode 100644 index 00000000000..56232e481c0 --- /dev/null +++ b/mysql-test/r/wait_timeout.result @@ -0,0 +1,8 @@ +select 1; +1 +1 +select 2; +ERROR HY000: MySQL server has gone away +select 3; +3 +3 diff --git a/mysql-test/t/wait_timeout-master.opt b/mysql-test/t/wait_timeout-master.opt new file mode 100644 index 00000000000..0ad622e9677 --- /dev/null +++ b/mysql-test/t/wait_timeout-master.opt @@ -0,0 +1 @@ +--wait-timeout=2 diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test new file mode 100644 index 00000000000..26f91569868 --- /dev/null +++ b/mysql-test/t/wait_timeout.test @@ -0,0 +1,11 @@ +# +# Bug #8731: wait_timeout does not work on Mac OS X +# +--disable_reconnect +select 1; +# wait_timeout is 2, so we should get disconnected now +--sleep 5 +--error 2006 +select 2; +--enable_reconnect +select 3; diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 37517fb8327..315e966bf43 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -404,23 +404,6 @@ int sigwait(sigset_t *setp, int *sigp) #endif /* DONT_USE_SIGSUSPEND */ #endif /* HAVE_SIGWAIT */ -/***************************************************************************** -** Implement pthread_signal for systems that can't use signal() with threads -** Currently this is only used with BSDI 3.0 -*****************************************************************************/ - -#ifdef USE_PTHREAD_SIGNAL - -int pthread_signal(int sig, void (*func)()) -{ - struct sigaction sact; - sact.sa_flags= 0; - sact.sa_handler= func; - sigemptyset(&sact.sa_mask); - sigaction(sig, &sact, (struct sigaction*) 0); - return 0; -} -#endif /**************************************************************************** The following functions fixes that all pthread functions should work diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 05d14073953..e5b77de5e38 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -80,17 +80,7 @@ void init_thr_alarm(uint max_alarms) pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) -#if defined(HAVE_mit_thread) - sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */ -#else - { - struct sigaction sact; - sact.sa_flags = 0; - bzero((char*) &sact, sizeof(sact)); - sact.sa_handler = thread_alarm; - sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0); - } -#endif + my_sigset(THR_CLIENT_ALARM,thread_alarm); #endif sigemptyset(&s); sigaddset(&s, THR_SERVER_ALARM); @@ -110,12 +100,12 @@ void init_thr_alarm(uint max_alarms) #elif defined(USE_ONE_SIGNAL_HAND) pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ #if THR_SERVER_ALARM == THR_CLIENT_ALARM - sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ + my_sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ pthread_sigmask(SIG_UNBLOCK, &s, NULL); #endif #else + my_sigset(THR_SERVER_ALARM, process_alarm); pthread_sigmask(SIG_UNBLOCK, &s, NULL); - sigset(THR_SERVER_ALARM,process_alarm); #endif DBUG_VOID_RETURN; } @@ -290,7 +280,7 @@ sig_handler process_alarm(int sig __attribute__((unused))) printf("thread_alarm\n"); fflush(stdout); #endif #ifdef DONT_REMEMBER_SIGNAL - sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ + my_sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ #endif return; } @@ -310,7 +300,7 @@ sig_handler process_alarm(int sig __attribute__((unused))) process_alarm_part2(sig); #ifndef USE_ALARM_THREAD #if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) - sigset(THR_SERVER_ALARM,process_alarm); + my_sigset(THR_SERVER_ALARM,process_alarm); #endif pthread_mutex_unlock(&LOCK_alarm); pthread_sigmask(SIG_SETMASK,&old_mask,NULL); @@ -512,7 +502,7 @@ static sig_handler thread_alarm(int sig) printf("thread_alarm\n"); fflush(stdout); #endif #ifdef DONT_REMEMBER_SIGNAL - sigset(sig,thread_alarm); /* int. thread system calls */ + my_sigset(sig,thread_alarm); /* int. thread system calls */ #endif } #endif @@ -916,7 +906,7 @@ static sig_handler print_signal_warning(int sig) printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); fflush(stdout); #ifdef DONT_REMEMBER_SIGNAL - sigset(sig,print_signal_warning); /* int. thread system calls */ + my_sigset(sig,print_signal_warning); /* int. thread system calls */ #endif #ifndef OS2 if (sig == SIGALRM) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6a91ac32ee..feb63e10b9f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -846,7 +846,7 @@ static void __cdecl kill_server(int sig_ptr) RETURN_FROM_KILL_SERVER; kill_in_progress=TRUE; abort_loop=1; // This should be set - signal(sig,SIG_IGN); + my_sigset(sig,SIG_IGN); if (sig == MYSQL_KILL_SIGNAL || sig == 0) sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname); else @@ -894,11 +894,6 @@ extern "C" pthread_handler_decl(kill_server_thread,arg __attribute__((unused))) } #endif -#if defined(__amiga__) -#undef sigset -#define sigset signal -#endif - extern "C" sig_handler print_signal_warning(int sig) { if (!DBUG_IN_USE) @@ -908,7 +903,7 @@ extern "C" sig_handler print_signal_warning(int sig) sig,my_thread_id()); } #ifdef DONT_REMEMBER_SIGNAL - sigset(sig,print_signal_warning); /* int. thread system calls */ + my_sigset(sig,print_signal_warning); /* int. thread system calls */ #endif #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) if (sig == SIGALRM) @@ -1570,23 +1565,6 @@ void flush_thread_cache() } -/* - Aborts a thread nicely. Commes here on SIGPIPE - TODO: One should have to fix that thr_alarm know about this - thread too. -*/ - -#ifdef THREAD_SPECIFIC_SIGPIPE -extern "C" sig_handler abort_thread(int sig __attribute__((unused))) -{ - THD *thd=current_thd; - DBUG_ENTER("abort_thread"); - if (thd) - thd->killed=1; - DBUG_VOID_RETURN; -} -#endif - /****************************************************************************** Setup a signal thread with handles all signals. Because Linux doesn't support schemas use a mutex to check that @@ -2002,8 +1980,8 @@ static void init_signals(void) DBUG_ENTER("init_signals"); if (test_flags & TEST_SIGINT) - sigset(THR_KILL_SIGNAL,end_thread_signal); - sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! + my_sigset(THR_KILL_SIGNAL,end_thread_signal); + my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) { @@ -2037,13 +2015,8 @@ static void init_signals(void) } #endif (void) sigemptyset(&set); -#ifdef THREAD_SPECIFIC_SIGPIPE - sigset(SIGPIPE,abort_thread); + my_sigset(SIGPIPE,SIG_IGN); sigaddset(&set,SIGPIPE); -#else - (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread - sigaddset(&set,SIGPIPE); -#endif sigaddset(&set,SIGINT); #ifndef IGNORE_SIGHUP_SIGQUIT sigaddset(&set,SIGQUIT); diff --git a/vio/vio.c b/vio/vio.c index 45572b93ed6..f60a53d2f04 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -136,10 +136,18 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) vio->sd); #if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) #if !defined(NO_FCNTL_NONBLOCK) -#if defined(__FreeBSD__) - fcntl(sd, F_SETFL, vio->fcntl_mode); /* Yahoo! FreeBSD patch */ -#endif - vio->fcntl_mode = fcntl(sd, F_GETFL); + /* + We call fcntl() to set the flags and then immediately read them back + to make sure that we and the system are in agreement on the state of + things. + + An example of why we need to do this is FreeBSD (and apparently some + other BSD-derived systems, like Mac OS X), where the system sometimes + reports that the socket is set for non-blocking when it really will + block. + */ + fcntl(sd, F_SETFL, vio->fcntl_mode); + vio->fcntl_mode= fcntl(sd, F_GETFL); #elif defined(HAVE_SYS_IOCTL_H) /* hpux */ /* Non blocking sockets doesn't work good on HPUX 11.0 */ (void) ioctl(sd,FIOSNBIO,0); diff --git a/vio/viosocket.c b/vio/viosocket.c index 5213390e2e6..8d4c2387632 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -92,7 +92,14 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, else vio->fcntl_mode |= O_NONBLOCK; /* set bit */ if (old_fcntl != vio->fcntl_mode) - r = fcntl(vio->sd, F_SETFL, vio->fcntl_mode); + { + r= fcntl(vio->sd, F_SETFL, vio->fcntl_mode); + if (r == -1) + { + DBUG_PRINT("info", ("fcntl failed, errno %d", errno)); + vio->fcntl_mode= old_fcntl; + } + } } #else r= set_blocking_mode ? 0 : 1; From 40bd22ef6932430ae86f1f41a621d07cb2a7b2cd Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 11 Oct 2005 21:18:04 +0500 Subject: [PATCH 063/322] Fix for bug #13667 (Inconsistency for decimal(m,d) specification. --- mysql-test/r/type_newdecimal.result | 2 ++ mysql-test/t/type_newdecimal.test | 6 ++++++ sql/sql_parse.cc | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index be5e29ab662..dbae646c362 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1019,3 +1019,5 @@ drop procedure wg2; select cast(@non_existing_user_var/2 as DECIMAL); cast(@non_existing_user_var/2 as DECIMAL) NULL +create table t (d decimal(0,10)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'd'). diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 3f04aa931d2..a7087d46dca 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1044,3 +1044,9 @@ drop procedure wg2; # select cast(@non_existing_user_var/2 as DECIMAL); + +# +# Bug #13667 (Inconsistency for decimal(m,d) specification +# +--error 1427 +create table t (d decimal(0,10)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 88718f6c8c9..8fede76e077 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5748,7 +5748,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, case FIELD_TYPE_NULL: break; case FIELD_TYPE_NEWDECIMAL: - if (!length) + if (!length && !new_field->decimals) new_field->length= 10; if (new_field->length > DECIMAL_MAX_PRECISION) { From 8782f5a0e3577ae515e0e77503a0cd86fc95dfe4 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 11 Oct 2005 21:16:08 +0200 Subject: [PATCH 064/322] - added Docs/manual.chm to the windows source distribution (BUG#13899) --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 0800fec1ac6..f863e5385d4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -275,7 +275,7 @@ cd $SOURCE for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ - Docs/INSTALL-BINARY + Docs/INSTALL-BINARY Docs/manual.chm do print_debug "Copying file '$i'" From c1de26516303d9bbb11ffe68f5b7a23222a99e12 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 11 Oct 2005 22:34:40 +0200 Subject: [PATCH 065/322] mysqlwatch.vcproj: Removed Debug target not used mysql.sln: Added pro-gpl target Build mysqlwatch and mysqlshutdown for classic as well --- VC++Files/mysql.sln | 292 ++++++++++++++++++++++--- VC++Files/mysqlwatch/mysqlwatch.vcproj | 16 -- 2 files changed, 261 insertions(+), 47 deletions(-) diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index 70defe111cb..9f7f3ae8375 100644 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -300,26 +300,27 @@ Global Embedded_Debug = Embedded_Debug Embedded_Pro = Embedded_Pro Embedded_Release = Embedded_Release + Embedded_ProGPL = Embedded_ProGPL Max = Max Max nt = Max nt nt = nt pro = pro pro nt = pro nt + pro gpl = pro gpl + pro gpl nt = pro gpl nt Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_ProGPL.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_ProGPL.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32 @@ -329,9 +330,11 @@ Global {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.ActiveCfg = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl nt.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.ActiveCfg = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.Build.0 = Max|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic.ActiveCfg = Release|Win32 @@ -341,6 +344,7 @@ Global {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Classic.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Debug.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_ProGPL.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Release.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.Build.0 = Release|Win32 @@ -352,6 +356,10 @@ Global {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.Build.0 = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl nt.Build.0 = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.ActiveCfg = Release|Win32 {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.ActiveCfg = Release|Win32 @@ -366,6 +374,8 @@ Global {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_ProGPL.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32 @@ -378,6 +388,10 @@ Global {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl nt.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.Build.0 = Release|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.ActiveCfg = Release|Win32 @@ -392,6 +406,8 @@ Global {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.ActiveCfg = TLS|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_ProGPL.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_ProGPL.Build.0 = TLS|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.ActiveCfg = TLS|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.Build.0 = TLS|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.ActiveCfg = Release|Win32 @@ -404,6 +420,10 @@ Global {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.Build.0 = Release|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.ActiveCfg = Release|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl nt.Build.0 = Release|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.ActiveCfg = Release|Win32 {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.Build.0 = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.classic.ActiveCfg = Release|Win32 @@ -418,6 +438,8 @@ Global {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_ProGPL.Build.0 = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.ActiveCfg = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.Build.0 = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Max.ActiveCfg = Release|Win32 @@ -430,6 +452,10 @@ Global {13D37150-54D0-46C5-9519-03923243C7C7}.pro.Build.0 = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.ActiveCfg = nt|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl nt.Build.0 = nt|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Release.ActiveCfg = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Release.Build.0 = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.ActiveCfg = Release|Win32 @@ -441,6 +467,8 @@ Global {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Classic.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Debug.ActiveCfg = Debug|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_ProGPL.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Release.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.Build.0 = Release|Win32 @@ -452,6 +480,10 @@ Global {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.Build.0 = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl nt.Build.0 = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.ActiveCfg = Release|Win32 {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.Build.0 = Release|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic.ActiveCfg = classic|Win32 @@ -463,6 +495,8 @@ Global {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.Build.0 = Debug|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.ActiveCfg = pro|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.Build.0 = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_ProGPL.Build.0 = Release|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.ActiveCfg = Release|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.Build.0 = Release|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max.ActiveCfg = classic|Win32 @@ -470,6 +504,8 @@ Global {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.nt.ActiveCfg = classic|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro.ActiveCfg = pro|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro nt.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro gpl.ActiveCfg = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro gpl nt.ActiveCfg = Release|Win32 {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Release.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.Build.0 = Release|Win32 @@ -477,9 +513,10 @@ Global {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.Build.0 = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.ActiveCfg = Debug|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.Build.0 = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Debug.ActiveCfg = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_ProGPL.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Release.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.Build.0 = Release|Win32 @@ -491,6 +528,10 @@ Global {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.Build.0 = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl nt.Build.0 = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.ActiveCfg = Release|Win32 {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.Build.0 = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.ActiveCfg = classic|Win32 @@ -499,9 +540,10 @@ Global {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.Build.0 = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.ActiveCfg = Debug|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.Build.0 = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Debug.ActiveCfg = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_ProGPL.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Release.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.Build.0 = Release|Win32 @@ -513,6 +555,10 @@ Global {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.Build.0 = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl nt.Build.0 = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.ActiveCfg = Release|Win32 {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.ActiveCfg = Release|Win32 @@ -527,6 +573,8 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.Build.0 = Debug|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.ActiveCfg = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_ProGPL.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_ProGPL.Build.0 = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.ActiveCfg = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.Build.0 = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.ActiveCfg = Release|Win32 @@ -539,6 +587,10 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl nt.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic.ActiveCfg = Release|Win32 @@ -550,6 +602,7 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Classic.ActiveCfg = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Pro.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_ProGPL.ActiveCfg = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Release.ActiveCfg = TLS|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.Build.0 = Release|Win32 @@ -561,6 +614,10 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl nt.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 @@ -572,6 +629,7 @@ Global {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Classic.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Debug.ActiveCfg = Debug|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Pro.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_ProGPL.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Release.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.Build.0 = Release|Win32 @@ -583,6 +641,10 @@ Global {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl nt.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.ActiveCfg = classic|Win32 @@ -591,9 +653,10 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.ActiveCfg = Debug|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.Build.0 = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_ProGPL.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.Build.0 = Release|Win32 @@ -605,6 +668,10 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic.ActiveCfg = classic|Win32 @@ -613,9 +680,10 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.ActiveCfg = Debug|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.Build.0 = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Classic.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Classic.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Pro.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Pro.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_ProGPL.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.Build.0 = Release|Win32 @@ -627,6 +695,10 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.Build.0 = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 @@ -638,6 +710,7 @@ Global {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Classic.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Debug.ActiveCfg = Debug|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Pro.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_ProGPL.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Release.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.Build.0 = Release|Win32 @@ -649,6 +722,10 @@ Global {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.Build.0 = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl nt.Build.0 = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.ActiveCfg = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.Build.0 = Release|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.ActiveCfg = Release|Win32 @@ -663,6 +740,8 @@ Global {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.Build.0 = Debug|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.ActiveCfg = TLS|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_ProGPL.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_ProGPL.Build.0 = TLS|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.ActiveCfg = TLS|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.Build.0 = TLS|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.ActiveCfg = Release|Win32 @@ -675,6 +754,10 @@ Global {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.Build.0 = Release|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.ActiveCfg = Release|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl nt.Build.0 = Release|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.ActiveCfg = Release|Win32 {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.ActiveCfg = classic|Win32 @@ -686,6 +769,7 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Classic.ActiveCfg = classic|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Debug.ActiveCfg = Debug|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Pro.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_ProGPL.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.Build.0 = Release|Win32 @@ -697,6 +781,10 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl nt.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic.ActiveCfg = classic|Win32 @@ -708,6 +796,7 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Classic.ActiveCfg = classic|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Debug.ActiveCfg = Debug|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Pro.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_ProGPL.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.Build.0 = Release|Win32 @@ -719,6 +808,10 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl nt.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.Build.0 = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 @@ -729,7 +822,8 @@ Global {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.Build.0 = Debug|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Classic.ActiveCfg = Debug|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Debug.ActiveCfg = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_ProGPL.ActiveCfg = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Release.ActiveCfg = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.ActiveCfg = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.Build.0 = Release|Win32 @@ -741,6 +835,10 @@ Global {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.Build.0 = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.ActiveCfg = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl nt.Build.0 = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.ActiveCfg = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.Build.0 = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.ActiveCfg = classic|Win32 @@ -751,7 +849,8 @@ Global {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.Build.0 = Debug|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Classic.ActiveCfg = Debug|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Debug.ActiveCfg = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_ProGPL.ActiveCfg = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Release.ActiveCfg = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.ActiveCfg = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.Build.0 = Release|Win32 @@ -763,6 +862,10 @@ Global {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.Build.0 = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.ActiveCfg = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl nt.Build.0 = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.ActiveCfg = Release|Win32 {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.Build.0 = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.ActiveCfg = classic|Win32 @@ -774,6 +877,7 @@ Global {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Classic.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Debug.ActiveCfg = Debug|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Pro.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_ProGPL.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Release.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.Build.0 = Release|Win32 @@ -785,6 +889,10 @@ Global {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.Build.0 = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl nt.Build.0 = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.ActiveCfg = Release|Win32 {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.Build.0 = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.classic.ActiveCfg = classic|Win32 @@ -795,7 +903,8 @@ Global {67154F28-D076-419E-B149-819EF548E670}.Debug.Build.0 = Debug|Win32 {67154F28-D076-419E-B149-819EF548E670}.Embedded_Classic.ActiveCfg = Debug|Win32 {67154F28-D076-419E-B149-819EF548E670}.Embedded_Debug.ActiveCfg = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_ProGPL.ActiveCfg = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.Embedded_Release.ActiveCfg = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.Max.ActiveCfg = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.Max.Build.0 = Release|Win32 @@ -807,6 +916,10 @@ Global {67154F28-D076-419E-B149-819EF548E670}.pro.Build.0 = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.pro nt.ActiveCfg = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.pro nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro gpl.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro gpl.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro gpl nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro gpl nt.Build.0 = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.Release.ActiveCfg = Release|Win32 {67154F28-D076-419E-B149-819EF548E670}.Release.Build.0 = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.ActiveCfg = Release|Win32 @@ -817,7 +930,8 @@ Global {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.Build.0 = Debug|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Classic.ActiveCfg = Debug|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Debug.ActiveCfg = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_ProGPL.ActiveCfg = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Release.ActiveCfg = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.ActiveCfg = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.Build.0 = Release|Win32 @@ -829,6 +943,10 @@ Global {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.Build.0 = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.ActiveCfg = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl nt.Build.0 = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.ActiveCfg = Release|Win32 {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.Build.0 = Release|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.classic.ActiveCfg = classic|Win32 @@ -840,6 +958,7 @@ Global {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Classic.ActiveCfg = Release|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Debug.ActiveCfg = Debug|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Pro.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_ProGPL.ActiveCfg = Release|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Release.ActiveCfg = Release|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Max.ActiveCfg = Max|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Max.Build.0 = Max|Win32 @@ -851,6 +970,10 @@ Global {62E85884-3ACF-4F4C-873B-60B878147890}.pro.Build.0 = pro|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.ActiveCfg = pro nt|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.Build.0 = pro nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl.Build.0 = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl nt.ActiveCfg = nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl nt.Build.0 = nt|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Release.ActiveCfg = Release|Win32 {62E85884-3ACF-4F4C-873B-60B878147890}.Release.Build.0 = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32 @@ -862,6 +985,7 @@ Global {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_ProGPL.ActiveCfg = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32 @@ -873,6 +997,10 @@ Global {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.Build.0 = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32 {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.ActiveCfg = classic|Win32 @@ -884,6 +1012,7 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Classic.ActiveCfg = classic|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Debug.ActiveCfg = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Pro.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_ProGPL.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.Build.0 = Release|Win32 @@ -895,15 +1024,22 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.Build.0 = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Classic.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Debug.ActiveCfg = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_ProGPL.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.Build.0 = Release|Win32 @@ -915,15 +1051,22 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.ActiveCfg = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.Build.0 = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Classic.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Debug.ActiveCfg = Debug|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_ProGPL.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.Build.0 = Release|Win32 @@ -935,6 +1078,10 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.Build.0 = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 @@ -946,6 +1093,7 @@ Global {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Classic.ActiveCfg = classic|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Debug.ActiveCfg = Debug|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Pro.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_ProGPL.ActiveCfg = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Release.ActiveCfg = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.ActiveCfg = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.Build.0 = Release|Win32 @@ -957,6 +1105,10 @@ Global {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.Build.0 = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.ActiveCfg = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl nt.Build.0 = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.ActiveCfg = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.Build.0 = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32 @@ -968,6 +1120,7 @@ Global {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_ProGPL.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32 @@ -979,6 +1132,10 @@ Global {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.Build.0 = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32 {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.ActiveCfg = classic|Win32 @@ -989,7 +1146,8 @@ Global {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.Build.0 = Debug|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Classic.ActiveCfg = Debug|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Debug.ActiveCfg = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_ProGPL.ActiveCfg = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Release.ActiveCfg = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.ActiveCfg = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.Build.0 = Release|Win32 @@ -1001,6 +1159,10 @@ Global {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.Build.0 = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.ActiveCfg = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl nt.Build.0 = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.ActiveCfg = Release|Win32 {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32 @@ -1015,6 +1177,8 @@ Global {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32 @@ -1027,6 +1191,10 @@ Global {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.ActiveCfg = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl nt.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.ActiveCfg = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.Build.0 = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.ActiveCfg = classic|Win32 @@ -1037,7 +1205,8 @@ Global {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.Build.0 = Debug|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Classic.ActiveCfg = Debug|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Debug.ActiveCfg = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_ProGPL.ActiveCfg = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Release.ActiveCfg = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.ActiveCfg = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.Build.0 = Release|Win32 @@ -1049,6 +1218,10 @@ Global {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.Build.0 = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.ActiveCfg = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl nt.Build.0 = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.ActiveCfg = Release|Win32 {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.Build.0 = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.ActiveCfg = Release|Win32 @@ -1063,6 +1236,8 @@ Global {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.Build.0 = Debug|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.ActiveCfg = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_ProGPL.Build.0 = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.ActiveCfg = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.Build.0 = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.ActiveCfg = Release|Win32 @@ -1075,6 +1250,10 @@ Global {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.Build.0 = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.ActiveCfg = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl nt.Build.0 = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.ActiveCfg = Release|Win32 {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.Build.0 = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.ActiveCfg = classic|Win32 @@ -1086,6 +1265,7 @@ Global {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Classic.ActiveCfg = classic|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Debug.ActiveCfg = Debug|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Pro.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_ProGPL.ActiveCfg = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Release.ActiveCfg = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.ActiveCfg = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.Build.0 = Release|Win32 @@ -1097,6 +1277,10 @@ Global {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.Build.0 = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.ActiveCfg = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl nt.Build.0 = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.ActiveCfg = Release|Win32 {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.Build.0 = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.ActiveCfg = Release|Win32 @@ -1111,6 +1295,8 @@ Global {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.Build.0 = Debug|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.ActiveCfg = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_ProGPL.Build.0 = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.ActiveCfg = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.Build.0 = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.ActiveCfg = Release|Win32 @@ -1123,22 +1309,31 @@ Global {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.Build.0 = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.ActiveCfg = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl nt.Build.0 = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.ActiveCfg = Release|Win32 {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.Build.0 = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.ActiveCfg = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.Build.0 = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.ActiveCfg = Debug|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.Build.0 = Debug|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Classic.ActiveCfg = Debug|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Debug.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_ProGPL.ActiveCfg = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Release.ActiveCfg = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max.ActiveCfg = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl.Build.0 = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl nt.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl nt.Build.0 = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.ActiveCfg = Release|Win32 {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.Build.0 = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.ActiveCfg = Release|Win32 @@ -1147,12 +1342,15 @@ Global {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Classic.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Debug.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Pro.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_ProGPL.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Release.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.nt.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro gpl.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro gpl nt.ActiveCfg = Release|Win32 {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.Build.0 = Release|Win32 @@ -1163,6 +1361,7 @@ Global {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Classic.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Debug.ActiveCfg = Debug|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Pro.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_ProGPL.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Release.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.Build.0 = Release|Win32 @@ -1174,6 +1373,10 @@ Global {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.Build.0 = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl nt.Build.0 = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.ActiveCfg = Release|Win32 {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.ActiveCfg = Release|Win32 @@ -1188,6 +1391,8 @@ Global {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.Build.0 = Debug|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_ProGPL.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32 @@ -1200,6 +1405,10 @@ Global {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl nt.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.Build.0 = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.ActiveCfg = Release|Win32 @@ -1214,6 +1423,8 @@ Global {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.Build.0 = Debug|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.ActiveCfg = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_ProGPL.Build.0 = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.ActiveCfg = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.Build.0 = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.ActiveCfg = Release|Win32 @@ -1226,6 +1437,10 @@ Global {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.Build.0 = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.ActiveCfg = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl nt.Build.0 = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.ActiveCfg = Release|Win32 {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.Build.0 = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.ActiveCfg = classic|Win32 @@ -1236,7 +1451,8 @@ Global {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.Build.0 = Debug|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Classic.ActiveCfg = Debug|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Debug.ActiveCfg = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_ProGPL.ActiveCfg = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Release.ActiveCfg = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.ActiveCfg = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.Build.0 = Release|Win32 @@ -1248,6 +1464,10 @@ Global {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.Build.0 = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.ActiveCfg = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl nt.Build.0 = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.ActiveCfg = Release|Win32 {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.Build.0 = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.ActiveCfg = Release|Win32 @@ -1256,9 +1476,10 @@ Global {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.Build.0 = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.ActiveCfg = Debug|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.Build.0 = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Debug.ActiveCfg = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_ProGPL.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Release.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.Build.0 = Release|Win32 @@ -1269,6 +1490,10 @@ Global {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.Build.0 = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl nt.Build.0 = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.ActiveCfg = Release|Win32 {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.Build.0 = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.ActiveCfg = Release|Win32 @@ -1280,6 +1505,7 @@ Global {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Classic.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Debug.ActiveCfg = Debug|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Pro.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_ProGPL.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Release.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.Build.0 = Release|Win32 @@ -1291,6 +1517,10 @@ Global {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.Build.0 = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl nt.Build.0 = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32 {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32 EndGlobalSection diff --git a/VC++Files/mysqlwatch/mysqlwatch.vcproj b/VC++Files/mysqlwatch/mysqlwatch.vcproj index b922ed921bc..25102603dc0 100644 --- a/VC++Files/mysqlwatch/mysqlwatch.vcproj +++ b/VC++Files/mysqlwatch/mysqlwatch.vcproj @@ -78,14 +78,6 @@ - - - - - - From f5fdf3e87a5f60fdb6442912ae5741a24b2461c8 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 12 Oct 2005 00:58:22 +0300 Subject: [PATCH 066/322] Reviewing new pushed code - CHAR() now returns binary string as default - CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR() - Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() (Some old systems returns ETIME and it's safer to test for both values than to try to write a wrapper for each old system) - Fixed new introduced bug in NOT BETWEEN X and X - Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed - Use octet2hex() for all conversion of string to hex - Simplify and optimize code --- client/mysqldump.c | 71 +++++---- client/mysqltest.c | 8 +- include/mysql_com.h | 2 +- mysql-test/r/ctype_utf8.result | 34 ++-- mysql-test/r/func_str.result | 7 +- mysql-test/r/range.result | 7 + mysql-test/r/user_var-binlog.result | 4 +- mysql-test/r/view.result | 13 +- mysql-test/t/ctype_utf8.test | 6 +- mysql-test/t/func_str.test | 1 + mysql-test/t/range.test | 5 + mysql-test/t/view.test | 11 +- mysys/mf_keycache.c | 17 +- mysys/my_os2cond.c | 147 ++++++++---------- mysys/thr_lock.c | 9 +- mysys/thr_mutex.c | 2 +- server-tools/instance-manager/instance.cc | 2 +- .../instance-manager/thread_registry.cc | 13 +- sql/ha_federated.cc | 9 +- sql/ha_ndbcluster.cc | 7 +- sql/handler.cc | 27 ++-- sql/item.h | 2 +- sql/item_func.cc | 103 +++++++----- sql/item_strfunc.cc | 42 ++--- sql/item_strfunc.h | 2 +- sql/log_event.cc | 18 +-- sql/parse_file.cc | 7 +- sql/password.c | 13 +- sql/slave.cc | 2 +- sql/sql_base.cc | 4 +- sql/sql_insert.cc | 2 +- sql/sql_manager.cc | 12 +- sql/sql_parse.cc | 11 +- sql/sql_prepare.cc | 2 +- sql/sql_select.cc | 8 +- sql/sql_show.cc | 3 - sql/sql_table.cc | 7 +- sql/sql_view.cc | 2 +- sql/unireg.cc | 8 +- 39 files changed, 334 insertions(+), 316 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 95238df30c7..21933ab03f2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -30,7 +30,7 @@ ** master/autocommit code by Brian Aker ** SSL by ** Andrei Errapart -** Tõnu Samuel +** Tõnu Samuel ** XML by Gary Huntress 10/10/01, cleaned up ** and adapted to mysqldump 05/11/01 by Jani Tolonen ** Added --single-transaction option 06/06/2002 by Peter Zaitsev @@ -1287,7 +1287,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, { MYSQL_RES *tableRes; MYSQL_ROW row; - my_bool init=0; + my_bool init=0, delayed, write_data, complete_insert; uint num_fields; char *result_table, *opt_quoted_table; const char *insert_option; @@ -1296,31 +1296,33 @@ static uint get_table_structure(char *table, char *db, char *table_type, char query_buff[512]; FILE *sql_file = md_result_file; int len; - DBUG_ENTER("get_table_structure"); - DBUG_PRINT("enter", ("db: %s, table: %s", db, table)); + DBUG_PRINT("enter", ("db: %s table: %s", db, table)); *ignore_flag= check_if_ignore_table(table, table_type); - if (opt_delayed && (*ignore_flag & IGNORE_INSERT_DELAYED)) + delayed= opt_delayed; + if (delayed && (*ignore_flag & IGNORE_INSERT_DELAYED)) + { + delayed= 0; if (verbose) fprintf(stderr, - "-- Unable to use delayed inserts for table '%s' because it's of\ - type %s\n", table, table_type); + "-- Warning: Unable to use delayed inserts for table '%s' " + "because it's of type %s\n", table, table_type); + } - if (!(*ignore_flag & IGNORE_DATA)) + complete_insert= 0; + if ((write_data= !(*ignore_flag & IGNORE_DATA))) { + complete_insert= opt_complete_insert; if (!insert_pat_inited) insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024); else dynstr_set(&insert_pat, ""); } - insert_option= ((opt_delayed && opt_ignore && - !(*ignore_flag & IGNORE_INSERT_DELAYED)) ? - " DELAYED IGNORE " : - opt_delayed && !(*ignore_flag & IGNORE_INSERT_DELAYED) ? " DELAYED " : - opt_ignore ? " IGNORE " : ""); + insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " : + delayed ? " DELAYED " : opt_ignore ? " IGNORE " : ""); if (verbose) fprintf(stderr, "-- Retrieving table structure for table %s...\n", table); @@ -1452,17 +1454,18 @@ static uint get_table_structure(char *table, char *db, char *table_type, } /* - if *ignore_flag & IGNORE_DATA is true, then we don't build up insert statements - for the table's data. Note: in subsequent lines of code, this test will - have to be performed each time we are appending to insert_pat. + If write_data is true, then we build up insert statements for + the table's data. Note: in subsequent lines of code, this test + will have to be performed each time we are appending to + insert_pat. */ - if (!(*ignore_flag & IGNORE_DATA)) + if (write_data) { dynstr_append_mem(&insert_pat, "INSERT ", 7); dynstr_append(&insert_pat, insert_option); dynstr_append_mem(&insert_pat, "INTO ", 5); dynstr_append(&insert_pat, opt_quoted_table); - if (opt_complete_insert) + if (complete_insert) { dynstr_append_mem(&insert_pat, " (", 2); } @@ -1476,15 +1479,16 @@ static uint get_table_structure(char *table, char *db, char *table_type, while ((row=mysql_fetch_row(tableRes))) { - if (init) + if (complete_insert) { - if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) + if (init) + { dynstr_append_mem(&insert_pat, ", ", 2); - } - init=1; - if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) + } + init=1; dynstr_append(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); + } } num_fields= (uint) mysql_num_rows(tableRes); mysql_free_result(tableRes); @@ -1532,7 +1536,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, check_io(sql_file); } - if (!(*ignore_flag & IGNORE_DATA)) + if (write_data) { dynstr_append_mem(&insert_pat, "INSERT ", 7); dynstr_append(&insert_pat, insert_option); @@ -1558,11 +1562,11 @@ static uint get_table_structure(char *table, char *db, char *table_type, fputs(",\n",sql_file); check_io(sql_file); } - if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) + if (complete_insert) dynstr_append_mem(&insert_pat, ", ", 2); } init=1; - if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) + if (opt_complete_insert) dynstr_append(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!tFlag) @@ -1723,7 +1727,7 @@ continue_xml: check_io(sql_file); } } - if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) + if (opt_complete_insert) { dynstr_append_mem(&insert_pat, ") VALUES ", 9); if (!extended_insert) @@ -1877,7 +1881,7 @@ static void dump_table(char *table, char *db) { char ignore_flag; char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; - char table_type[NAME_LEN]; + char table_type[NAME_LEN]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; char *query= query_buf; int error= 0; @@ -1892,7 +1896,7 @@ static void dump_table(char *table, char *db) Make sure you get the create table info before the following check for --no-data flag below. Otherwise, the create table info won't be printed. */ - num_fields= get_table_structure(table, db, (char *)&table_type, &ignore_flag); + num_fields= get_table_structure(table, db, table_type, &ignore_flag); /* Check --no-data flag */ if (dFlag) @@ -1904,7 +1908,9 @@ static void dump_table(char *table, char *db) DBUG_VOID_RETURN; } - DBUG_PRINT("info", ("ignore_flag %x num_fields %d", ignore_flag, num_fields)); + DBUG_PRINT("info", + ("ignore_flag: %x num_fields: %d", (int) ignore_flag, + num_fields)); /* If the table type is a merge table or any type that has to be _completely_ ignored and no data dumped @@ -1913,7 +1919,7 @@ static void dump_table(char *table, char *db) { if (verbose) fprintf(stderr, - "-- Skipping data for table '%s' because it's of type %s\n", + "-- Warning: Skipping data for table '%s' because it's of type %s\n", table, table_type); DBUG_VOID_RETURN; } @@ -1930,7 +1936,6 @@ static void dump_table(char *table, char *db) result_table= quote_name(table,table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); - if (verbose) fprintf(stderr, "-- Sending SELECT query...\n"); if (path) @@ -2992,7 +2997,7 @@ char check_if_ignore_table(const char *table_name, char *table_type) DBUG_RETURN(result); /* assume table is ok */ } if (!(row[1])) - strmake(table_type,"VIEW", NAME_LEN-1); + strmake(table_type, "VIEW", NAME_LEN-1); else { /* diff --git a/client/mysqltest.c b/client/mysqltest.c index e0507d056a6..6653d24e575 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -737,9 +737,7 @@ err: static int check_result(DYNAMIC_STRING* ds, const char *fname, my_bool require_option) { - int error= RESULT_OK; int res= dyn_string_cmp(ds, fname); - DBUG_ENTER("check_result"); if (res && require_option) @@ -749,18 +747,16 @@ static int check_result(DYNAMIC_STRING* ds, const char *fname, break; /* ok */ case RESULT_LENGTH_MISMATCH: verbose_msg("Result length mismatch"); - error= RESULT_LENGTH_MISMATCH; break; case RESULT_CONTENT_MISMATCH: verbose_msg("Result content mismatch"); - error= RESULT_CONTENT_MISMATCH; break; default: /* impossible */ die("Unknown error code from dyn_string_cmp()"); } - if (error) + if (res != RESULT_OK) reject_dump(fname, ds->str, ds->length); - DBUG_RETURN(error); + DBUG_RETURN(res); } diff --git a/include/mysql_com.h b/include/mysql_com.h index c4eb33a6c9a..1e595cdbba3 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -409,7 +409,7 @@ my_bool check_scramble(const char *reply, const char *message, const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); -void octet2hex(char *to, const unsigned char *str, unsigned int len); +char *octet2hex(char *to, const char *str, unsigned int len); /* end of password.c */ diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 1695f1c67e8..5516be88b75 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1079,29 +1079,31 @@ char(53647) select char(0xff,0x8f); char(0xff,0x8f) ÿ -Warnings: -Warning 1300 Invalid utf8 character string: 'FF8F' set sql_mode=traditional; select char(0xff,0x8f); char(0xff,0x8f) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'FF8F' +ÿ +select convert(char(0xff,0x8f) using utf8); +convert(char(0xff,0x8f) using utf8) +ÿ select char(195); char(195) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'C3' +à +select convert(char(195) using utf8); +convert(char(195) using utf8) +à select char(196); char(196) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'C4' -select char(2557); -char(2557) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'FD' +Ä +select convert(char(196) using utf8); +convert(char(196) using utf8) +Ä +select hex(char(2557)); +hex(char(2557)) +09FD +select hex(convert(char(2557) using utf8)); +hex(convert(char(2557) using utf8)) +09FD set names utf8; create table t1 (a char(1)) default character set utf8; create table t2 (a char(1)) default character set utf8; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d250d2fce84..a305bf20bff 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -21,6 +21,9 @@ length(_latin1'\n\t\n\b\0\\_\\%\\') select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h') monty was here again 5 h 104 +select hex(char(256)); +hex(char(256)) +0100 select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; locate('he','hello') locate('he','hello',2) locate('lo','hello',2) 1 0 4 @@ -598,7 +601,7 @@ collation(hex(130)) coercibility(hex(130)) latin1_swedish_ci 4 select collation(char(130)), coercibility(hex(130)); collation(char(130)) coercibility(hex(130)) -latin1_swedish_ci 4 +binary 4 select collation(format(130,10)), coercibility(format(130,10)); collation(format(130,10)) coercibility(format(130,10)) latin1_swedish_ci 4 @@ -720,7 +723,7 @@ t1 CREATE TABLE `t1` ( `oct(130)` varchar(64) NOT NULL default '', `conv(130,16,10)` varchar(64) NOT NULL default '', `hex(130)` varchar(6) NOT NULL default '', - `char(130)` varchar(1) NOT NULL default '', + `char(130)` varbinary(1) NOT NULL default '', `format(130,10)` varchar(4) NOT NULL default '', `left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', `right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 69c150fc0b7..6dedd020249 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -809,4 +809,11 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t2 where a = 'a' or a='a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref a a 13 const # Using where +update t1 set a='b' where a<>'a'; +explain select * from t1 where a not between 'b' and 'b'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +select * from t1 where a not between 'b' and 'b'; +a filler +a drop table t1,t2,t3; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 17ac8809d52..700ec7b09e0 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 User var 1 139 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 139 Query 1 231 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 231 User var 1 273 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 273 User var 1 311 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci +master-bin.000001 273 User var 1 311 @`var2`=_binary 0x61 COLLATE binary master-bin.000001 311 Query 1 411 use `test`; insert into t1 values (@var1),(@var2) /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; @@ -24,7 +24,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; INSERT INTO t1 VALUES(@`a b`); SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; -SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; +SET @`var2`:=_binary 0x61 COLLATE `binary`; SET TIMESTAMP=10000; insert into t1 values (@var1),(@var2); # End of log file diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e52ec950c8c..14187703ca3 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -847,13 +847,16 @@ cast(1 as char(3)) drop view v1; create table t1 (a int); create view v1 as select a from t1; -create database seconddb; -rename table v1 to seconddb.v1; -ERROR HY000: Changing schema from 'test' to 'seconddb' is not allowed. +create view v3 as select a from t1; +create database mysqltest; +rename table v1 to mysqltest.v1; +ERROR HY000: Changing schema from 'test' to 'mysqltest' is not allowed. rename table v1 to v2; +rename table v3 to v1, v2 to t1; +ERROR 42S01: Table 't1' already exists drop table t1; -drop view v2; -drop database seconddb; +drop view v2,v3; +drop database mysqltest; create view v1 as select 'a',1; create view v2 as select * from v1 union all select * from v1; create view v3 as select * from v2 where 1 = (select `1` from v2); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8194dbdb438..d186ca8a1f6 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -880,9 +880,13 @@ select char(0xff,0x8f); # incorrect value in strict mode: return NULL with "Error" level warning set sql_mode=traditional; select char(0xff,0x8f); +select convert(char(0xff,0x8f) using utf8); select char(195); +select convert(char(195) using utf8); select char(196); -select char(2557); +select convert(char(196) using utf8); +select hex(char(2557)); +select hex(convert(char(2557) using utf8)); # # Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 6cd27903a42..ac2bf820257 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -15,6 +15,7 @@ select bit_length('\n\t\r\b\0\_\%\\'); select char_length('\n\t\r\b\0\_\%\\'); select length(_latin1'\n\t\n\b\0\\_\\%\\'); select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); +select hex(char(256)); select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); select position(binary 'll' in 'hello'),position('a' in binary 'hello'); diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 11c5e8d7bc5..89376d33f61 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -625,4 +625,9 @@ explain select * from t2 where a between 'a' and 'a '; --replace_column 9 # explain select * from t2 where a = 'a' or a='a '; +update t1 set a='b' where a<>'a'; +--replace_column 9 # +explain select * from t1 where a not between 'b' and 'b'; +select * from t1 where a not between 'b' and 'b'; + drop table t1,t2,t3; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 15c8cccf69c..f49191130f5 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -790,13 +790,16 @@ drop view v1; # create table t1 (a int); create view v1 as select a from t1; -create database seconddb; +create view v3 as select a from t1; +create database mysqltest; -- error 1450 -rename table v1 to seconddb.v1; +rename table v1 to mysqltest.v1; rename table v1 to v2; +--error 1050 +rename table v3 to v1, v2 to t1; drop table t1; -drop view v2; -drop database seconddb; +drop view v2,v3; +drop database mysqltest; # # bug handling from VIEWs diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 69410e9faaa..3b5e277b56d 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2750,9 +2750,12 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, gettimeofday(&now, &tz); /* Prepare timeout value */ timeout.tv_sec= now.tv_sec + KEYCACHE_TIMEOUT; - timeout.tv_nsec= now.tv_usec * 1000; /* timeval uses microseconds. */ - /* timespec uses nanoseconds. */ - /* 1 nanosecond = 1000 micro seconds. */ + /* + timeval uses microseconds. + timespec uses nanoseconds. + 1 nanosecond = 1000 micro seconds + */ + timeout.tv_nsec= now.tv_usec * 1000; KEYCACHE_THREAD_TRACE_END("started waiting"); #if defined(KEYCACHE_DEBUG) cnt++; @@ -2762,17 +2765,15 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, #endif rc= pthread_cond_timedwait(cond, mutex, &timeout); KEYCACHE_THREAD_TRACE_BEGIN("finished waiting"); -#if defined(KEYCACHE_DEBUG) - if (rc == ETIMEDOUT) + if (rc == ETIMEDOUT || rc == ETIME) { +#if defined(KEYCACHE_DEBUG) fprintf(keycache_debug_log,"aborted by keycache timeout\n"); fclose(keycache_debug_log); abort(); - } #endif - - if (rc == ETIMEDOUT) keycache_dump(); + } #if defined(KEYCACHE_DEBUG) KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT); diff --git a/mysys/my_os2cond.c b/mysys/my_os2cond.c index 83a03d62046..bf3e85c26a9 100644 --- a/mysys/my_os2cond.c +++ b/mysys/my_os2cond.c @@ -22,7 +22,7 @@ ** The following is a simple implementation of posix conditions *****************************************************************************/ -#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ +#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ #include "mysys_priv.h" #if defined(THREAD) && defined(OS2) #include @@ -31,134 +31,109 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { - APIRET rc = 0; - HEV event; - cond->waiting=0; - /* Warp3 FP29 or Warp4 FP4 or better required */ - rc = DosCreateEventSem( NULL, &cond->semaphore, 0x0800, 0); - if (rc) - return ENOMEM; - + cond->waiting= 0; + /* Warp3 FP29 or Warp4 FP4 or better required */ + if (DosCreateEventSem(NULL, &cond->semaphore, 0x0800, 0)) + return ENOMEM; return 0; } int pthread_cond_destroy(pthread_cond_t *cond) { - APIRET rc; - - do { - rc = DosCloseEventSem(cond->semaphore); - if (rc == 301) DosPostEventSem(cond->semaphore); - } while (rc == 301); - if (rc) - return EINVAL; - - return 0; + for (;;) + { + APIRET rc; + if ((rc= DosCloseEventSem(cond->semaphore)) != 301) + return rc ? EINVAL : 0; + DosPostEventSem(cond->semaphore); + } } int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - APIRET rc; - int rval; - - rval = 0; - cond->waiting++; - - if (mutex) pthread_mutex_unlock(mutex); - - rc = DosWaitEventSem(cond->semaphore,SEM_INDEFINITE_WAIT); - if (rc != 0) - rval = EINVAL; - - if (mutex) pthread_mutex_lock(mutex); - - cond->waiting--; - - return rval; + int rval= 0; + cond->waiting++; + if (mutex) + pthread_mutex_unlock(mutex); + if (DosWaitEventSem(cond->semaphore, SEM_INDEFINITE_WAIT)) + rval= EINVAL; + if (mutex) + pthread_mutex_lock(mutex); + cond->waiting--; + return rval; } int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime) + struct timespec *abstime) { struct timeb curtime; int result; long timeout; - APIRET rc; - int rval; + int rval= 0; - _ftime(&curtime); - timeout= ((long) (abstime->ts_sec - curtime.time)*1000L + - (long)((abstime->ts_nsec/1000) - curtime.millitm)/1000L); - if (timeout < 0) /* Some safety */ - timeout = 0L; + _ftime(&curtime); + timeout= ((long) (abstime->ts_sec - curtime.time) * 1000L + + (long) ((abstime->ts_nsec / 1000) - curtime.millitm) / 1000L); + if (timeout < 0) /* Some safety */ + timeout= 0L; - rval = 0; - cond->waiting++; + cond->waiting++; - if (mutex) pthread_mutex_unlock(mutex); + if (mutex) + pthread_mutex_unlock(mutex); + if (DosWaitEventSem(cond->semaphore, timeout) != 0) + rval= ETIMEDOUT; + if (mutex) + pthread_mutex_lock(mutex); - rc = DosWaitEventSem(cond->semaphore, timeout); - if (rc != 0) - rval= ETIMEDOUT; + cond->waiting--; - if (mutex) pthread_mutex_lock(mutex); - - cond->waiting--; - - return rval; + return rval; } int pthread_cond_signal(pthread_cond_t *cond) { - APIRET rc; - - /* Bring the next thread off the condition queue: */ - rc = DosPostEventSem(cond->semaphore); - return 0; + /* Bring the next thread off the condition queue: */ + DosPostEventSem(cond->semaphore); + return 0; } int pthread_cond_broadcast(pthread_cond_t *cond) { - int i; - APIRET rc; - - /* - * Enter a loop to bring all threads off the - * condition queue: - */ - i = cond->waiting; - while (i--) rc = DosPostEventSem(cond->semaphore); - - return 0 ; + int i; + /* Enter a loop to bring all threads off the condition queue */ + for (i= cond->waiting; i--;) + DosPostEventSem(cond->semaphore); + return 0; } int pthread_attr_init(pthread_attr_t *connect_att) { - connect_att->dwStackSize = 0; - connect_att->dwCreatingFlag = 0; - connect_att->priority = 0; + connect_att->dwStackSize= 0; + connect_att->dwCreatingFlag= 0; + connect_att->priority= 0; return 0; } -int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack) +int pthread_attr_setstacksize(pthread_attr_t *connect_att, DWORD stack) { - connect_att->dwStackSize=stack; + connect_att->dwStackSize= stack; return 0; } -int pthread_attr_setprio(pthread_attr_t *connect_att,int priority) +int pthread_attr_setprio(pthread_attr_t *connect_att, int priority) { - connect_att->priority=priority; + connect_att->priority= priority; return 0; } int pthread_attr_destroy(pthread_attr_t *connect_att) { - bzero((gptr) connect_att,sizeof(*connect_att)); + bzero((gptr) connect_att, sizeof(*connect_att)); return 0; } @@ -166,22 +141,22 @@ int pthread_attr_destroy(pthread_attr_t *connect_att) ** Fix localtime_r() to be a bit safer ****************************************************************************/ -struct tm *localtime_r(const time_t *timep,struct tm *tmp) +struct tm *localtime_r(const time_t *timep, struct tm *tmp) { - if (*timep == (time_t) -1) /* This will crash win32 */ + if (*timep == (time_t) - 1) /* This will crash win32 */ { - bzero(tmp,sizeof(*tmp)); + bzero(tmp, sizeof(*tmp)); } else { - struct tm *res=localtime(timep); - if (!res) /* Wrong date */ + struct tm *res= localtime(timep); + if (!res) /* Wrong date */ { - bzero(tmp,sizeof(*tmp)); /* Keep things safe */ + bzero(tmp, sizeof(*tmp)); /* Keep things safe */ return 0; } *tmp= *res; } return tmp; } -#endif /* __WIN__ */ +#endif /* __WIN__ */ diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 41266d61b0a..f5a8b618949 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -408,9 +408,10 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, set_timespec(wait_timeout, table_lock_wait_timeout); while (!thread_var->abort || in_wait_list) { - int rc= can_deadlock ? pthread_cond_timedwait(cond, &data->lock->mutex, - &wait_timeout) : - pthread_cond_wait(cond, &data->lock->mutex); + int rc= (can_deadlock ? + pthread_cond_timedwait(cond, &data->lock->mutex, + &wait_timeout) : + pthread_cond_wait(cond, &data->lock->mutex)); /* We must break the wait if one of the following occurs: - the connection has been aborted (!thread_var->abort), but @@ -426,7 +427,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, */ if (data->cond == 0) break; - if (rc == ETIMEDOUT) + if (rc == ETIMEDOUT || rc == ETIME) { result= THR_LOCK_WAIT_TIMEOUT; break; diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 2facb4e18cf..3326068d164 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -239,7 +239,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, pthread_mutex_unlock(&mp->global); error=pthread_cond_timedwait(cond,&mp->mutex,abstime); #ifdef EXTRA_DEBUG - if (error && (error != EINTR && error != ETIMEDOUT)) + if (error && (error != EINTR && error != ETIMEDOUT && error != ETIME)) { fprintf(stderr,"safe_mutex: Got error: %d (%d) when doing a safe_mutex_timedwait at %s, line %d\n", error, errno, file, line); } diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 0c3c1aee5b4..0b781a6119c 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -474,7 +474,7 @@ int Instance::stop() status= pthread_cond_timedwait(&COND_instance_stopped, &LOCK_instance, &timeout); - if (status == ETIMEDOUT) + if (status == ETIMEDOUT || status == ETIME) break; } diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc index fe665f410e5..f9b98eacbee 100644 --- a/server-tools/instance-manager/thread_registry.cc +++ b/server-tools/instance-manager/thread_registry.cc @@ -145,6 +145,7 @@ int Thread_registry::cond_timedwait(Thread_info *info, pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *wait_time) { + int rc; pthread_mutex_lock(&LOCK_thread_registry); if (shutdown_in_progress) { @@ -154,7 +155,8 @@ int Thread_registry::cond_timedwait(Thread_info *info, pthread_cond_t *cond, info->current_cond= cond; pthread_mutex_unlock(&LOCK_thread_registry); /* sic: race condition here, cond can be signaled in deliver_shutdown */ - int rc= pthread_cond_timedwait(cond, mutex, wait_time); + if ((rc= pthread_cond_timedwait(cond, mutex, wait_time)) == ETIME) + rc= ETIMEDOUT; // For easier usage pthread_mutex_lock(&LOCK_thread_registry); info->current_cond= 0; pthread_mutex_unlock(&LOCK_thread_registry); @@ -172,6 +174,7 @@ void Thread_registry::deliver_shutdown() { Thread_info *info; struct timespec shutdown_time; + int error; set_timespec(shutdown_time, 1); pthread_mutex_lock(&LOCK_thread_registry); @@ -204,11 +207,13 @@ void Thread_registry::deliver_shutdown() released - the only case when the predicate is false is when no other threads exist. */ - while (pthread_cond_timedwait(&COND_thread_registry_is_empty, - &LOCK_thread_registry, - &shutdown_time) != ETIMEDOUT && + while (((error= pthread_cond_timedwait(&COND_thread_registry_is_empty, + &LOCK_thread_registry, + &shutdown_time)) != ETIMEDOUT && + error != ETIME) && head.next != &head) ; + /* If previous signals did not reach some threads, they must be sleeping in pthread_cond_wait or in a blocking syscall. Wake them up: diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 20badb05f09..3c5adb3f10f 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -821,13 +821,8 @@ static bool emit_key_part_element(String *to, KEY_PART_INFO *part, *buf++= '0'; *buf++= 'x'; - for (; len; ptr++,len--) - { - uint tmp= (uint)(uchar) *ptr; - *buf++= _dig_vec_upper[tmp >> 4]; - *buf++= _dig_vec_upper[tmp & 15]; - } - if (to->append(buff, (uint)(buf - buff))) + buf= octet2hex(buf, (char*) ptr, len); + if (to->append((char*) buff, (uint)(buf - buff))) DBUG_RETURN(1); } else if (part->key_part_flag & HA_BLOB_PART) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6f2c7670b88..50f53ecf410 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -5931,7 +5931,6 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, { THD *thd; /* needs to be first for thread_stack */ Ndb* ndb; - int error= 0; struct timespec abstime; my_thread_init(); @@ -5960,9 +5959,9 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, { pthread_mutex_lock(&LOCK_ndb_util_thread); - error= pthread_cond_timedwait(&COND_ndb_util_thread, - &LOCK_ndb_util_thread, - &abstime); + pthread_cond_timedwait(&COND_ndb_util_thread, + &LOCK_ndb_util_thread, + &abstime); pthread_mutex_unlock(&LOCK_ndb_util_thread); DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d", diff --git a/sql/handler.cc b/sql/handler.cc index d449a0b90f2..1e38b6dc2ab 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -209,6 +209,8 @@ retest: return DB_TYPE_UNKNOWN; } + + const char *ha_get_storage_engine(enum db_type db_type) { handlerton **types; @@ -217,25 +219,19 @@ const char *ha_get_storage_engine(enum db_type db_type) if (db_type == (*types)->db_type) return (*types)->name; } - - return "none"; + return "*NONE*"; } + bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag) { handlerton **types; for (types= sys_table_types; *types; types++) { if (db_type == (*types)->db_type) - { - if ((*types)->flags & flag) - return TRUE; - else - return FALSE; - } + return test((*types)->flags & flag); } - - return FALSE; + return FALSE; // No matching engine } @@ -850,18 +846,25 @@ int ha_autocommit_or_rollback(THD *thd, int error) DBUG_RETURN(error); } + int ha_commit_or_rollback_by_xid(XID *xid, bool commit) { handlerton **types; int res= 1; for (types= sys_table_types; *types; types++) + { if ((*types)->state == SHOW_OPTION_YES && (*types)->recover) - res= res && - (*(commit ? (*types)->commit_by_xid : (*types)->rollback_by_xid))(xid); + { + if ((*(commit ? (*types)->commit_by_xid : + (*types)->rollback_by_xid))(xid)); + res= 0; + } + } return res; } + #ifndef DBUG_OFF /* this does not need to be multi-byte safe or anything */ static char* xid_to_str(char *buf, XID *xid) diff --git a/sql/item.h b/sql/item.h index 8e6b4e245d2..320591d4d99 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1616,7 +1616,7 @@ public: } Item *real_item() { - return (ref && *ref) ? (*ref)->real_item() : this; + return ref ? (*ref)->real_item() : this; } bool walk(Item_processor processor, byte *arg) { return (*ref)->walk(processor, arg); } diff --git a/sql/item_func.cc b/sql/item_func.cc index ef896ca3cfd..b716f56f21f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -32,6 +32,11 @@ #include "sp_rcontext.h" #include "sp.h" +#ifdef NO_EMBEDDED_ACCESS_CHECKS +#define sp_restore_security_context(A,B) while (0) {} +#endif + + bool check_reserved_words(LEX_STRING *name) { if (!my_strcasecmp(system_charset_info, name->str, "GLOBAL") || @@ -3028,9 +3033,13 @@ void debug_sync_point(const char* lock_name, uint lock_timeout) thd->mysys_var->current_cond= &ull->cond; set_timespec(abstime,lock_timeout); - while (!thd->killed && - pthread_cond_timedwait(&ull->cond, &LOCK_user_locks, - &abstime) != ETIMEDOUT && ull->locked) ; + while (ull->locked && !thd->killed) + { + int error= pthread_cond_timedwait(&ull->cond, &LOCK_user_locks, &abstime); + if (error == ETIMEDOUT || error == ETIME) + break; + } + if (ull->locked) { if (!--ull->count) @@ -3074,7 +3083,7 @@ longlong Item_func_get_lock::val_int() struct timespec abstime; THD *thd=current_thd; User_level_lock *ull; - int error=0; + int error; /* In slave thread no need to get locks, everything is serialized. Anyway @@ -3130,22 +3139,29 @@ longlong Item_func_get_lock::val_int() thd->mysys_var->current_cond= &ull->cond; set_timespec(abstime,timeout); - while (!thd->killed && - (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime)) - != ETIMEDOUT && error != EINVAL && ull->locked) ; - if (thd->killed) - error=EINTR; // Return NULL + error= 0; + while (ull->locked && !thd->killed) + { + error= pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime); + if (error == ETIMEDOUT || error == ETIME) + break; + error= 0; + } + if (ull->locked) { if (!--ull->count) + { + DBUG_ASSERT(0); delete ull; // Should never happen - if (error != ETIMEDOUT) + } + if (!error) // Killed (thd->killed != 0) { error=1; null_value=1; // Return NULL } } - else + else // We got the lock { ull->locked=1; ull->thread=thd->real_id; @@ -3267,6 +3283,7 @@ void Item_func_benchmark::print(String *str) str->append(')'); } + /* This function is just used to create tests with time gaps */ longlong Item_func_sleep::val_int() @@ -3287,10 +3304,14 @@ longlong Item_func_sleep::val_int() thd->mysys_var->current_mutex= &LOCK_user_locks; thd->mysys_var->current_cond= &cond; - while (!thd->killed && - (error= pthread_cond_timedwait(&cond, &LOCK_user_locks, - &abstime)) != ETIMEDOUT && - error != EINVAL) ; + error= 0; + while (!thd->killed) + { + error= pthread_cond_timedwait(&cond, &LOCK_user_locks, &abstime); + if (error == ETIMEDOUT || error == ETIME) + break; + error= 0; + } pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; @@ -3300,7 +3321,7 @@ longlong Item_func_sleep::val_int() pthread_mutex_unlock(&LOCK_user_locks); pthread_cond_destroy(&cond); - return (error == ETIMEDOUT) ? 0 : 1; + return test(!error); // Return 1 killed } @@ -4729,10 +4750,7 @@ Item_func_sp::execute(Item **itp) ER_FAILED_ROUTINE_BREAK_BINLOG, ER(ER_FAILED_ROUTINE_BREAK_BINLOG)); -#ifndef NO_EMBEDDED_ACCESS_CHECKS sp_restore_security_context(thd, save_ctx); -#endif - error: DBUG_RETURN(res); } @@ -4846,11 +4864,12 @@ Item_func_sp::tmp_table_field(TABLE *t_arg) find_and_check_access() thd thread handler want_access requested access - backup backup of security context or 0 + save backup of security context RETURN FALSE Access granted TRUE Requested access can't be granted or function doesn't exists + In this case security context is not changed and *save = 0 NOTES Checks if requested access to function can be granted to user. @@ -4865,12 +4884,11 @@ Item_func_sp::tmp_table_field(TABLE *t_arg) bool Item_func_sp::find_and_check_access(THD *thd, ulong want_access, - Security_context **backup) + Security_context **save) { - bool res; - Security_context *local_save, - **save= (backup ? backup : &local_save); - res= TRUE; + bool res= TRUE; + + *save= 0; // Safety if error if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) { my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); @@ -4880,26 +4898,31 @@ Item_func_sp::find_and_check_access(THD *thd, ulong want_access, #ifndef NO_EMBEDDED_ACCESS_CHECKS if (check_routine_access(thd, want_access, m_sp->m_db.str, m_sp->m_name.str, 0, FALSE)) - { goto error; - } sp_change_security_context(thd, m_sp, save); + /* + If we changed context to run as another user, we need to check the + access right for the new context again as someone may have deleted + this person the right to use the procedure + + TODO: + Cache if the definer has the right to use the object on the first + usage and only reset the cache if someone does a GRANT statement + that 'may' affect this. + */ if (*save && check_routine_access(thd, want_access, m_sp->m_db.str, m_sp->m_name.str, 0, FALSE)) { - goto error_check_ctx; + sp_restore_security_context(thd, *save); + *save= 0; // Safety + goto error; } - res= FALSE; -error_check_ctx: - if (*save && (res || !backup)) - sp_restore_security_context(thd, local_save); -error: -#else - res= 0; -error: #endif + res= FALSE; // no error + +error: return res; } @@ -4909,7 +4932,11 @@ Item_func_sp::fix_fields(THD *thd, Item **ref) bool res; DBUG_ASSERT(fixed == 0); res= Item_func::fix_fields(thd, ref); - if (!res && find_and_check_access(thd, EXECUTE_ACL, NULL)) - res= 1; + if (!res) + { + Security_context *save_ctx; + if (!(res= find_and_check_access(thd, EXECUTE_ACL, &save_ctx))) + sp_restore_security_context(thd, save_ctx); + } return res; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 018afac3812..1812256d532 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1964,21 +1964,16 @@ String *Item_func_char::val_str(String *str) int32 num=(int32) args[i]->val_int(); if (!args[i]->null_value) { -#ifdef USE_MB - if (use_mb(collation.collation)) - { - if (num&0xFF000000L) { - str->append((char)(num>>24)); - goto b2; - } else if (num&0xFF0000L) { -b2: str->append((char)(num>>16)); - goto b1; - } else if (num&0xFF00L) { -b1: str->append((char)(num>>8)); - } + if (num&0xFF000000L) { + str->append((char)(num>>24)); + goto b2; + } else if (num&0xFF0000L) { + b2: str->append((char)(num>>16)); + goto b1; + } else if (num&0xFF00L) { + b1: str->append((char)(num>>8)); } -#endif - str->append((char)num); + str->append((char) num); } } str->set_charset(collation.collation); @@ -1997,7 +1992,7 @@ b1: str->append((char)(num>>8)); enum MYSQL_ERROR::enum_warning_level level; uint diff= str->length() - wlen; set_if_smaller(diff, 3); - octet2hex(hexbuf, (const uchar*) str->ptr() + wlen, diff); + octet2hex(hexbuf, str->ptr() + wlen, diff); if (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)) { @@ -2436,6 +2431,7 @@ String *Item_func_collation::val_str(String *str) String *Item_func_hex::val_str(String *str) { + String *res; DBUG_ASSERT(fixed == 1); if (args[0]->result_type() != STRING_RESULT) { @@ -2464,24 +2460,16 @@ String *Item_func_hex::val_str(String *str) } /* Convert given string to a hex string, character by character */ - String *res= args[0]->val_str(str); - const char *from, *end; - char *to; - if (!res || tmp_value.alloc(res->length()*2)) + res= args[0]->val_str(str); + if (!res || tmp_value.alloc(res->length()*2+1)) { null_value=1; return 0; } null_value=0; tmp_value.length(res->length()*2); - for (from=res->ptr(), end=from+res->length(), to= (char*) tmp_value.ptr(); - from < end ; - from++, to+=2) - { - uint tmp=(uint) (uchar) *from; - to[0]=_dig_vec_upper[tmp >> 4]; - to[1]=_dig_vec_upper[tmp & 15]; - } + + octet2hex((char*) tmp_value.ptr(), res->ptr(), res->length()); return &tmp_value; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index fa098849a43..ec470bb242b 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -484,7 +484,7 @@ public: String *val_str(String *); void fix_length_and_dec() { - collation.set(default_charset()); + collation.set(&my_charset_bin); maybe_null=0; max_length=arg_count; } const char *func_name() const { return "char"; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 55c761d4c6e..ed6599f692f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -212,24 +212,18 @@ static inline int read_str(char **buf, char *buf_end, char **str, /* Transforms a string into "" or its expression in 0x... form. */ + char *str_to_hex(char *to, const char *from, uint len) { - char *p= to; if (len) { - p= strmov(p, "0x"); - for (uint i= 0; i < len; i++, p+= 2) - { - /* val[i] is char. Casting to uchar helps greatly if val[i] < 0 */ - uint tmp= (uint) (uchar) from[i]; - p[0]= _dig_vec_upper[tmp >> 4]; - p[1]= _dig_vec_upper[tmp & 15]; - } - *p= 0; + *to++= '0'; + *to++= 'x'; + to= octet2hex(to, from, len); } else - p= strmov(p, "\"\""); - return p; // pointer to end 0 of 'to' + to= strmov(to, "\"\""); + return to; // pointer to end 0 of 'to' } /* diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 5c7053e6e2a..d3e5645bafc 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -372,8 +372,10 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, if (revision > 0 && !access(arc_path, F_OK)) { - ulonglong limit= (revision > num_view_backups) ? revision - num_view_backups : 0; - while (revision > limit) { + ulonglong limit= ((revision > num_view_backups) ? + revision - num_view_backups : 0); + for (; revision > limit ; revision--) + { my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu", arc_path, old_name, reg_ext, (ulong)revision); (void) unpack_filename(old_path, old_path); @@ -381,7 +383,6 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, arc_path, new_name, reg_ext, (ulong)revision); (void) unpack_filename(new_path, new_path); my_rename(old_path, new_path, MYF(0)); - revision--; } } return 0; diff --git a/sql/password.c b/sql/password.c index aa05be8c740..562df3ae226 100644 --- a/sql/password.c +++ b/sql/password.c @@ -316,18 +316,21 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st) octet2hex() buf OUT output buffer. Must be at least 2*len+1 bytes str, len IN the beginning and the length of the input string + + RETURN + buf+len*2 */ -void -octet2hex(char *to, const unsigned char *str, uint len) +char *octet2hex(char *to, const char *str, uint len) { - const uint8 *str_end= str + len; + const byte *str_end= str + len; for (; str != str_end; ++str) { - *to++= _dig_vec_upper[(*str & 0xF0) >> 4]; - *to++= _dig_vec_upper[*str & 0x0F]; + *to++= _dig_vec_upper[((uchar) *str) >> 4]; + *to++= _dig_vec_upper[((uchar) *str) & 0x0F]; } *to= '\0'; + return to; } diff --git a/sql/slave.cc b/sql/slave.cc index b1763187d04..cc7ec5e5ae8 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2747,7 +2747,7 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name, else pthread_cond_wait(&data_cond, &data_lock); DBUG_PRINT("info",("Got signal of master update or timed out")); - if (error == ETIMEDOUT) + if (error == ETIMEDOUT || error == ETIME) { error= -1; break; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 51b9fe43796..35187047364 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2784,7 +2784,6 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, Natural_join_column *nj_col; Field *found_field; Query_arena *arena, backup; - DBUG_ENTER("find_field_in_natural_join"); DBUG_PRINT("enter", ("field name: '%s', ref 0x%lx", name, (ulong) ref)); @@ -2809,6 +2808,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, if (nj_col->view_field) { + Item *item; /* The found field is a view field, we do as in find_field_in_view() and return a pointer to pointer to the Item of that field. @@ -2816,7 +2816,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, if (register_tree_change) arena= thd->activate_stmt_arena_if_needed(&backup); - Item *item= nj_col->create_item(thd); + item= nj_col->create_item(thd); if (register_tree_change && arena) thd->restore_active_arena(arena, &backup); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index cc4b291b5d1..fbfce2e3a31 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1809,7 +1809,7 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg) #endif if (thd->killed || di->status) break; - if (error == ETIMEDOUT) + if (error == ETIMEDOUT || error == ETIME) { thd->killed= THD::KILL_CONNECTION; break; diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc index 0af6a80d4c2..54599314293 100644 --- a/sql/sql_manager.cc +++ b/sql/sql_manager.cc @@ -58,12 +58,14 @@ extern "C" pthread_handler_decl(handle_manager,arg __attribute__((unused))) set_timespec(abstime, flush_time); reset_flush_time = FALSE; } - while (!manager_status && !error && !abort_loop) - error = pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime); + while (!manager_status && (!error || error == EINTR) && !abort_loop) + error= pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime); } else - while (!manager_status && !error && !abort_loop) - error = pthread_cond_wait(&COND_manager, &LOCK_manager); + { + while (!manager_status && (!error || error == EINTR) && !abort_loop) + error= pthread_cond_wait(&COND_manager, &LOCK_manager); + } status = manager_status; manager_status = 0; pthread_mutex_unlock(&LOCK_manager); @@ -71,7 +73,7 @@ extern "C" pthread_handler_decl(handle_manager,arg __attribute__((unused))) if (abort_loop) break; - if (error) /* == ETIMEDOUT */ + if (error == ETIMEDOUT || error == ETIME) { flush_tables(); error = 0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8a6b776e803..e28eff4f577 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5054,11 +5054,16 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name, tables->db= db; tables->table_name= tables->alias= name; - if ((thd->security_ctx->master_access & want_access) == want_access && - !thd->db) + /* + The following test is just a shortcut for check_access() (to avoid + calculating db_access) under the assumption that it's common to + give persons global right to execute all stored SP (but not + necessary to create them). + */ + if ((thd->security_ctx->master_access & want_access) == want_access) tables->grant.privilege= want_access; else if (check_access(thd,want_access,db,&tables->grant.privilege, - 0, no_errors, test(tables->schema_table))) + 0, no_errors, 0)) return TRUE; #ifndef NO_EMBEDDED_ACCESS_CHECKS diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index aebe7880451..5f3539ca1e9 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2887,7 +2887,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) thd->protocol= &thd->protocol_simple; /* use normal protocol */ /* Assert that if an error, no cursor is open */ - DBUG_ASSERT(! (rc && cursor)); + DBUG_ASSERT(! (error && cursor)); if (! cursor) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1b1a35d2584..f38ef19614e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2474,11 +2474,11 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, and use them in equality propagation process (see details in OptimizerKBAndTodo) */ - if ((cond->functype() == Item_func::BETWEEN) && - value[0]->eq(value[1], field->binary())) - eq_func= TRUE; - else + if ((cond->functype() != Item_func::BETWEEN) || + ((Item_func_between*) cond)->negated || + !value[0]->eq(value[1], field->binary())) return; + eq_func= TRUE; } if (field->result_type() == STRING_RESULT) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2d98e834de7..1eb8aa1acb9 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1258,9 +1258,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) VOID(pthread_mutex_unlock(&LOCK_thread_count)); thread_info *thd_info; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - Security_context *sctx; -#endif time_t now= time(0); while ((thd_info=thread_infos.get())) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8fb39ea3098..9c3ea710dfc 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3156,15 +3156,14 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (create_info->row_type == ROW_TYPE_NOT_USED) create_info->row_type= table->s->row_type; - DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type)); - if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) - || ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED)) + DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type)); + if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) || + ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED)) { DBUG_PRINT("info", ("doesn't support alter")); my_error(ER_ILLEGAL_HA, MYF(0), table_name); DBUG_RETURN(TRUE); } - DBUG_PRINT("info", ("supports alter")); thd->proc_info="setup"; if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) && diff --git a/sql/sql_view.cc b/sql/sql_view.cc index f956d9d4928..5db08275735 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1427,7 +1427,7 @@ mysql_rename_view(THD *thd, /* get view definition and source */ if (parser->parse((gptr)&view_def, thd->mem_root, view_parameters, - sizeof(view_parameters)/sizeof(view_parameters[0])-1)) + array_elements(view_parameters)-1)) goto err; /* rename view and it's backups */ diff --git a/sql/unireg.cc b/sql/unireg.cc index d297b143d3b..7c244b20a8b 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -474,16 +474,10 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, char *dst; uint length= field->interval->type_lengths[pos], hex_length; const char *src= field->interval->type_names[pos]; - const char *srcend= src + length; hex_length= length * 2; field->interval->type_lengths[pos]= hex_length; field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1); - for ( ; src < srcend; src++) - { - *dst++= _dig_vec_upper[((uchar) *src) >> 4]; - *dst++= _dig_vec_upper[((uchar) *src) & 15]; - } - *dst= '\0'; + octet2hex(dst, src, length); } } From 281b8e26d8805520e6307722e95cf2dd07c7eb3e Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Oct 2005 15:23:34 -0700 Subject: [PATCH 067/322] Fix read past allocated buffer when parsing charsets file. (Bug #6413) --- strings/xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/xml.c b/strings/xml.c index 6ba52ea41a8..cec15b99f10 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -81,7 +81,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a) a->beg=p->cur; a->end=p->cur; - if (!bcmp(p->cur,"", 3); p->cur++) {} From c248a36e30a05c57e1017fcaae9a6f4e30540d9e Mon Sep 17 00:00:00 2001 From: "grog@mysql.com" <> Date: Wed, 12 Oct 2005 09:47:59 +0200 Subject: [PATCH 068/322] sql_yacc.yy: Bug #10308: Parse 'purge master logs' with subselect correctly. subselect.test: Bug #10308: Test for 'purge master logs' with subselect. subselect.result: Bug #10308: Test result for 'purge master logs' with subselect. --- mysql-test/r/subselect.result | 1 + mysql-test/t/subselect.test | 6 ++++++ sql/sql_yacc.yy | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 8652ed89a65..4c795abe986 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2834,3 +2834,4 @@ a 3 4 DROP TABLE t1,t2,t3; +purge master logs before (select adddate(current_timestamp(), interval -4 day)); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 3d21456ee45..cbc7a3afb5f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1814,4 +1814,10 @@ SELECT * FROM t1 DROP TABLE t1,t2,t3; +# +# BUG #10308: purge log with subselect +# + +purge master logs before (select adddate(current_timestamp(), interval -4 day)); + # End of 4.1 tests diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2ce419086a0..82f9c5a288f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4715,7 +4715,10 @@ purge_option: } | BEFORE_SYM expr { - if ($2->check_cols(1) || $2->fix_fields(Lex->thd, 0, &$2)) + if (!$2) + /* Can only be an out of memory situation, no need for a message */ + YYABORT; + if ($2->fix_fields(Lex->thd, 0, &$2) || $2->check_cols(1)) { net_printf(Lex->thd, ER_WRONG_ARGUMENTS, "PURGE LOGS BEFORE"); YYABORT; From 4b2a0f0c70e31ab7796d0adb84127ad073ed26af Mon Sep 17 00:00:00 2001 From: "gluh@eagle.intranet.mysql.r18.ru" <> Date: Wed, 12 Oct 2005 13:18:46 +0500 Subject: [PATCH 069/322] after merge fix --- config/ac-macros/yassl.m4 | 2 +- sql/mysqld.cc | 34 ++++++++++++++------------- sql/sql_parse.cc | 48 +++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4 index 972e4530dab..dcd72cb14f1 100644 --- a/config/ac-macros/yassl.m4 +++ b/config/ac-macros/yassl.m4 @@ -20,7 +20,7 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [ -L\$(top_builddir)/extra/yassl/taocrypt/src -ltaocrypt" openssl_includes="-I\$(top_srcdir)/extra/yassl/include" AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.]) - + AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.]) # System specific checks yassl_integer_extra_cxxflags="" case $host_cpu--$CXX_VERSION in diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ed7c52cb859..5befcd6d503 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -580,21 +580,21 @@ HANDLE smem_event_connect_request= 0; #include "sslopt-vars.h" #ifdef HAVE_OPENSSL #include - +#ifndef HAVE_YASSL typedef struct CRYPTO_dynlock_value { rw_lock_t lock; } openssl_lock_t; -char *des_key_file; -struct st_VioSSLAcceptorFd *ssl_acceptor_fd; static openssl_lock_t *openssl_stdlocks; - static openssl_lock_t *openssl_dynlock_create(const char *, int); static void openssl_dynlock_destroy(openssl_lock_t *, const char *, int); static void openssl_lock_function(int, int, const char *, int); static void openssl_lock(int, openssl_lock_t *, const char *, int); static unsigned long openssl_id_function(); +#endif +char *des_key_file; +struct st_VioSSLAcceptorFd *ssl_acceptor_fd; #endif /* HAVE_OPENSSL */ @@ -1184,10 +1184,12 @@ static void clean_up_mutexes() (void) pthread_mutex_destroy(&LOCK_user_conn); #ifdef HAVE_OPENSSL (void) pthread_mutex_destroy(&LOCK_des_key_file); +#ifndef HAVE_YASSL for (int i= 0; i < CRYPTO_num_locks(); ++i) (void) rwlock_destroy(&openssl_stdlocks[i].lock); OPENSSL_free(openssl_stdlocks); #endif +#endif #ifdef HAVE_REPLICATION (void) pthread_mutex_destroy(&LOCK_rpl_status); (void) pthread_cond_destroy(&COND_rpl_status); @@ -2743,6 +2745,17 @@ static int init_thread_environment() (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST); #ifdef HAVE_OPENSSL (void) pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST); +#ifndef HAVE_YASSL + openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * + sizeof(openssl_lock_t)); + for (int i= 0; i < CRYPTO_num_locks(); ++i) + (void) my_rwlock_init(&openssl_stdlocks[i].lock, NULL); + CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); + CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); + CRYPTO_set_dynlock_lock_callback(openssl_lock); + CRYPTO_set_locking_callback(openssl_lock_function); + CRYPTO_set_id_callback(openssl_id_function); +#endif #endif (void) my_rwlock_init(&LOCK_sys_init_connect, NULL); (void) my_rwlock_init(&LOCK_sys_init_slave, NULL); @@ -2771,22 +2784,11 @@ static int init_thread_environment() sql_print_error("Can't create thread-keys"); return 1; } -#ifdef HAVE_OPENSSL - openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * - sizeof(openssl_lock_t)); - for (int i= 0; i < CRYPTO_num_locks(); ++i) - (void) my_rwlock_init(&openssl_stdlocks[i].lock, NULL); - CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); - CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); - CRYPTO_set_dynlock_lock_callback(openssl_lock); - CRYPTO_set_locking_callback(openssl_lock_function); - CRYPTO_set_id_callback(openssl_id_function); -#endif return 0; } -#ifdef HAVE_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL) static unsigned long openssl_id_function() { return (unsigned long) pthread_self(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 96b9dd84011..b6f23e635c0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3194,36 +3194,36 @@ end_with_restore_list: if (result != 2) break; case SQLCOM_UPDATE_MULTI: + { + DBUG_ASSERT(first_table == all_tables && first_table != 0); + /* if we switched from normal update, rights are checked */ + if (result != 2) { - DBUG_ASSERT(first_table == all_tables && first_table != 0); - /* if we switched from normal update, rights are checked */ - if (result != 2) - { - if ((res= multi_update_precheck(thd, all_tables))) - break; - } - else - res= 0; + if ((res= multi_update_precheck(thd, all_tables))) + break; + } + else + res= 0; - if ((res= mysql_multi_update_prepare(thd))) - break; + if ((res= mysql_multi_update_prepare(thd))) + break; #ifdef HAVE_REPLICATION - /* Check slave filtering rules */ - if (thd->slave_thread && all_tables_not_ok(thd, all_tables)) - { - /* we warn the slave SQL thread */ - my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); - break; - } + /* Check slave filtering rules */ + if (thd->slave_thread && all_tables_not_ok(thd, all_tables)) + { + /* we warn the slave SQL thread */ + my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); + break; + } #endif /* HAVE_REPLICATION */ - res= mysql_multi_update(thd, all_tables, - &select_lex->item_list, - &lex->value_list, - select_lex->where, - select_lex->options, - lex->duplicates, lex->ignore, unit, select_lex); + res= mysql_multi_update(thd, all_tables, + &select_lex->item_list, + &lex->value_list, + select_lex->where, + select_lex->options, + lex->duplicates, lex->ignore, unit, select_lex); break; } case SQLCOM_REPLACE: From 4c1c9db82337e7dad50d0435dc5e65de283fe975 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 12 Oct 2005 13:29:55 +0200 Subject: [PATCH 070/322] Fix for BUG#13023: "SQL Thread is up but doesn't move forward". Details in slave.cc; in short we now record whenever the slave I/O thread ignores a master's event because of its server id, and use this info in the slave SQL thread to advance Exec_master_log_pos. Because if we do not, this variable stays at the position of the last executed event, i.e. the last *non-ignored* executed one, which may not be the last of the master's binlog (and so the slave *looks* behind the master though it's data-wise it's not). --- mysql-test/r/rpl_dual_pos_advance.result | 22 ++++ mysql-test/t/rpl_dual_pos_advance-master.opt | 0 mysql-test/t/rpl_dual_pos_advance.test | 108 ++++++++++++++++ sql/log.cc | 6 +- sql/log_event.cc | 42 ++++-- sql/log_event.h | 28 ++-- sql/slave.cc | 128 ++++++++++++++++--- sql/slave.h | 11 ++ 8 files changed, 304 insertions(+), 41 deletions(-) create mode 100644 mysql-test/r/rpl_dual_pos_advance.result create mode 100644 mysql-test/t/rpl_dual_pos_advance-master.opt create mode 100644 mysql-test/t/rpl_dual_pos_advance.test diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/r/rpl_dual_pos_advance.result new file mode 100644 index 00000000000..257baa81b74 --- /dev/null +++ b/mysql-test/r/rpl_dual_pos_advance.result @@ -0,0 +1,22 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; +start slave; +create table t1 (n int); +create table t4 (n int); +create table t5 (n int); +create table t6 (n int); +show tables; +Tables_in_test +t1 +t4 +t5 +t6 +stop slave; +reset slave; +drop table t1,t4,t5,t6; diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/t/rpl_dual_pos_advance-master.opt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test new file mode 100644 index 00000000000..518fa9df885 --- /dev/null +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -0,0 +1,108 @@ +# This test checks that in a dual-head setup +# A->B->A, where A has --log-slave-updates (why would it? +# assume that there is a C as slave of A), +# then the Exec_master_log_pos of SHOW SLAVE STATUS does +# not stay too low on B(BUG#13023 due to events ignored because +# of their server id). +# It also will test BUG#13861. + +source include/master-slave.inc; + + +# set up "dual head" + +connection slave; +reset master; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"; + +start slave; + +# now we test it + +connection slave; + +create table t1 (n int); + +save_master_pos; +connection master; +sync_with_master; + +# Now test BUG#13861. This will be enabled when Guilhem fixes this +# bug. + +# stop slave + +# create table t2 (n int); # create one ignored event + +# save_master_pos; +# connection slave; +# sync_with_master; + +# connection slave; + +# show tables; + +# save_master_pos; + +# create table t3 (n int); + +# connection master; + +# bug is that START SLAVE UNTIL may stop too late, we test that by +# asking it to stop before creation of t3. + +# start slave until master_log_file="slave-bin.000001",master_log_pos=195; + +# wait until it's started (the position below is the start of "CREATE +# TABLE t2") (otherwise wait_for_slave_to_stop may return at once) + +# select master_pos_wait("slave-bin.000001",137); + +# wait_for_slave_to_stop; + +# then BUG#13861 causes t3 to show up below (because stopped too +# late). + +# show tables; + +# start slave; + +# BUG#13023 is that Exec_master_log_pos may stay too low "forever": + +connection master; + +create table t4 (n int); # create 3 ignored events +create table t5 (n int); +create table t6 (n int); + +save_master_pos; +connection slave; +sync_with_master; + +connection slave; + +save_master_pos; + +connection master; + +# then BUG#13023 caused hang below ("master" looks behind, while it's +# not in terms of updates done). + +sync_with_master; + +show tables; + +# cleanup + +stop slave; +reset slave; +drop table t1,t4,t5,t6; # add t2 and t3 later + +save_master_pos; +connection slave; +sync_with_master; + +# End of 4.1 tests diff --git a/sql/log.cc b/sql/log.cc index a67f35e30bf..c530f15a84f 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1028,7 +1028,8 @@ void MYSQL_LOG::new_file(bool need_lock) to change base names at some point. */ THD *thd = current_thd; /* may be 0 if we are reacting to SIGHUP */ - Rotate_log_event r(thd,new_name+dirname_length(new_name)); + Rotate_log_event r(thd,new_name+dirname_length(new_name), + 0, LOG_EVENT_OFFSET, 0); r.set_log_pos(this); r.write(&log_file); bytes_written += r.get_event_len(); @@ -1106,7 +1107,7 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...) DBUG_ASSERT(log_file.type == SEQ_READ_APPEND); - pthread_mutex_lock(&LOCK_log); + safe_mutex_assert_owner(&LOCK_log); do { if (my_b_append(&log_file,(byte*) buf,len)) @@ -1125,7 +1126,6 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...) } err: - pthread_mutex_unlock(&LOCK_log); if (!error) signal_update(); DBUG_RETURN(error); diff --git a/sql/log_event.cc b/sql/log_event.cc index b08439a20b8..be4654bccd3 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2013,18 +2013,44 @@ void Rotate_log_event::print(FILE* file, bool short_form, char* last_db) #endif /* MYSQL_CLIENT */ + /* - Rotate_log_event::Rotate_log_event() + Rotate_log_event::Rotate_log_event() (2 constructors) */ + +#ifndef MYSQL_CLIENT +Rotate_log_event::Rotate_log_event(THD* thd_arg, + const char* new_log_ident_arg, + uint ident_len_arg, ulonglong pos_arg, + uint flags_arg) + :Log_event(), new_log_ident(new_log_ident_arg), + pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg : + (uint) strlen(new_log_ident_arg)), flags(flags_arg) +{ +#ifndef DBUG_OFF + char buff[22]; + DBUG_ENTER("Rotate_log_event::Rotate_log_event(THD*,...)"); + DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg, + llstr(pos_arg, buff), flags)); +#endif + if (flags & DUP_NAME) + new_log_ident= my_strdup_with_length(new_log_ident_arg, + ident_len, + MYF(MY_WME)); + DBUG_VOID_RETURN; +} +#endif + + Rotate_log_event::Rotate_log_event(const char* buf, int event_len, bool old_format) - :Log_event(buf, old_format),new_log_ident(NULL),alloced(0) + :Log_event(buf, old_format), new_log_ident(0), flags(DUP_NAME) { // The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET int header_size = (old_format) ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN; uint ident_offset; - DBUG_ENTER("Rotate_log_event"); + DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)"); if (event_len < header_size) DBUG_VOID_RETURN; @@ -2043,12 +2069,9 @@ Rotate_log_event::Rotate_log_event(const char* buf, int event_len, ident_offset = ROTATE_HEADER_LEN; } set_if_smaller(ident_len,FN_REFLEN-1); - if (!(new_log_ident= my_strdup_with_length((byte*) buf + - ident_offset, - (uint) ident_len, - MYF(MY_WME)))) - DBUG_VOID_RETURN; - alloced = 1; + new_log_ident= my_strdup_with_length((byte*) buf + ident_offset, + (uint) ident_len, + MYF(MY_WME)); DBUG_VOID_RETURN; } @@ -2060,6 +2083,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, int event_len, int Rotate_log_event::write_data(IO_CACHE* file) { char buf[ROTATE_HEADER_LEN]; + DBUG_ASSERT(!(flags & ZERO_LEN)); // such an event cannot be written int8store(buf + R_POS_OFFSET, pos); return (my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) || my_b_safe_write(file, (byte*)new_log_ident, (uint) ident_len)); diff --git a/sql/log_event.h b/sql/log_event.h index 5c81d0c92f0..6c4e65f7460 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -434,7 +434,7 @@ public: } virtual int get_data_size() { return 0;} virtual int get_data_body_offset() { return 0; } - int get_event_len() + virtual int get_event_len() { return (cached_event_len ? cached_event_len : (cached_event_len = LOG_EVENT_HEADER_LEN + get_data_size())); @@ -849,18 +849,18 @@ public: class Rotate_log_event: public Log_event { public: + enum { + ZERO_LEN= 1, // if event should report 0 as its length + DUP_NAME= 2 // if constructor should dup the string argument + }; const char* new_log_ident; ulonglong pos; uint ident_len; - bool alloced; + uint flags; #ifndef MYSQL_CLIENT Rotate_log_event(THD* thd_arg, const char* new_log_ident_arg, - uint ident_len_arg = 0, - ulonglong pos_arg = LOG_EVENT_OFFSET) - :Log_event(), new_log_ident(new_log_ident_arg), - pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg : - (uint) strlen(new_log_ident_arg)), alloced(0) - {} + uint ident_len_arg, + ulonglong pos_arg, uint flags); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); @@ -872,10 +872,18 @@ public: Rotate_log_event(const char* buf, int event_len, bool old_format); ~Rotate_log_event() { - if (alloced) - my_free((gptr) new_log_ident, MYF(0)); + if (flags & DUP_NAME) + my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR)); } Log_event_type get_type_code() { return ROTATE_EVENT;} + virtual int get_event_len() + { + if (flags & ZERO_LEN) + return 0; + if (cached_event_len == 0) + cached_event_len= LOG_EVENT_HEADER_LEN + get_data_size(); + return cached_event_len; + } int get_data_size() { return ident_len + ROTATE_HEADER_LEN;} bool is_valid() { return new_log_ident != 0; } int write_data(IO_CACHE* file); diff --git a/sql/slave.cc b/sql/slave.cc index 1be3e3b4a17..ebae8461f11 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1739,6 +1739,55 @@ static int count_relay_log_space(RELAY_LOG_INFO* rli) } +/* + Builds a Rotate from the ignored events' info and writes it to relay log. + + SYNOPSIS + write_ignored_events_info_to_relay_log() + thd pointer to I/O thread's thd + mi + + DESCRIPTION + Slave I/O thread, going to die, must leave a durable trace of the + ignored events' end position for the use of the slave SQL thread, by + calling this function. Only that thread can call it (see assertion). + */ +static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi) +{ + RELAY_LOG_INFO *rli= &mi->rli; + pthread_mutex_t *log_lock= rli->relay_log.get_log_lock(); + DBUG_ASSERT(thd == mi->io_thd); + pthread_mutex_lock(log_lock); + if (rli->ign_master_log_name_end[0]) + { + DBUG_PRINT("info",("writing a Rotate event to track down ignored events")); + Rotate_log_event *ev= new Rotate_log_event(thd, rli->ign_master_log_name_end, + 0, rli->ign_master_log_pos_end, + Rotate_log_event::DUP_NAME); + rli->ign_master_log_name_end[0]= 0; + /* can unlock before writing as slave SQL thd will soon see our Rotate */ + pthread_mutex_unlock(log_lock); + if (likely((bool)ev)) + { + ev->server_id= 0; // don't be ignored by slave SQL thread + if (unlikely(rli->relay_log.append(ev))) + sql_print_error("Slave I/O thread failed to write a Rotate event" + " to the relay log, " + "SHOW SLAVE STATUS may be inaccurate"); + rli->relay_log.harvest_bytes_written(&rli->log_space_total); + flush_master_info(mi, 1); + delete ev; + } + else + sql_print_error("Slave I/O thread failed to create a Rotate event" + " (out of memory?), " + "SHOW SLAVE STATUS may be inaccurate"); + } + else + pthread_mutex_unlock(log_lock); +} + + void init_master_info_with_options(MASTER_INFO* mi) { mi->master_log_name[0] = 0; @@ -2334,7 +2383,7 @@ st_relay_log_info::st_relay_log_info() { group_relay_log_name[0]= event_relay_log_name[0]= group_master_log_name[0]= 0; - last_slave_error[0]=0; until_log_name[0]= 0; + last_slave_error[0]= until_log_name[0]= ign_master_log_name_end[0]= 0; bzero((char*) &info_file, sizeof(info_file)); bzero((char*) &cache_buf, sizeof(cache_buf)); @@ -2886,11 +2935,20 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) */ pthread_mutex_lock(&rli->data_lock); + /* + This tests if the position of the end of the last previous executed event + hits the UNTIL barrier. + We would prefer to test if the position of the start (or possibly) end of + the to-be-read event hits the UNTIL barrier, this is different if there + was an event ignored by the I/O thread just before (BUG#13861 to be + fixed). + */ if (rli->until_condition!=RELAY_LOG_INFO::UNTIL_NONE && rli->is_until_satisfied()) { + char buf[22]; sql_print_error("Slave SQL thread stopped because it reached its" - " UNTIL position %ld", (long) rli->until_pos()); + " UNTIL position %s", llstr(rli->until_pos(), buf)); /* Setting abort_slave flag because we do not want additional message about error in query execution to be printed. @@ -2925,7 +2983,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) if ((ev->server_id == (uint32) ::server_id && !replicate_same_server_id) || (rli->slave_skip_counter && type_code != ROTATE_EVENT)) { - /* TODO: I/O thread should not even log events with the same server id */ rli->inc_group_relay_log_pos(ev->get_event_len(), type_code != STOP_EVENT ? ev->log_pos : LL(0), 1/* skip lock*/); @@ -3033,7 +3090,8 @@ extern "C" pthread_handler_decl(handle_slave_io,arg) { THD *thd; // needs to be first for thread_stack MYSQL *mysql; - MASTER_INFO *mi = (MASTER_INFO*)arg; + MASTER_INFO *mi = (MASTER_INFO*)arg; + RELAY_LOG_INFO *rli= &mi->rli; char llbuff[22]; uint retry_count; @@ -3276,16 +3334,16 @@ reconnect done to recover from failed read"); char llbuf1[22], llbuf2[22]; DBUG_PRINT("info", ("log_space_limit=%s log_space_total=%s \ ignore_log_space_limit=%d", - llstr(mi->rli.log_space_limit,llbuf1), - llstr(mi->rli.log_space_total,llbuf2), - (int) mi->rli.ignore_log_space_limit)); + llstr(rli->log_space_limit,llbuf1), + llstr(rli->log_space_total,llbuf2), + (int) rli->ignore_log_space_limit)); } #endif - if (mi->rli.log_space_limit && mi->rli.log_space_limit < - mi->rli.log_space_total && - !mi->rli.ignore_log_space_limit) - if (wait_for_relay_log_space(&mi->rli)) + if (rli->log_space_limit && rli->log_space_limit < + rli->log_space_total && + !rli->ignore_log_space_limit) + if (wait_for_relay_log_space(rli)) { sql_print_error("Slave I/O thread aborted while waiting for relay \ log space"); @@ -3316,6 +3374,7 @@ err: mysql_close(mysql); mi->mysql=0; } + write_ignored_events_info_to_relay_log(thd, mi); thd->proc_info = "Waiting for slave mutex on exit"; pthread_mutex_lock(&mi->run_lock); mi->slave_running = 0; @@ -3668,6 +3727,7 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev) if (unlikely(!rev->is_valid())) DBUG_RETURN(1); + /* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */ memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1); mi->master_log_pos= rev->pos; DBUG_PRINT("info", ("master_log_pos: '%s' %d", @@ -3813,6 +3873,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) int error= 0; ulong inc_pos; RELAY_LOG_INFO *rli= &mi->rli; + pthread_mutex_t *log_lock= rli->relay_log.get_log_lock(); DBUG_ENTER("queue_event"); if (mi->old_format) @@ -3820,11 +3881,6 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) pthread_mutex_lock(&mi->data_lock); - /* - TODO: figure out if other events in addition to Rotate - require special processing. - Guilhem 2003-06 : I don't think so. - */ switch (buf[EVENT_TYPE_OFFSET]) { case STOP_EVENT: /* @@ -3873,16 +3929,27 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) direct master (an unsupported, useless setup!). */ + pthread_mutex_lock(log_lock); + if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) && !replicate_same_server_id) { /* Do not write it to the relay log. - We still want to increment, so that we won't re-read this event from the - master if the slave IO thread is now stopped/restarted (more efficient if - the events we are ignoring are big LOAD DATA INFILE). + a) We still want to increment mi->master_log_pos, so that we won't + re-read this event from the master if the slave IO thread is now + stopped/restarted (more efficient if the events we are ignoring are big + LOAD DATA INFILE). + b) We want to record that we are skipping events, for the information of + the slave SQL thread, otherwise that thread may let + rli->group_relay_log_pos stay too small if the last binlog's event is + ignored. */ mi->master_log_pos+= inc_pos; + memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); + DBUG_ASSERT(rli->ign_master_log_name_end[0]); + rli->ign_master_log_pos_end= mi->master_log_pos; + rli->relay_log.signal_update(); // the slave SQL thread needs to re-check DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); } else @@ -3894,7 +3961,9 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); rli->relay_log.harvest_bytes_written(&rli->log_space_total); } + rli->ign_master_log_name_end[0]= 0; // last event is not ignored } + pthread_mutex_unlock(log_lock); err: pthread_mutex_unlock(&mi->data_lock); @@ -4262,6 +4331,27 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", rli->last_master_timestamp= 0; DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count); + + if (rli->ign_master_log_name_end[0]) + { + /* We generate and return a Rotate, to make our positions advance */ + DBUG_PRINT("info",("seeing an ignored end segment")); + ev= new Rotate_log_event(thd, rli->ign_master_log_name_end, + 0, rli->ign_master_log_pos_end, + Rotate_log_event::DUP_NAME | + Rotate_log_event::ZERO_LEN); + rli->ign_master_log_name_end[0]= 0; + if (unlikely(!ev)) + { + errmsg= "Slave SQL thread failed to create a Rotate event " + "(out of memory?), SHOW SLAVE STATUS may be inaccurate"; + goto err; + } + pthread_mutex_unlock(log_lock); + ev->server_id= 0; // don't be ignored by slave SQL thread + DBUG_RETURN(ev); + } + /* We can, and should release data_lock while we are waiting for update. If we do not, show slave status will block diff --git a/sql/slave.h b/sql/slave.h index 5a85e26d9ad..f780b7c8473 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -304,6 +304,17 @@ typedef struct st_relay_log_info */ ulong trans_retries, retried_trans; + /* + If the end of the hot relay log is made of master's events ignored by the + slave I/O thread, these two keep track of the coords (in the master's + binlog) of the last of these events seen by the slave I/O thread. If not, + ign_master_log_name_end[0] == 0. + As they are like a Rotate event read/written from/to the relay log, they + are both protected by rli->relay_log.LOCK_log. + */ + char ign_master_log_name_end[FN_REFLEN]; + ulonglong ign_master_log_pos_end; + st_relay_log_info(); ~st_relay_log_info(); From 0ac28d3187afcdd159b12d9cfbc20dd613ce5a2b Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 12 Oct 2005 13:56:07 +0200 Subject: [PATCH 071/322] Always test ssl and compress - Updated after review --- client/mysqltest.c | 176 +++++++++++++++++++-------- mysql-test/mysql-test-run.pl | 13 +- mysql-test/r/connect.result | 20 +++ mysql-test/r/mysqltest.result | 12 ++ mysql-test/t/compress.test | 4 +- mysql-test/t/connect.test | 82 +++++++------ mysql-test/t/information_schema.test | 4 +- mysql-test/t/myisam.test | 3 + mysql-test/t/mysqltest.test | 68 ++++++++++- mysql-test/t/openssl_1.test | 10 +- mysql-test/t/sp-security.test | 1 + mysql-test/t/ssl.test | 5 +- mysql-test/t/ssl_compress.test | 6 +- sql/mysqld.cc | 2 - sql/sql_show.cc | 2 - sql/structs.h | 2 - 16 files changed, 278 insertions(+), 132 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index bcdba237b0d..9012368c4de 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -73,7 +73,6 @@ #define PAD_SIZE 128 #define MAX_CONS 128 #define MAX_INCLUDE_DEPTH 16 -#define LAZY_GUESS_BUF_SIZE 8192 #define INIT_Q_LINES 1024 #define MIN_VAR_ALLOC 32 #define BLOCK_STACK_DEPTH 32 @@ -309,8 +308,6 @@ Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, Q_EXEC, Q_DELIMITER, Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, -Q_DISABLE_SSL, Q_ENABLE_SSL, -Q_DISABLE_COMPRESS, Q_ENABLE_COMPRESS, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, @@ -397,10 +394,6 @@ const char *command_names[]= "delimiter", "disable_abort_on_error", "enable_abort_on_error", - "disable_ssl", - "enable_ssl", - "disable_compress", - "enable_compress", "vertical_results", "horizontal_results", "query_vertical", @@ -1839,6 +1832,19 @@ void free_replace() DBUG_VOID_RETURN; } +struct connection * find_connection_by_name(const char *name) +{ + struct connection *con; + for (con= cons; con < next_con; con++) + { + if (!strcmp(con->name, name)) + { + return con; + } + } + return 0; /* Connection not found */ +} + int select_connection_name(const char *name) { @@ -1846,16 +1852,9 @@ int select_connection_name(const char *name) DBUG_ENTER("select_connection2"); DBUG_PRINT("enter",("name: '%s'", name)); - for (con= cons; con < next_con; con++) - { - if (!strcmp(con->name, name)) - { - cur_con= con; - DBUG_RETURN(0); - } - } - die("connection '%s' not found in connection pool", name); - DBUG_RETURN(1); /* Never reached */ + if (!(cur_con= find_connection_by_name(name))) + die("connection '%s' not found in connection pool", name); + DBUG_RETURN(0); } @@ -1885,7 +1884,7 @@ int close_connection(struct st_query *q) DBUG_PRINT("enter",("name: '%s'",p)); if (!*p) - die("Missing connection name in connect"); + die("Missing connection name in disconnect"); name= p; while (*p && !my_isspace(charset_info,*p)) p++; @@ -1908,6 +1907,14 @@ int close_connection(struct st_query *q) } #endif mysql_close(&con->mysql); + my_free(con->name, MYF(0)); + /* + When the connection is closed set name to "closed_connection" + to make it possible to reuse the connection name. + The connection slot will not be reused + */ + if (!(con->name = my_strdup("closed_connection", MYF(MY_WME)))) + die("Out of memory"); DBUG_RETURN(0); } } @@ -1923,18 +1930,22 @@ int close_connection(struct st_query *q) ) are delimiters/terminators */ -char* safe_get_param(char *str, char** arg, const char *msg) +char* safe_get_param(char *str, char** arg, const char *msg, bool required) { DBUG_ENTER("safe_get_param"); + if(!*str) + { + if (required) + die(msg); + *arg= str; + DBUG_RETURN(str); + } while (*str && my_isspace(charset_info,*str)) str++; *arg= str; - for (; *str && *str != ',' && *str != ')' ; str++) - { - if (my_isspace(charset_info,*str)) - *str= 0; - } - if (!*str) + while (*str && *str != ',' && *str != ')') + str++; + if (required && !*arg) die(msg); *str++= 0; @@ -2119,13 +2130,39 @@ err: } +/* + Open a new connection to MySQL Server with the parameters + specified + + SYNOPSIS + do_connect() + q called command + + DESCRIPTION + connect(,,,,,[,[]]); + + - name of the new connection + - hostname of server + - user to connect as + - password used when connecting + - initial db when connected + - server port + - server socket + - options to use for the connection + SSL - use SSL if available + COMPRESS - use compression if available + + */ + int do_connect(struct st_query *q) { char *con_name, *con_user,*con_pass, *con_host, *con_port_str, - *con_db, *con_sock; - char *p= q->first_argument; + *con_db, *con_sock, *con_options; + char *con_buf, *p; char buff[FN_REFLEN]; int con_port; + bool con_ssl= 0; + bool con_compress= 0; int free_con_sock= 0; int error= 0; int create_conn= 1; @@ -2133,57 +2170,97 @@ int do_connect(struct st_query *q) DBUG_ENTER("do_connect"); DBUG_PRINT("enter",("connect: %s",p)); + /* Make a copy of query before parsing, safe_get_param will modify */ + if (!(con_buf= my_strdup(q->first_argument, MYF(MY_WME)))) + die("Could not allocate con_buf"); + p= con_buf; + if (*p != '(') die("Syntax error in connect - expected '(' found '%c'", *p); p++; - p= safe_get_param(p, &con_name, "missing connection name"); - p= safe_get_param(p, &con_host, "missing connection host"); - p= safe_get_param(p, &con_user, "missing connection user"); - p= safe_get_param(p, &con_pass, "missing connection password"); - p= safe_get_param(p, &con_db, "missing connection db"); - if (!*p || *p == ';') /* Default port and sock */ + p= safe_get_param(p, &con_name, "Missing connection name", 1); + p= safe_get_param(p, &con_host, "Missing connection host", 1); + p= safe_get_param(p, &con_user, "Missing connection user", 1); + p= safe_get_param(p, &con_pass, "Missing connection password", 1); + p= safe_get_param(p, &con_db, "Missing connection db", 1); + + /* Port */ + VAR* var_port; + p= safe_get_param(p, &con_port_str, "Missing connection port", 0); + if (*con_port_str) { - con_port= port; - con_sock= (char*) unix_sock; - } - else - { - VAR* var_port, *var_sock; - p= safe_get_param(p, &con_port_str, "missing connection port"); if (*con_port_str == '$') { if (!(var_port= var_get(con_port_str, 0, 0, 0))) - die("Unknown variable '%s'", con_port_str+1); + die("Unknown variable '%s'", con_port_str+1); con_port= var_port->int_val; } else + { con_port= atoi(con_port_str); - p= safe_get_param(p, &con_sock, "missing connection socket"); + if (con_port == 0) + die("Illegal argument for port: '%s'", con_port_str); + } + } + else + { + con_port= port; + } + + /* Sock */ + VAR *var_sock; + p= safe_get_param(p, &con_sock, "Missing connection socket", 0); + if (*con_sock) + { if (*con_sock == '$') { if (!(var_sock= var_get(con_sock, 0, 0, 0))) - die("Unknown variable '%s'", con_sock+1); + die("Unknown variable '%s'", con_sock+1); if (!(con_sock= (char*)my_malloc(var_sock->str_val_len+1, MYF(0)))) - die("Out of memory"); + die("Out of memory"); free_con_sock= 1; memcpy(con_sock, var_sock->str_val, var_sock->str_val_len); con_sock[var_sock->str_val_len]= 0; } } + else + { + con_sock= (char*) unix_sock; + } + + /* Options */ + p= safe_get_param(p, &con_options, "Missing options", 0); + while (*con_options) + { + char* str= con_options; + while (*str && !my_isspace(charset_info, *str)) + str++; + *str++= 0; + if (!strcmp(con_options, "SSL")) + con_ssl= 1; + else if (!strcmp(con_options, "COMPRESS")) + con_compress= 1; + else + die("Illegal option to connect: %s", con_options); + con_options= str; + } q->last_argument= p; if (next_con == cons_end) die("Connection limit exhausted - increase MAX_CONS in mysqltest.c"); + if (find_connection_by_name(con_name)) + die("Connection %s already exists", con_name); + if (!mysql_init(&next_con->mysql)) die("Failed on mysql_init()"); - if (opt_compress) + if (opt_compress || con_compress) mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name); #ifdef HAVE_OPENSSL - if (opt_use_ssl) + if (opt_use_ssl || con_ssl) mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #endif @@ -2214,6 +2291,7 @@ int do_connect(struct st_query *q) } if (free_con_sock) my_free(con_sock, MYF(MY_WME)); + my_free(con_buf, MYF(MY_WME)); DBUG_RETURN(error); } @@ -4053,12 +4131,6 @@ int main(int argc, char **argv) case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break; case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break; -#ifdef HAVE_OPENSSL - case Q_ENABLE_SSL: opt_use_ssl=1; break; - case Q_DISABLE_SSL: opt_use_ssl=0; break; -#endif - case Q_ENABLE_COMPRESS: opt_compress=1; break; - case Q_DISABLE_COMPRESS: opt_compress=0; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 833b7515c59..35b5f9c512a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -191,7 +191,6 @@ our $opt_compress; our $opt_ssl; our $opt_skip_ssl; our $opt_ssl_supported; -our $opt_with_openssl; # Deprecated flag our $opt_ps_protocol; our $opt_current_test; @@ -480,8 +479,7 @@ sub command_line_setup () { # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, - 'with-openssl' => \$opt_with_openssl, - 'ssl' => \$opt_ssl, + 'ssl|with-openssl' => \$opt_ssl, 'skip-ssl' => \$opt_skip_ssl, 'compress' => \$opt_compress, 'bench' => \$opt_bench, @@ -1101,13 +1099,6 @@ sub kill_and_cleanup () { sub check_ssl_support () { - - # Convert deprecated --with-openssl to --ssl - if ( $opt_with_openssl ) - { - $opt_ssl= 1; - } - if ($opt_skip_ssl) { mtr_report("Skipping SSL"); @@ -2597,7 +2588,7 @@ Options to control what test suites or cases to run force Continue to run the suite after failure with-ndbcluster Use cluster, and enable test cases that requres it - skip-ndb[cluster] Use cluster, and enable test cases that requres it + skip-ndb[cluster] Skip the ndb test cases, don't start cluster do-test=PREFIX Run test cases which name are prefixed with PREFIX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 2508d751b46..0e038cb3f09 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -20,6 +20,10 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,root,z,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) +connect(localhost,root,z,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; show tables; @@ -43,6 +47,14 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,test,,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,,"",9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,zorro,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) +connect(localhost,test,zorro,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; set password=""; @@ -70,6 +82,14 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,test,,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,zorro,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) +connect(localhost,test,zorro,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) delete from mysql.user where user=_binary"test"; flush privileges; create table t1 (id integer not null auto_increment primary key); diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index c643a5ae647..a21ec8de7fb 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -344,6 +344,18 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: Invalid integer argument "a" +mysqltest: At line 1: Syntax error in connect - expected '(' found 'mysqltest: At line 1: Missing connection host +mysqltest: At line 1: Missing connection host +mysqltest: At line 1: Missing connection user +mysqltest: At line 1: Missing connection user +mysqltest: At line 1: Missing connection password +mysqltest: At line 1: Missing connection db +mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db' +mysqltest: At line 1: Illegal argument for port: 'illegal_port' +mysqltest: At line 1: Illegal option to connect: SMTP +mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c +mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool +mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists failing_statement; ERROR 42000: 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 'failing_statement' at line 1 failing_statement; diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test index 45b9ab9dd1e..fb1c8793f33 100644 --- a/mysql-test/t/compress.test +++ b/mysql-test/t/compress.test @@ -3,12 +3,11 @@ -- source include/have_compress.inc -enable_compress; # Reconnect to turn compress on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,COMPRESS); # Check compression turned on SHOW STATUS LIKE 'Compression'; @@ -16,4 +15,3 @@ SHOW STATUS LIKE 'Compression'; # Source select test case -- source t/select.test -disable_compress; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 60ac7b88bbe..0bcd1d76d28 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -1,7 +1,6 @@ # This test is to check various cases of connections -# with right and wrong password, with and without database -# Unfortunately the check is incomplete as we can't handle errors on connect -# Also we can't connect without database +# with right and wrong password, with and without database +# Unfortunately the check is incomplete as we can't connect without database # This test makes no sense with the embedded server --source include/not_embedded.inc @@ -10,69 +9,72 @@ drop table if exists t1,t2; --enable_warnings + #connect (con1,localhost,root,,""); #show tables; connect (con1,localhost,root,,mysql); show tables; -connect (con1,localhost,root,,test); +connect (con2,localhost,root,,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,root,z,test2); -#--error 1045 -#connect (con1,localhost,root,z,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,root,z,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,root,z,); grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; # Now check this user with different databases - #connect (con1,localhost,test,gambling,""); #show tables; -connect (con1,localhost,test,gambling,mysql); +connect (con3,localhost,test,gambling,mysql); show tables; -connect (con1,localhost,test,gambling,test); +connect (con4,localhost,test,gambling,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,test,,test2); -#--error 1045 -#connect (con1,localhost,test,,""); -#--error 1045 -#connect (con1,localhost,test,zorro,test2); -#--error 1045 -#connect (con1,localhost,test,zorro,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,""); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,); # check if old password version also works update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; -#connect (con1,localhost,test,gambling2,""); -#show tables; -connect (con1,localhost,test,gambling2,mysql); +connect (con10,localhost,test,gambling2,); +connect (con5,localhost,test,gambling2,mysql); set password=""; --error 1372 set password='gambling3'; set password=old_password('gambling3'); show tables; -connect (con1,localhost,test,gambling3,test); +connect (con6,localhost,test,gambling3,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,test,,test2); -#--error 1045 -#connect (con1,localhost,test,,); -#--error 1045 -#connect (con1,localhost,test,zorro,test2); -#--error 1045 -#connect (con1,localhost,test,zorro,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,); # remove user 'test' so that other tests which may use 'test' @@ -84,13 +86,13 @@ flush privileges; # # Bug#12517: Clear user variables and replication events before # closing temp tables in thread cleanup. -connect (con2,localhost,root,,test); -connection con2; +connect (con7,localhost,root,,test); +connection con7; create table t1 (id integer not null auto_increment primary key); create temporary table t2(id integer not null auto_increment primary key); set @id := 1; delete from t1 where id like @id; -disconnect con2; +disconnect con7; --sleep 5 connection default; drop table t1; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 51cca0a3db1..37c319a24b5 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -498,8 +498,8 @@ drop table t1; # grant select on test.* to mysqltest_4@localhost; -connect (user4,localhost,mysqltest_4,,); -connection user4; +connect (user10261,localhost,mysqltest_4,,); +connection user10261; SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='TABLE_NAME'; connection default; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index eeac2971788..74f5afd8b8b 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -650,6 +650,7 @@ insert into t1 values (10),(11),(12); select * from t1; check table t1; drop table t1; +disconnect con1; # Same test with dynamic record length create table t1 (a int, b varchar(30) default "hello"); @@ -674,8 +675,10 @@ insert into t1 (a) values (10),(11),(12); select a from t1; check table t1; drop table t1; +disconnect con1; set global concurrent_insert=@save_concurrent_insert; + # BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce # different statistics on the same table with NULL values. create table t1 (a int, key(a)); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c903749839d..1af8560c48b 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -358,11 +358,11 @@ select 3 from t1 ; # Missing delimiter # The comment will be "sucked into" the sleep command since # delimiter is missing until after "show status" ---system echo "sleep 4" > var/log/mysqltest.sql ---system echo "# A comment" >> var/log/mysqltest.sql ---system echo "show status;" >> var/log/mysqltest.sql +--system echo "sleep 4" > var/tmp/mysqltest.sql +--system echo "# A comment" >> var/tmp/mysqltest.sql +--system echo "show status;" >> var/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 # # Extra delimiter @@ -808,6 +808,66 @@ select "a" as col1, "c" as col2; --error 1 --exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1 +# ---------------------------------------------------------------------------- +# Test connect +# ---------------------------------------------------------------------------- + +--error 1 +--exec echo "connect;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect ();" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,localhost);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2, localhost, root);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2, localhost, root,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,localhost,root,,illegal_db);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con1,localhost,root,,,illegal_port,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1 + +# Repeat connect/disconnect +--exec echo "let \$i=100;" > var/tmp/con.sql +--exec echo "while (\$i)" >> var/tmp/con.sql +--exec echo "{" >> var/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql +--exec echo " disconnect test_con1; " >> var/tmp/con.sql +--exec echo " dec \$i; " >> var/tmp/con.sql +--exec echo "}" >> var/tmp/con.sql +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Repeat connect/disconnect, exceed max number of connections +--exec echo "let \$i=200;" > var/tmp/con.sql +--exec echo "while (\$i)" >> var/tmp/con.sql +--exec echo "{" >> var/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql +--exec echo " disconnect test_con1; " >> var/tmp/con.sql +--exec echo " dec \$i; " >> var/tmp/con.sql +--exec echo "}" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Select disconnected connection +--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql +--exec echo "disconnect test_con1; " >> var/tmp/con.sql +--exec echo "connection test_con1;" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Connection name already used +--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql +--exec echo "connect (test_con1,localhost,root,,);" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + + # ---------------------------------------------------------------------------- # Test mysqltest arguments diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index e9487425dd7..359b8b69a4d 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -13,11 +13,11 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; -enable_ssl; -connect (con1,localhost,ssl_user1,,); -connect (con2,localhost,ssl_user2,,); -connect (con3,localhost,ssl_user3,,); -connect (con4,localhost,ssl_user4,,); + +connect (con1,localhost,ssl_user1,,,,,SSL); +connect (con2,localhost,ssl_user2,,,,,SSL); +connect (con3,localhost,ssl_user3,,,,,SSL); +connect (con4,localhost,ssl_user4,,,,,SSL); connection con1; # Check ssl turned on diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 6f1332f80d5..197eede2f52 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -336,6 +336,7 @@ connection user1; do 1; use test; +disconnect user1; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost; drop function bug_9503; diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index d13bec60c2b..921b3262013 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -3,12 +3,10 @@ -- source include/have_openssl.inc -enable_ssl; - # Reconnect to turn ssl on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,SSL); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -16,6 +14,5 @@ SHOW STATUS LIKE 'Ssl_cipher'; # Source select test case -- source t/select.test -disable_ssl; diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test index 4a0d3a254ff..2d40b85c33d 100644 --- a/mysql-test/t/ssl_compress.test +++ b/mysql-test/t/ssl_compress.test @@ -4,13 +4,11 @@ -- source include/have_openssl.inc -- source include/have_compress.inc -enable_compress; -enable_ssl; # Reconnect to turn ssl and compress on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,SSL COMPRESS); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -21,5 +19,3 @@ SHOW STATUS LIKE 'Compression'; # Source select test case -- source t/select.test -disable_compress; -disable_ssl; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f9d7ee4e739..6882e24b7a1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5858,9 +5858,7 @@ struct show_var_st status_vars[]= { {"Com_xa_recover", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_RECOVER]),SHOW_LONG_STATUS}, {"Com_xa_rollback", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_ROLLBACK]),SHOW_LONG_STATUS}, {"Com_xa_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_START]),SHOW_LONG_STATUS}, -#ifdef HAVE_COMPRESS {"Compression", (char*) 0, SHOW_NET_COMPRESSION}, -#endif /* HAVE_COMPRESS */ {"Connections", (char*) &thread_id, SHOW_LONG_CONST}, {"Created_tmp_disk_tables", (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS}, {"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG}, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4b3242cbe12..e7acf00dc4e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1632,11 +1632,9 @@ static bool show_status_array(THD *thd, const char *wild, value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache; end= longlong10_to_str(*(longlong*) value, buff, 10); break; -#ifdef HAVE_COMPRESS case SHOW_NET_COMPRESSION: end= strmov(buff, thd->net.compress ? "ON" : "OFF"); break; -#endif /* HAVE_COMPRESS */ case SHOW_UNDEF: // Show never happen case SHOW_SYS: break; // Return empty string diff --git a/sql/structs.h b/sql/structs.h index 52d80b3d0c0..4d08f2c0ef8 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -185,9 +185,7 @@ enum SHOW_TYPE SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL, SHOW_SSL_GET_CIPHER_LIST, #endif /* HAVE_OPENSSL */ -#ifdef HAVE_COMPRESS SHOW_NET_COMPRESSION, -#endif /* HAVE_COMPRESS */ SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS From fd0cd556525fed103e845ad20132f2f774aa55ff Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 12 Oct 2005 14:17:39 +0200 Subject: [PATCH 072/322] Bug #13009 No gaps allowed in node id number sequence + some small bugfixes in ndb_config + extending ndb_config to print connections and take shm option --- mysql-test/r/ndb_config.result | 5 + mysql-test/std_data/ndb_config_mycnf2.cnf | 31 ++ mysql-test/t/ndb_config.test | 5 + ndb/include/mgmapi/mgmapi_config_parameters.h | 1 + ndb/src/common/mgmcommon/IPCConfig.cpp | 24 +- ndb/src/mgmsrv/ConfigInfo.cpp | 345 ++++++------------ ndb/src/mgmsrv/InitConfigFileParser.cpp | 11 +- ndb/tools/ndb_config.cpp | 103 +++++- 8 files changed, 246 insertions(+), 279 deletions(-) create mode 100644 mysql-test/std_data/ndb_config_mycnf2.cnf diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index 629d37f1e5e..9ca7ab5bf3a 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -5,3 +5,8 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql 1 2 ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,, +ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, +Cluster configuration warning line 0: Could not use next node id 2 for section [API], using next unused node id 7. +ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10, +ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15, +shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2 diff --git a/mysql-test/std_data/ndb_config_mycnf2.cnf b/mysql-test/std_data/ndb_config_mycnf2.cnf new file mode 100644 index 00000000000..3bf6b9a1194 --- /dev/null +++ b/mysql-test/std_data/ndb_config_mycnf2.cnf @@ -0,0 +1,31 @@ +# +# Testing automatic node id generation +# +[cluster_config] +NoOfReplicas=2 +Signum=39 + +[cluster_config.cluster0] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost +mysqld = ,,,, + +[cluster_config.cluster1] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost +mysqld = ,,,, +[cluster_config.ndbd.1.cluster1] +NodeId=2 +[cluster_config.mysqld.1.cluster1] +NodeId=1 + +[cluster_config.cluster2] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost,localhost +mysqld = ,,,, +[cluster_config.mysqld.1.cluster2] +NodeId=11 +[cluster_config.ndb_mgmd.1.cluster2] +NodeId=1 +[cluster_config.ndbd.1.cluster2] +NodeId=3 diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index 9d1c107472f..e40e89d76bd 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -11,3 +11,8 @@ # End of 4.1 tests --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null + +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 8f95e159b38..41516b1c3e4 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -116,6 +116,7 @@ #define CFG_CONNECTION_HOSTNAME_1 407 #define CFG_CONNECTION_HOSTNAME_2 408 #define CFG_CONNECTION_GROUP 409 +#define CFG_CONNECTION_NODE_ID_SERVER 410 #define CFG_TCP_SERVER 452 #define CFG_TCP_SEND_BUFFER_SIZE 454 diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index f935f8ffab4..bc442ffc3ef 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -231,8 +231,11 @@ IPCConfig::configureTransporters(Uint32 nodeId, Uint32 server_port= 0; if(iter.get(CFG_CONNECTION_SERVER_PORT, &server_port)) break; + Uint32 nodeIdServer= 0; + if(iter.get(CFG_CONNECTION_NODE_ID_SERVER, &nodeIdServer)) break; + /* - We check the node type. MGM node becomes server. + We check the node type. */ Uint32 node1type, node2type; ndb_mgm_configuration_iterator node1iter(config, CFG_SECTION_NODE); @@ -242,20 +245,12 @@ IPCConfig::configureTransporters(Uint32 nodeId, node1iter.get(CFG_TYPE_OF_SECTION,&node1type); node2iter.get(CFG_TYPE_OF_SECTION,&node2type); - conf.serverNodeId= (nodeId1 < nodeId2)? nodeId1:nodeId2; + if(node1type==NODE_TYPE_MGM || node2type==NODE_TYPE_MGM) + conf.isMgmConnection= true; + else + conf.isMgmConnection= false; - conf.isMgmConnection= false; - if(node2type==NODE_TYPE_MGM) - { - conf.isMgmConnection= true; - conf.serverNodeId= nodeId2; - } - else if(node1type==NODE_TYPE_MGM) - { - conf.isMgmConnection= true; - conf.serverNodeId= nodeId1; - } - else if (nodeId == conf.serverNodeId) { + if (nodeId == nodeIdServer && !conf.isMgmConnection) { tr.add_transporter_interface(remoteNodeId, localHostName, server_port); } @@ -279,6 +274,7 @@ IPCConfig::configureTransporters(Uint32 nodeId, conf.s_port = server_port; conf.localHostName = localHostName; conf.remoteHostName = remoteHostName; + conf.serverNodeId = nodeIdServer; switch(type){ case CONNECTION_TYPE_SHM: diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 98e5744fe32..47f513e2d1d 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -57,7 +57,6 @@ ConfigInfo::m_sectionNameAliases[]={ const char* ConfigInfo::m_sectionNames[]={ "SYSTEM", - "EXTERNAL SYSTEM", "COMPUTER", DB_TOKEN, @@ -78,9 +77,7 @@ sizeof(m_sectionNames)/sizeof(char*); ****************************************************************************/ static bool transformComputer(InitConfigFileParser::Context & ctx, const char *); static bool transformSystem(InitConfigFileParser::Context & ctx, const char *); -static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformNode(InitConfigFileParser::Context & ctx, const char *); -static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *); static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *); static bool transformConnection(InitConfigFileParser::Context & ctx, const char *); static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); @@ -93,7 +90,6 @@ static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *); static bool fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data); static bool fixHostname(InitConfigFileParser::Context & ctx, const char * data); static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data); -static bool fixExtConnection(InitConfigFileParser::Context & ctx, const char * data); static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data); @@ -104,7 +100,6 @@ static bool checkLocalhostHostnameMix(InitConfigFileParser::Context & ctx, const const ConfigInfo::SectionRule ConfigInfo::m_SectionRules[] = { { "SYSTEM", transformSystem, 0 }, - { "EXTERNAL SYSTEM", transformExternalSystem, 0 }, { "COMPUTER", transformComputer, 0 }, { DB_TOKEN, transformNode, 0 }, @@ -151,14 +146,6 @@ ConfigInfo::m_SectionRules[] = { { "SHM", fixPortNumber, 0 }, // has to come after fixHostName { "SCI", fixPortNumber, 0 }, // has to come after fixHostName - /** - * fixExtConnection must be after fixNodeId - */ - { "TCP", fixExtConnection, 0 }, - { "SHM", fixExtConnection, 0 }, - { "SCI", fixExtConnection, 0 }, - { "OSE", fixExtConnection, 0 }, - { "*", applyDefaultValues, "user" }, { "*", fixDepricated, 0 }, { "*", applyDefaultValues, "system" }, @@ -174,9 +161,6 @@ ConfigInfo::m_SectionRules[] = { { DB_TOKEN, checkDbConstraints, 0 }, - /** - * checkConnectionConstraints must be after fixExtConnection - */ { "TCP", checkConnectionConstraints, 0 }, { "SHM", checkConnectionConstraints, 0 }, { "SCI", checkConnectionConstraints, 0 }, @@ -214,9 +198,6 @@ static bool add_node_connections(Vector§ions, static bool set_connection_priorities(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); -static bool add_server_ports(Vector§ions, - struct InitConfigFileParser::Context &ctx, - const char * rule_data); static bool check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); @@ -226,7 +207,6 @@ ConfigInfo::m_ConfigRules[] = { { sanity_checks, 0 }, { add_node_connections, 0 }, { set_connection_priorities, 0 }, - { add_server_ports, 0 }, { check_node_vs_replicas, 0 }, { 0, 0 } }; @@ -242,9 +222,9 @@ struct DepricationTransform { static const DepricationTransform f_deprication[] = { { DB_TOKEN, "Discless", "Diskless", 0, 1 }, - { DB_TOKEN, "Id", "nodeid", 0, 1 }, - { API_TOKEN, "Id", "nodeid", 0, 1 }, - { MGM_TOKEN, "Id", "nodeid", 0, 1 }, + { DB_TOKEN, "Id", "NodeId", 0, 1 }, + { API_TOKEN, "Id", "NodeId", 0, 1 }, + { MGM_TOKEN, "Id", "NodeId", 0, 1 }, { 0, 0, 0, 0, 0} }; @@ -422,7 +402,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { { CFG_NODE_ID, - "nodeid", + "NodeId", DB_TOKEN, "Number identifying the database node ("DB_TOKEN_PRINT")", ConfigInfo::CI_USED, @@ -1273,7 +1253,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { { CFG_NODE_ID, - "nodeid", + "NodeId", API_TOKEN, "Number identifying application node ("API_TOKEN_PRINT")", ConfigInfo::CI_USED, @@ -1416,7 +1396,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { { CFG_NODE_ID, - "nodeid", + "NodeId", MGM_TOKEN, "Number identifying the management server node ("MGM_TOKEN_PRINT")", ConfigInfo::CI_USED, @@ -1578,6 +1558,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "55", "0", "200" }, + { + CFG_CONNECTION_NODE_ID_SERVER, + "NodeIdServer", + "TCP", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", "63" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1766,6 +1757,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "35", "0", "200" }, + { + CFG_CONNECTION_NODE_ID_SERVER, + "NodeIdServer", + "SHM", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", "63" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1887,6 +1889,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "15", "0", "200" }, + { + CFG_CONNECTION_NODE_ID_SERVER, + "NodeIdServer", + "SCI", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", "63" }, + { CFG_CONNECTION_HOSTNAME_1, "HostName1", @@ -2555,29 +2568,32 @@ void ConfigInfo::print(const Properties * section, bool transformNode(InitConfigFileParser::Context & ctx, const char * data){ - Uint32 id; - if(!ctx.m_currentSection->get("nodeid", &id) && !ctx.m_currentSection->get("Id", &id)){ + Uint32 id, line; + if(!ctx.m_currentSection->get("NodeId", &id) && !ctx.m_currentSection->get("Id", &id)){ Uint32 nextNodeId= 1; ctx.m_userProperties.get("NextNodeId", &nextNodeId); id= nextNodeId; - while (ctx.m_userProperties.get("AllocatedNodeId_", id, &id)) + while (ctx.m_userProperties.get("AllocatedNodeId_", id, &line)) id++; - ctx.m_userProperties.put("NextNodeId", id+1, true); - ctx.m_currentSection->put("nodeid", id); -#if 0 - ctx.reportError("Mandatory parameter Id missing from section " - "[%s] starting at line: %d", - ctx.fname, ctx.m_sectionLineno); - return false; -#endif - } else if(ctx.m_userProperties.get("AllocatedNodeId_", id, &id)) { + if (id != nextNodeId) + { + ndbout_c("Cluster configuration warning line %d: " + "Could not use next node id %d for section [%s], " + "using next unused node id %d.", + ctx.m_sectionLineno, nextNodeId, ctx.fname, id); + } + ctx.m_currentSection->put("NodeId", id); + } else if(ctx.m_userProperties.get("AllocatedNodeId_", id, &line)) { ctx.reportError("Duplicate nodeid in section " - "[%s] starting at line: %d", - ctx.fname, ctx.m_sectionLineno); + "[%s] starting at line: %d. Previously used on line %d.", + ctx.fname, ctx.m_sectionLineno, line); return false; } - ctx.m_userProperties.put("AllocatedNodeId_", id, id); + // next node id _always_ next numbers after last used id + ctx.m_userProperties.put("NextNodeId", id+1, true); + + ctx.m_userProperties.put("AllocatedNodeId_", id, ctx.m_sectionLineno); BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Node_%d", id); ctx.m_currentSection->put("Type", ctx.fname); @@ -2691,38 +2707,6 @@ fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data){ return false; } -bool -transformExtNode(InitConfigFileParser::Context & ctx, const char * data){ - - Uint32 id; - const char * systemName; - - if(!ctx.m_currentSection->get("Id", &id)){ - ctx.reportError("Mandatory parameter 'Id' missing from section " - "[%s] starting at line: %d", - ctx.fname, ctx.m_sectionLineno); - return false; - } - - if(!ctx.m_currentSection->get("System", &systemName)){ - ctx.reportError("Mandatory parameter 'System' missing from section " - "[%s] starting at line: %d", - ctx.fname, ctx.m_sectionLineno); - return false; - } - - ctx.m_currentSection->put("Type", ctx.fname); - - Uint32 nodes = 0; - ctx.m_userProperties.get("ExtNoOfNodes", &nodes); - require(ctx.m_userProperties.put("ExtNoOfNodes",++nodes, true)); - - BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "EXTERNAL SYSTEM_%s:Node_%d", - systemName, id); - - return true; -} - /** * Connection rule: Check support of connection */ @@ -2798,23 +2782,6 @@ transformSystem(InitConfigFileParser::Context & ctx, const char * data){ return true; } -/** - * External system rule: Just add it - */ -bool -transformExternalSystem(InitConfigFileParser::Context & ctx, const char * data){ - const char * name; - if(!ctx.m_currentSection->get("Name", &name)){ - ctx.reportError("Mandatory parameter Name missing from section " - "[%s] starting at line: %d", - ctx.fname, ctx.m_sectionLineno); - return false; - } - BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "EXTERNAL SYSTEM_%s", name); - - return true; -} - /** * Computer rule: Update "NoOfComputers", add "Type" */ @@ -2990,87 +2957,6 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data) return true; } -/** - * @returns true if connection is external (one node is external) - * Also returns: - * - name of external system in parameter extSystemName, and - * - nodeId of external node in parameter extSystemNodeId. - */ -static bool -isExtConnection(InitConfigFileParser::Context & ctx, - const char **extSystemName, Uint32 * extSystemNodeId){ - - Uint32 nodeId1, nodeId2; - - if (ctx.m_currentSection->contains("System1") && - ctx.m_currentSection->get("System1", extSystemName) && - ctx.m_currentSection->get("NodeId1", &nodeId1)) { - *extSystemNodeId = nodeId1; - return true; - } - - if (ctx.m_currentSection->contains("System2") && - ctx.m_currentSection->get("System2", extSystemName) && - ctx.m_currentSection->get("NodeId2", &nodeId2)) { - *extSystemNodeId = nodeId2; - return true; - } - - return false; -} - -/** - * External Connection Rule: - * If connection is to an external system, then move connection into - * external system configuration (i.e. a sub-property). - */ -static bool -fixExtConnection(InitConfigFileParser::Context & ctx, const char * data){ - - const char * extSystemName; - Uint32 extSystemNodeId; - - if (isExtConnection(ctx, &extSystemName, &extSystemNodeId)) { - - Uint32 connections = 0; - ctx.m_userProperties.get("ExtNoOfConnections", &connections); - require(ctx.m_userProperties.put("ExtNoOfConnections",++connections, true)); - - char tmpLine1[MAX_LINE_LENGTH]; - BaseString::snprintf(tmpLine1, MAX_LINE_LENGTH, "Connection_%d", connections-1); - - /** - * Section: EXTERNAL SYSTEM_ - */ - char extSystemPropName[MAX_LINE_LENGTH]; - strncpy(extSystemPropName, "EXTERNAL SYSTEM_", MAX_LINE_LENGTH); - strncat(extSystemPropName, extSystemName, MAX_LINE_LENGTH); - strncat(extSystemPropName, ":", MAX_LINE_LENGTH); - strncat(extSystemPropName, tmpLine1, MAX_LINE_LENGTH); - - /** - * Increase number of external connections for the system - * - * @todo Limitation: Only one external system is allowed - */ - require(ctx.m_userProperties.put("ExtSystem", extSystemName, true)); - - /** - * Make sure section is stored in right place - */ - strncpy(ctx.pname, extSystemPropName, MAX_LINE_LENGTH); - - /** - * Since this is an external connection, - * decrease number of internal connections - */ - require(ctx.m_userProperties.get("NoOfConnections", &connections)); - require(ctx.m_userProperties.put("NoOfConnections", --connections, true)); - } - - return true; -} - /** * Connection rule: Fix hostname * @@ -3113,7 +2999,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ DBUG_ENTER("fixPortNumber"); - Uint32 id1= 0, id2= 0; + Uint32 id1, id2; const char *hostName1; const char *hostName2; require(ctx.m_currentSection->get("NodeId1", &id1)); @@ -3123,17 +3009,46 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ DBUG_PRINT("info",("NodeId1=%d HostName1=\"%s\"",id1,hostName1)); DBUG_PRINT("info",("NodeId2=%d HostName2=\"%s\"",id2,hostName2)); - if (id1 > id2) { - Uint32 tmp= id1; - const char *tmp_name= hostName1; - hostName1= hostName2; - id1= id2; - hostName2= tmp_name; - id2= tmp; - } + const Properties *node1, *node2; + require(ctx.m_config->get("Node", id1, &node1)); + require(ctx.m_config->get("Node", id2, &node2)); - const Properties * node; - require(ctx.m_config->get("Node", id1, &node)); + const char *type1, *type2; + require(node1->get("Type", &type1)); + require(node2->get("Type", &type2)); + + /* add NodeIdServer info */ + { + Uint32 nodeIdServer = id1 < id2 ? id1 : id2; + if(strcmp(type1, API_TOKEN) == 0 || strcmp(type2, MGM_TOKEN) == 0) + nodeIdServer = id2; + else if(strcmp(type2, API_TOKEN) == 0 || strcmp(type1, MGM_TOKEN) == 0) + nodeIdServer = id1; + ctx.m_currentSection->put("NodeIdServer", nodeIdServer); + + if (id2 == nodeIdServer) { + { + const char *tmp= hostName1; + hostName1= hostName2; + hostName2= tmp; + } + { + Uint32 tmp= id1; + id1= id2; + id2= tmp; + } + { + const Properties *tmp= node1; + node1= node2; + node2= tmp; + } + { + const char *tmp= type1; + type1= type2; + type2= tmp; + } + } + } BaseString hostname(hostName1); @@ -3144,21 +3059,13 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ } Uint32 port= 0; - const char * type1; - const char * type2; - const Properties * node2; - - node->get("Type", &type1); - ctx.m_config->get("Node", id2, &node2); - node2->get("Type", &type2); - if(strcmp(type1, MGM_TOKEN)==0) - node->get("PortNumber",&port); + node1->get("PortNumber",&port); else if(strcmp(type2, MGM_TOKEN)==0) node2->get("PortNumber",&port); if (!port && - !node->get("ServerPort", &port) && + !node1->get("ServerPort", &port) && !ctx.m_userProperties.get("ServerPort_", id1, &port)) { Uint32 base= 0; @@ -3309,11 +3216,6 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){ ctx.m_currentSection->get("NodeId1", &id1); ctx.m_currentSection->get("NodeId2", &id2); - // If external connection, just accept it - if (ctx.m_currentSection->contains("System1") || - ctx.m_currentSection->contains("System2")) - return true; - if(id1 == id2){ ctx.reportError("Illegal connection from node to itself" " - [%s] starting at line: %d", @@ -3346,12 +3248,10 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){ * Report error if the following are true * -# None of the nodes is of type DB * -# Not both of them are MGMs - * -# None of them contain a "SystemX" name */ if((strcmp(type1, DB_TOKEN) != 0 && strcmp(type2, DB_TOKEN) != 0) && - !(strcmp(type1, MGM_TOKEN) == 0 && strcmp(type2, MGM_TOKEN) == 0) && - !ctx.m_currentSection->contains("System1") && - !ctx.m_currentSection->contains("System2")){ + !(strcmp(type1, MGM_TOKEN) == 0 && strcmp(type2, MGM_TOKEN) == 0)) + { ctx.reportError("Invalid connection between node %d (%s) and node %d (%s)" " - [%s] starting at line: %d", id1, type1, id2, type2, @@ -3441,11 +3341,11 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){ if(strcmp(p->m_section, ctx.fname) == 0){ double mul = p->m_mul; double add = p->m_add; - if(strcmp(name, p->m_oldName) == 0){ + if(strcasecmp(name, p->m_oldName) == 0){ if(!transform(ctx, tmp, name, p->m_newName, add, mul)){ return false; } - } else if(strcmp(name, p->m_newName) == 0) { + } else if(strcasecmp(name, p->m_newName) == 0) { if(!transform(ctx, tmp, name, p->m_oldName, -add/mul,1.0/mul)){ return false; } @@ -3724,45 +3624,6 @@ static bool set_connection_priorities(Vector§ DBUG_RETURN(true); } -static bool add_server_ports(Vector§ions, - struct InitConfigFileParser::Context &ctx, - const char * rule_data) -{ -#if 0 - Properties * props= ctx.m_config; - Properties computers(true); - Uint32 port_base = NDB_TCP_BASE_PORT; - - Uint32 nNodes; - ctx.m_userProperties.get("NoOfNodes", &nNodes); - - for (Uint32 i= 0, n= 0; n < nNodes; i++){ - Properties * tmp; - if(!props->get("Node", i, &tmp)) continue; - n++; - - const char * type; - if(!tmp->get("Type", &type)) continue; - - Uint32 port; - if (tmp->get("ServerPort", &port)) continue; - - Uint32 computer; - if (!tmp->get("ExecuteOnComputer", &computer)) continue; - - Uint32 adder= 0; - computers.get("",computer, &adder); - - if (strcmp(type,DB_TOKEN) == 0) { - adder++; - tmp->put("ServerPort", port_base+adder); - computers.put("",computer, adder); - } - } -#endif - return true; -} - static bool check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index f643349a493..f937daf8620 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -640,7 +640,7 @@ InitConfigFileParser::store_in_properties(Vector& options, value_int = *(Uint64*)options[i].value; break; case GET_STR: - ctx.m_currentSection->put(options[i].name, (char*)options[i].value); + ctx.m_currentSection->put(options[i].name, *(char**)options[i].value); continue; default: abort(); @@ -762,9 +762,6 @@ InitConfigFileParser::parse_mycnf() Vector options; for(i = 0; i&, int &argc, char**& argv); static int parse_where(Vector&, int &argc, char**& argv); static int eval(const Iter&, const Vector&); @@ -172,6 +183,15 @@ main(int argc, char** argv){ ndb_std_get_one_option))) return -1; + if (g_nodes && g_connections) + { + ndbout_c("Only one option of --nodes and --connections allowed"); + } + + g_section = CFG_SECTION_NODE; //default + if (g_connections) + g_section = CFG_SECTION_CONNECTION; + ndb_mgm_configuration * conf = 0; if (g_config_file || g_mycnf) @@ -202,7 +222,7 @@ main(int argc, char** argv){ exit(0); } - Iter iter(* conf, CFG_SECTION_NODE); + Iter iter(* conf, g_section); bool prev= false; iter.first(); for(iter.first(); iter.valid(); iter.next()) @@ -231,13 +251,32 @@ parse_query(Vector& select, int &argc, char**& argv) for(unsigned i = 0; i& select, int &argc, char**& argv) if(0)ndbout_c("%s %s", ConfigInfo::m_ParamInfo[p]._section, ConfigInfo::m_ParamInfo[p]._fname); - if(strcmp(ConfigInfo::m_ParamInfo[p]._section, "DB") == 0 || - strcmp(ConfigInfo::m_ParamInfo[p]._section, "API") == 0 || - strcmp(ConfigInfo::m_ParamInfo[p]._section, "MGM") == 0) + if(g_section == CFG_SECTION_CONNECTION && + (strcmp(ConfigInfo::m_ParamInfo[p]._section, "TCP") == 0 || + strcmp(ConfigInfo::m_ParamInfo[p]._section, "SCI") == 0 || + strcmp(ConfigInfo::m_ParamInfo[p]._section, "SHM") == 0) + || + g_section == CFG_SECTION_NODE && + (strcmp(ConfigInfo::m_ParamInfo[p]._section, "DB") == 0 || + strcmp(ConfigInfo::m_ParamInfo[p]._section, "API") == 0 || + strcmp(ConfigInfo::m_ParamInfo[p]._section, "MGM") == 0)) { if(strcasecmp(ConfigInfo::m_ParamInfo[p]._fname, str) == 0) { @@ -263,11 +308,6 @@ parse_query(Vector& select, int &argc, char**& argv) return 1; } } - else - { - fprintf(stderr, "Unknown query option: %s\n", str); - return 1; - } } } return 0; @@ -425,6 +465,31 @@ NodeTypeApply::apply(const Iter& iter) return 0; } +int +ConnectionTypeApply::apply(const Iter& iter) +{ + Uint32 val32; + if (iter.get(CFG_TYPE_OF_SECTION, &val32) == 0) + { + switch (val32) + { + case CONNECTION_TYPE_TCP: + printf("tcp"); + break; + case CONNECTION_TYPE_SCI: + printf("sci"); + break; + case CONNECTION_TYPE_SHM: + printf("shm"); + break; + default: + printf(""); + break; + } + } + return 0; +} + ndb_mgm_configuration* fetch_configuration() { From 6266243deb54299c0bc19516aeb239e59218d704 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Wed, 12 Oct 2005 16:43:55 +0400 Subject: [PATCH 073/322] Fix compile error on Windows: remove wrong typecast --- sql/ha_innodb.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index cbd23aaab6c..455b54361f0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -7042,8 +7042,7 @@ ha_innobase::cmp_ref( (const char*)ref1, len1, (const char*)ref2, len2); } else { - result = field->key_cmp((const char*)ref1, - (const char*)ref2); + result = field->key_cmp(ref1, ref2); } if (result) { From a191d8cce1736bf39ea2c3babc7145efe7242783 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 12 Oct 2005 15:19:51 +0200 Subject: [PATCH 074/322] postt review fixes --- mysql-test/r/ndb_config.result | 1 - ndb/src/mgmsrv/ConfigInfo.cpp | 4 ++-- ndb/tools/ndb_config.cpp | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index 9ca7ab5bf3a..ef5c924a398 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -6,7 +6,6 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,, ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, -Cluster configuration warning line 0: Could not use next node id 2 for section [API], using next unused node id 7. ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10, ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15, shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2 diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 47f513e2d1d..817943f5e51 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2577,9 +2577,9 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){ id++; if (id != nextNodeId) { - ndbout_c("Cluster configuration warning line %d: " + fprintf(stderr,"Cluster configuration warning line %d: " "Could not use next node id %d for section [%s], " - "using next unused node id %d.", + "using next unused node id %d.\n", ctx.m_sectionLineno, nextNodeId, ctx.fname, id); } ctx.m_currentSection->put("NodeId", id); diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index b4eacd34f8e..27ab6a182bb 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -185,7 +185,9 @@ main(int argc, char** argv){ if (g_nodes && g_connections) { - ndbout_c("Only one option of --nodes and --connections allowed"); + fprintf(stderr, + "Only one option of --nodes and --connections allowed\n"); + return -1; } g_section = CFG_SECTION_NODE; //default From 58c64aea924555e1c9f01fcf370ef1dd3f8cdca3 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Wed, 12 Oct 2005 18:50:25 +0500 Subject: [PATCH 075/322] memcpy_overlap() removed, as 1. it's wrong to use memcpy() for overlapped areas; 2. we use it only once. During merge to 4.1 will remove a memcpy_overlap() call from strings/ctype-tis620.c as well in order to fix bug #10836: ctype_tis620 test failure with ICC-compiled binaries on IA64. --- include/m_string.h | 10 ---------- myisam/mi_search.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 419e70d93bf..f081c966fac 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -119,16 +119,6 @@ extern void bmove_allign(gptr dst,const gptr src,uint len); #define bmove512(A,B,C) memcpy(A,B,C) #endif -#ifdef HAVE_purify -#include -#define memcpy_overlap(A,B,C) \ -DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \ -bmove((byte*) key,(byte*) from,(size_t) length); -#else -#define memcpy_overlap(A,B,C) memcpy((A), (B), (C)) -#endif /* HAVE_purify */ - - /* Prototypes for string functions */ #if !defined(bfill) && !defined(HAVE_BFILL) diff --git a/myisam/mi_search.c b/myisam/mi_search.c index c0be1a427df..3d16a70d70b 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -1306,7 +1306,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, } DBUG_PRINT("info",("key: %p from: %p length: %u", key, from, length)); - memcpy_overlap((byte*) key, (byte*) from, (size_t) length); + memmove((byte*) key, (byte*) from, (size_t) length); key+=length; from+=length; } From 0378009b5bcf1f7b8462a3870119f22decaa3b9f Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Wed, 12 Oct 2005 19:31:24 +0200 Subject: [PATCH 076/322] Fix of incompatible types len and packet_error needs to be of same type for (len == packet_error) to check failures --- client/mysqlbinlog.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 5345d6d0f54..ffb653eabdb 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1003,7 +1003,8 @@ static int dump_remote_log_entries(const char* logname) { char buf[128]; LAST_EVENT_INFO last_event_info; - uint len, logname_len; + ulong len; + uint logname_len; NET* net; int error= 0; my_off_t old_off= start_position_mot; From 3ee738270361d2536159f9aab2594a17994b594a Mon Sep 17 00:00:00 2001 From: "dlenev@mysql.com" <> Date: Wed, 12 Oct 2005 23:42:51 +0400 Subject: [PATCH 077/322] Temporary solution for bug #13969 "Routines which are replicated from master can't be executed on slave". It will be possible to solve this problem in more correct way when we will implement WL#2897 "Complete definer support in the stored routines". --- mysql-test/r/rpl_sp.result | 8 ++++++++ mysql-test/t/rpl_sp.test | 17 +++++++++++++++++ sql/sp_head.cc | 15 +++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index b1f564a0791..5f1c3afd14d 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -264,6 +264,14 @@ master-bin.000002 # Query 1 # use `mysqltest1`; insert into t1 values (1) select * from t1; a 1 +create procedure foo() +not deterministic +reads sql data +select * from t1; +call foo(); +a +1 +drop procedure foo; drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index fa44b68bd8c..e62a6c73c0a 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -258,6 +258,23 @@ sync_slave_with_master; select * from t1; +# +# Test for bug #13969 "Routines which are replicated from master can't be +# executed on slave". +# +connection master; +create procedure foo() + not deterministic + reads sql data + select * from t1; +sync_slave_with_master; +# This should not fail +call foo(); +connection master; +drop procedure foo; +sync_slave_with_master; + + # Clean up connection master; drop function fn1; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 671acbc2a0c..75c5694cb51 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2650,9 +2650,24 @@ sp_change_security_context(THD *thd, sp_head *sp, Security_context **backup) sp->m_definer_host.str, sp->m_db.str)) { +#ifdef NOT_YET_REPLICATION_SAFE + /* + Until we don't properly replicate information about stored routine + definer with stored routine creation statement all stored routines + on slave are created under ''@'' definer. Therefore we won't be able + to run any routine which was replicated from master on slave server + if we emit error here. This will cause big problems for users + who use slave for fail-over. So until we fully implement WL#2897 + "Complete definer support in the stored routines" we run suid + stored routines for which we were unable to find definer under + invoker security context. + */ my_error(ER_NO_SUCH_USER, MYF(0), sp->m_definer_user.str, sp->m_definer_host.str); return TRUE; +#else + return FALSE; +#endif } *backup= thd->security_ctx; thd->security_ctx= &sp->m_security_ctx; From 11848b53d3072118f0d6dc792bee44e228185d18 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 12 Oct 2005 22:29:36 +0200 Subject: [PATCH 078/322] To force a restart at the end of test, the option file must be non-empty, it's not enough if it exists and is empty. --- mysql-test/t/rpl_dual_pos_advance-master.opt | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/t/rpl_dual_pos_advance-master.opt index e69de29bb2d..35fcc5f30c6 100644 --- a/mysql-test/t/rpl_dual_pos_advance-master.opt +++ b/mysql-test/t/rpl_dual_pos_advance-master.opt @@ -0,0 +1 @@ +--loose-to-force-a-restart From 94ea4f188a91d64c7741021e84a10d4f0a6d7121 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 12 Oct 2005 22:49:33 +0200 Subject: [PATCH 079/322] make_binary_distribution.sh: Copy *.cnf files in mysql-test/std_data/ Makefile.am: Added std_data/*.cnf to copy ndb config --- mysql-test/Makefile.am | 2 ++ scripts/make_binary_distribution.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 9b0db5774f5..1fb5f82c475 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -61,6 +61,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib @@ -89,6 +90,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1354117db13..a3e993a25cf 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -232,6 +232,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t From 551961b2079802afcbc703d340a58e71902a3bcf Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Thu, 13 Oct 2005 00:58:59 +0400 Subject: [PATCH 080/322] select.test, sql_select.cc, sql_lex.cc, item.cc: Bug #7672 after merge fix --- mysql-test/t/select.test | 3 ++- sql/item.cc | 11 ++++++++--- sql/sql_lex.cc | 3 ++- sql/sql_select.cc | 5 +++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index a3a0faac1aa..879a84d092d 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2165,7 +2165,7 @@ select found_rows(); DROP TABLE t1; -# End of 4.1 tests +# # Bug 7672 Unknown column error in order clause # CREATE TABLE t1 (a INT, b INT); @@ -2174,3 +2174,4 @@ CREATE TABLE t1 (a INT, b INT); SELECT a, b AS c FROM t1 ORDER BY c+1; SELECT a, b AS c FROM t1 ORDER BY b+1; drop table t1; +# End of 4.1 tests diff --git a/sql/item.cc b/sql/item.cc index 3c3a6d273fe..8df839baa5c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1760,10 +1760,15 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if ((tmp= find_field_in_tables(thd, this, tables, &where, 0)) == not_found_field) { - if (thd->lex.select_lex.is_item_list_lookup) + /* Look up in current select's item_list to find aliased fields */ + if (thd->lex->current_select->is_item_list_lookup) { - Item** res= find_item_in_list(this, thd->lex.select_lex.item_list); - if (res && *res && (*res)->type() == Item::FIELD_ITEM) + uint counter; + bool not_used; + Item** res= find_item_in_list(this, thd->lex->current_select->item_list, + &counter, REPORT_EXCEPT_NOT_FOUND, + ¬_used); + if (res != not_found_item && (*res)->type() == Item::FIELD_ITEM) { set_field((*((Item_field**)res))->field); return 0; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 47de2ff36c7..16641ad6dd5 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -160,7 +160,6 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->duplicates= DUP_ERROR; lex->ignore= 0; lex->proc_list.first= 0; - lex->select_lex.is_item_list_lookup= 0; } void lex_end(LEX *lex) @@ -1084,6 +1083,7 @@ void st_select_lex::init_query() prep_where= 0; subquery_in_having= explicit_limit= 0; parsing_place= NO_MATTER; + is_item_list_lookup= 0; } void st_select_lex::init_select() @@ -1110,6 +1110,7 @@ void st_select_lex::init_select() select_limit= HA_POS_ERROR; offset_limit= 0; with_sum_func= 0; + } /* diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0d9cab6a36b..f72d897e22d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8348,11 +8348,16 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, 'it' reassigned in if condition because fix_field can change it. */ + thd->lex->current_select->is_item_list_lookup= 1; if (!it->fixed && (it->fix_fields(thd, tables, order->item) || (it= *order->item)->check_cols(1) || thd->is_fatal_error)) + { + thd->lex->current_select->is_item_list_lookup= 0; return 1; // Wrong field + } + thd->lex->current_select->is_item_list_lookup= 0; uint el= all_fields.elements; all_fields.push_front(it); // Add new field to field list ref_pointer_array[el]= it; From 06043b519a489935ab948b5264ae036e5f0de989 Mon Sep 17 00:00:00 2001 From: "eric@mysql.com" <> Date: Wed, 12 Oct 2005 14:33:08 -0700 Subject: [PATCH 081/322] replace port number with string identifier so that it may have different ports and still run (problem found by kent) --- mysql-test/r/federated.result | 2 +- mysql-test/t/federated.test | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index f40919a41a4..29f8461fd4c 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -79,7 +79,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `id` int(20) NOT NULL, `name` varchar(32) NOT NULL default '' -) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1' +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); SELECT * FROM federated.t2; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 453343e6f09..b1b6baa2f33 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -75,7 +75,8 @@ eval CREATE TABLE federated.t2 ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -SHOW CREATE TABLE federated.t2; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval SHOW CREATE TABLE federated.t2; INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); From 48457e08527fd74c9ccb1ddbb05bf9df4e395909 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Wed, 12 Oct 2005 23:37:21 +0200 Subject: [PATCH 082/322] mysqlbin --hexdump patch 3 --- client/mysqlbinlog.cc | 26 ++++--- sql/log_event.cc | 171 +++++++++++++++++++----------------------- sql/log_event.h | 88 ++++++++++------------ 3 files changed, 132 insertions(+), 153 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 7ae563c7209..2b96914bfc9 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -496,6 +496,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, char ll_buff[21]; Log_event_type ev_type= ev->get_type_code(); DBUG_ENTER("process_event"); + last_event_info->short_form= short_form; /* Format events are not concerned by --offset and such, we always need to @@ -524,14 +525,16 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, if (!short_form) fprintf(result_file, "# at %s\n",llstr(pos,ll_buff)); - /* Set pos to 0 if hexdump is disabled */ - if (!opt_hexdump) pos= 0; + if (!opt_hexdump) + last_event_info->hexdump_from= 0; /* Disabled */ + else + last_event_info->hexdump_from= pos; switch (ev_type) { case QUERY_EVENT: if (check_database(((Query_log_event*)ev)->db)) goto end; - ev->print(result_file, short_form, pos, last_event_info); + ev->print(result_file, last_event_info); break; case CREATE_FILE_EVENT: { @@ -551,7 +554,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT' below. */ - ce->print(result_file, short_form, pos, last_event_info, TRUE); + ce->print(result_file, last_event_info, TRUE); // If this binlog is not 3.23 ; why this test?? if (description_event->binlog_version >= 3) @@ -563,13 +566,13 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, break; } case APPEND_BLOCK_EVENT: - ev->print(result_file, short_form, pos, last_event_info); + ev->print(result_file, last_event_info); if (load_processor.process((Append_block_log_event*) ev)) break; // Error break; case EXEC_LOAD_EVENT: { - ev->print(result_file, short_form, pos, last_event_info); + ev->print(result_file, last_event_info); Execute_load_log_event *exv= (Execute_load_log_event*)ev; Create_file_log_event *ce= load_processor.grab_event(exv->file_id); /* @@ -579,7 +582,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev, */ if (ce) { - ce->print(result_file, short_form, pos, last_event_info, TRUE); + ce->print(result_file, last_event_info, TRUE); my_free((char*)ce->fname,MYF(MY_WME)); delete ce; } @@ -591,7 +594,8 @@ Create_file event for file_id: %u\n",exv->file_id); case FORMAT_DESCRIPTION_EVENT: delete description_event; description_event= (Format_description_log_event*) ev; - ev->print(result_file, short_form, pos, last_event_info); + last_event_info->common_header_len= description_event->common_header_len; + ev->print(result_file, last_event_info); /* We don't want this event to be deleted now, so let's hide it (I (Guilhem) should later see if this triggers a non-serious Valgrind @@ -601,7 +605,7 @@ Create_file event for file_id: %u\n",exv->file_id); ev= 0; break; case BEGIN_LOAD_QUERY_EVENT: - ev->print(result_file, short_form, pos, last_event_info); + ev->print(result_file, last_event_info); load_processor.process((Begin_load_query_log_event*) ev); break; case EXECUTE_LOAD_QUERY_EVENT: @@ -618,7 +622,7 @@ Create_file event for file_id: %u\n",exv->file_id); if (fname) { - exlq->print(result_file, short_form, pos, last_event_info, fname); + exlq->print(result_file, last_event_info, fname); my_free(fname, MYF(MY_WME)); } else @@ -627,7 +631,7 @@ Begin_load_query event for file_id: %u\n", exlq->file_id); break; } default: - ev->print(result_file, short_form, pos, last_event_info); + ev->print(result_file, last_event_info); } } diff --git a/sql/log_event.cc b/sql/log_event.cc index c704e81007a..2a6dd04fea8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -701,7 +701,6 @@ failed my_b_read")); */ DBUG_RETURN(0); } - uint data_len = uint4korr(head + EVENT_LEN_OFFSET); char *buf= 0; const char *error= 0; @@ -881,16 +880,18 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, Log_event::print_header() */ -void Log_event::print_header(FILE* file, my_off_t hexdump_from) +void Log_event::print_header(FILE* file, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; + my_off_t hexdump_from= last_event_info->hexdump_from; + fputc('#', file); print_timestamp(file); fprintf(file, " server id %d end_log_pos %s ", server_id, llstr(log_pos,llbuff)); /* mysqlbinlog --hexdump */ - if (hexdump_from) + if (last_event_info->hexdump_from) { fprintf(file, "\n"); uchar *ptr= (uchar*)temp_buf; @@ -902,17 +903,20 @@ void Log_event::print_header(FILE* file, my_off_t hexdump_from) char *h, hex_string[LOG_EVENT_MINIMAL_HEADER_LEN*4]= {0}; char *c, char_string[16+1]= {0}; - /* Common header of event */ - fprintf(file, "# Position Timestamp Type Master ID " - "Size Master Pos Flags \n"); - fprintf(file, "# %8.8lx %02x %02x %02x %02x %02x " - "%02x %02x %02x %02x %02x %02x %02x %02x " - "%02x %02x %02x %02x %02x %02x\n", - hexdump_from, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], - ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], - ptr[12], ptr[13], ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]); - ptr += LOG_EVENT_MINIMAL_HEADER_LEN; - hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN; + /* Pretty-print event common header if header is exactly 19 bytes */ + if (last_event_info->common_header_len == 19) + { + fprintf(file, "# Position Timestamp Type Master ID " + "Size Master Pos Flags \n"); + fprintf(file, "# %8.8lx %02x %02x %02x %02x %02x " + "%02x %02x %02x %02x %02x %02x %02x %02x " + "%02x %02x %02x %02x %02x %02x\n", + hexdump_from, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], + ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], + ptr[12], ptr[13], ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]); + ptr += LOG_EVENT_MINIMAL_HEADER_LEN; + hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN; + } /* Rest of event (without common header) */ for (i= 0, c= char_string, h=hex_string; @@ -1428,18 +1432,17 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, */ #ifdef MYSQL_CLIENT -void Query_log_event::print_query_header(FILE* file, bool short_form, - my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Query_log_event::print_query_header(FILE* file, + LAST_EVENT_INFO* last_event_info) { // TODO: print the catalog ?? char buff[40],*end; // Enough for SET TIMESTAMP bool different_db= 1; uint32 tmp; - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n", get_type_str(), (ulong) thread_id, (ulong) exec_time, error_code); } @@ -1560,10 +1563,9 @@ void Query_log_event::print_query_header(FILE* file, bool short_form, } -void Query_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Query_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - print_query_header(file, short_form, hexdump_from, last_event_info); + print_query_header(file, last_event_info); my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME)); fputs(";\n", file); } @@ -1861,12 +1863,11 @@ void Start_log_event_v3::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Start_log_event_v3::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Start_log_event_v3::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tStart: binlog v %d, server v %s created ", binlog_version, server_version); print_timestamp(file); @@ -2590,20 +2591,19 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, */ #ifdef MYSQL_CLIENT -void Load_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Load_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, hexdump_from, last_event_info, 0); + print(file, last_event_info, 0); } -void Load_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, bool commented) +void Load_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info, + bool commented) { DBUG_ENTER("Load_log_event::print"); - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tQuery\tthread_id=%ld\texec_time=%ld\n", thread_id, exec_time); } @@ -3008,14 +3008,13 @@ void Rotate_log_event::pack_info(Protocol *protocol) */ #ifdef MYSQL_CLIENT -void Rotate_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Rotate_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { char buf[22]; - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tRotate to "); if (new_log_ident) my_fwrite(file, (byte*) new_log_ident, (uint)ident_len, @@ -3211,16 +3210,15 @@ bool Intvar_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Intvar_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Intvar_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; const char *msg; LINT_INIT(msg); - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tIntvar\n"); } @@ -3301,13 +3299,12 @@ bool Rand_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Rand_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Rand_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { char llbuff[22],llbuff2[22]; - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tRand\n"); } fprintf(file, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s;\n", @@ -3372,15 +3369,14 @@ bool Xid_log_event::write(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Xid_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Xid_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (!short_form) + if (!last_event_info->short_form) { char buf[64]; longlong10_to_str(xid, buf, 10); - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tXid = %s\n", buf); fflush(file); } @@ -3571,12 +3567,11 @@ bool User_var_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void User_var_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void User_var_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (!short_form) + if (!last_event_info->short_form) { - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tUser_var\n"); } @@ -3747,12 +3742,11 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) #ifdef HAVE_REPLICATION #ifdef MYSQL_CLIENT -void Unknown_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Unknown_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fputc('\n', file); fprintf(file, "# %s", "Unknown event\n"); } @@ -3819,13 +3813,12 @@ Slave_log_event::~Slave_log_event() #ifdef MYSQL_CLIENT -void Slave_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Slave_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { char llbuff[22]; - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fputc('\n', file); fprintf(file, "\ Slave: master_host: '%s' master_port: %d master_log: '%s' master_pos: %s\n", @@ -3905,13 +3898,12 @@ int Slave_log_event::exec_event(struct st_relay_log_info* rli) */ #ifdef MYSQL_CLIENT -void Stop_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Stop_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fprintf(file, "\tStop\n"); fflush(file); } @@ -4085,19 +4077,19 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len, */ #ifdef MYSQL_CLIENT -void Create_file_log_event::print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, bool enable_local) +void Create_file_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info, + bool enable_local) { - if (short_form) + if (last_event_info->short_form) { if (enable_local && check_fname_outside_temp_buf()) - Load_log_event::print(file, 1, hexdump_from, last_event_info); + Load_log_event::print(file, last_event_info); return; } if (enable_local) { - Load_log_event::print(file, short_form, hexdump_from, last_event_info, + Load_log_event::print(file, last_event_info, !check_fname_outside_temp_buf()); /* That one is for "file_id: etc" below: in mysqlbinlog we want the #, in @@ -4110,11 +4102,9 @@ void Create_file_log_event::print(FILE* file, bool short_form, my_off_t hexdump_ } -void Create_file_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info) +void Create_file_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, hexdump_from, last_event_info, 0); + print(file, last_event_info, 0); } #endif /* MYSQL_CLIENT */ @@ -4274,13 +4264,12 @@ bool Append_block_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Append_block_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, +void Append_block_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fputc('\n', file); fprintf(file, "#%s: file_id: %d block_len: %d\n", get_type_str(), file_id, block_len); @@ -4419,13 +4408,12 @@ bool Delete_file_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Delete_file_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, +void Delete_file_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fputc('\n', file); fprintf(file, "#Delete_file: file_id=%u\n", file_id); } @@ -4516,13 +4504,12 @@ bool Execute_load_log_event::write(IO_CACHE* file) */ #ifdef MYSQL_CLIENT -void Execute_load_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, +void Execute_load_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - if (short_form) + if (last_event_info->short_form) return; - print_header(file, hexdump_from); + print_header(file, last_event_info); fputc('\n', file); fprintf(file, "#Exec_load: file_id=%d\n", file_id); @@ -4729,20 +4716,18 @@ Execute_load_query_log_event::write_post_header_for_derived(IO_CACHE* file) #ifdef MYSQL_CLIENT -void Execute_load_query_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, +void Execute_load_query_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info) { - print(file, short_form, hexdump_from, last_event_info, 0); + print(file, last_event_info, 0); } -void Execute_load_query_log_event::print(FILE* file, bool short_form, - my_off_t hexdump_from, +void Execute_load_query_log_event::print(FILE* file, LAST_EVENT_INFO* last_event_info, const char *local_fname) { - print_query_header(file, short_form, hexdump_from, last_event_info); + print_query_header(file, last_event_info); if (local_fname) { @@ -4763,7 +4748,7 @@ void Execute_load_query_log_event::print(FILE* file, bool short_form, fprintf(file, ";\n"); } - if (!short_form) + if (!last_event_info->short_form) fprintf(file, "# file_id: %d \n", file_id); } #endif diff --git a/sql/log_event.h b/sql/log_event.h index 9351e9b1148..80dd40f0dd5 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -451,12 +451,18 @@ struct st_relay_log_info; #ifdef MYSQL_CLIENT /* - A structure for mysqlbinlog to remember the last db, flags2, sql_mode etc; it - is passed to events' print() methods, so that they print only the necessary - USE and SET commands. + A structure for mysqlbinlog to know how to print events + + This structure is passed to the event's print() methods so that only + the necessary USE and SET commands are printed. Last db, flags2, + sql_mode etc are stored here. + + The structure also contain other information on how to print the + events, e.g. short_form, hexdump_from. */ typedef struct st_last_event_info { + /* Old settings for database, sql_mode etc */ // TODO: have the last catalog here ?? char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is bool flags2_inited; @@ -480,6 +486,12 @@ typedef struct st_last_event_info bzero(charset, sizeof(charset)); bzero(time_zone_str, sizeof(time_zone_str)); } + + /* Settings on how to print the events */ + bool short_form; + my_off_t hexdump_from; + uint8 common_header_len; + } LAST_EVENT_INFO; #endif @@ -589,10 +601,9 @@ public: static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event *description_event); /* print*() functions are used by mysqlbinlog */ - virtual void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0) = 0; + virtual void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0) = 0; void print_timestamp(FILE* file, time_t *ts = 0); - void print_header(FILE* file, my_off_t hexdump_from= 0); + void print_header(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif static void *operator new(size_t size) @@ -752,11 +763,8 @@ public: uint32 q_len_arg); #endif /* HAVE_REPLICATION */ #else - void print_query_header(FILE* file, bool short_form= 0, - my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print_query_header(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Query_log_event(const char* buf, uint event_len, @@ -810,8 +818,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Slave_log_event(const char* buf, uint event_len); @@ -899,10 +906,8 @@ public: bool use_rli_only_for_errors); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info = 0); - void print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, bool commented); + void print(FILE* file, LAST_EVENT_INFO* last_event_info = 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool commented); #endif /* @@ -991,8 +996,7 @@ public: #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Start_log_event_v3(const char* buf, @@ -1087,8 +1091,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Intvar_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1129,8 +1132,7 @@ class Rand_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Rand_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1167,8 +1169,7 @@ class Xid_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Xid_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1210,8 +1211,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif User_var_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1237,8 +1237,7 @@ public: {} int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Stop_log_event(const char* buf, const Format_description_log_event* description_event): @@ -1277,8 +1276,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Rotate_log_event(const char* buf, uint event_len, @@ -1331,10 +1329,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Create_file_log_event(const char* buf, uint event_len, @@ -1401,8 +1397,7 @@ public: virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Append_block_log_event(const char* buf, uint event_len, @@ -1437,10 +1432,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Delete_file_log_event(const char* buf, uint event_len, @@ -1475,8 +1468,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Execute_load_log_event(const char* buf, uint event_len, @@ -1561,11 +1553,10 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); /* Prints the query as LOAD DATA LOCAL and with rewritten filename */ - void print(FILE* file, bool short_form, my_off_t hexdump_from, - LAST_EVENT_INFO* last_event_info, const char *local_fname); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, + const char *local_fname); #endif Execute_load_query_log_event(const char* buf, uint event_len, const Format_description_log_event *description_event); @@ -1594,8 +1585,7 @@ public: Log_event(buf, description_event) {} ~Unknown_log_event() {} - void print(FILE* file, bool short_form= 0, my_off_t hexdump_from= 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); Log_event_type get_type_code() { return UNKNOWN_EVENT;} bool is_valid() const { return 1; } }; From 621e28cbe167fe65bd863d6adb0c77fec58f6a08 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Thu, 13 Oct 2005 00:24:14 +0200 Subject: [PATCH 083/322] Building with compile-pentium-valgrind-max (without safemalloc) defines my_free() without flags, so a typo on flags will go unnoticed; I put flags in this my_free() definition (as a no-op which will still make the compiler check correctness of the flags). Applied: this caught a typo in my_realloc.c. Kindly approved by Konstantin and Mats. --- include/my_sys.h | 3 ++- mysys/my_realloc.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index f7b85916abf..76031806b82 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -158,7 +158,8 @@ extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strdup_with_length(const byte *from, uint length, myf MyFlags); -#define my_free(PTR,FG) my_no_flags_free(PTR) +/* we do use FG (as a no-op) in below so that a typo on FG is caught */ +#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */ diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c index c8edb172890..a385bf1e530 100644 --- a/mysys/my_realloc.c +++ b/mysys/my_realloc.c @@ -52,7 +52,7 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags) if ((point = (char*)realloc(oldpoint,size)) == NULL) { if (my_flags & MY_FREE_ON_ERROR) - my_free(oldpoint,MyFLAGS); + my_free(oldpoint, my_flags); if (my_flags & MY_HOLD_ON_ERROR) DBUG_RETURN(oldpoint); my_errno=errno; From a6ceb59491f517df17b7fd2922100137c3033cfb Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Thu, 13 Oct 2005 00:29:23 +0200 Subject: [PATCH 084/322] fixes after merge of 4.1. --- mysql-test/r/subselect.result | 4 ++-- mysql-test/t/subselect.test | 5 ++--- sql/log_event.cc | 6 +----- sql/log_event.h | 16 ---------------- sql/slave.cc | 11 ++++++----- 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 91e057da419..d42e439f4de 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1160,7 +1160,7 @@ Code2 char(2) NOT NULL default '', PRIMARY KEY (Code) ) ENGINE=MyISAM; INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); -INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); Continent Name Population Oceania Sydney 3276207 @@ -2512,7 +2512,7 @@ Code2 char(2) NOT NULL default '' ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); -INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 758ec7909f6..cc621fb5835 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -665,7 +665,7 @@ CREATE TABLE t2 ( ) ENGINE=MyISAM; INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); -INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); @@ -1526,7 +1526,7 @@ CREATE TABLE t1 ( ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); -INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); @@ -1962,7 +1962,6 @@ insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; drop table t1; - # # BUG #10308: purge log with subselect # diff --git a/sql/log_event.cc b/sql/log_event.cc index 4bfe502d77e..9bc62b30899 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2992,12 +2992,9 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, #endif -Rotate_log_event::Rotate_log_event(const char* buf, int event_len, - bool old_format) - :Log_event(buf, old_format), new_log_ident(0), flags(DUP_NAME) Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, const Format_description_log_event* description_event) - :Log_event(buf, description_event) ,new_log_ident(NULL),alloced(0) + :Log_event(buf, description_event) ,new_log_ident(0), flags(DUP_NAME) { DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)"); // The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET @@ -3027,7 +3024,6 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, bool Rotate_log_event::write(IO_CACHE* file) { char buf[ROTATE_HEADER_LEN]; - DBUG_ASSERT(!(flags & ZERO_LEN)); // such an event cannot be written int8store(buf + R_POS_OFFSET, pos); return (write_header(file, ROTATE_HEADER_LEN + ident_len) || my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) || diff --git a/sql/log_event.h b/sql/log_event.h index 35bddd14d3b..b0f76aa1034 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -640,13 +640,6 @@ public: const char **error, const Format_description_log_event *description_event); - virtual int get_event_len() - { - return (cached_event_len ? cached_event_len : - (cached_event_len = LOG_EVENT_HEADER_LEN + get_data_size())); - } - static Log_event* read_log_event(const char* buf, int event_len, - const char **error, bool old_format); /* returns the human readable name of the event's type */ const char* get_type_str(); }; @@ -1255,7 +1248,6 @@ class Rotate_log_event: public Log_event { public: enum { - ZERO_LEN= 1, // if event should report 0 as its length DUP_NAME= 2 // if constructor should dup the string argument }; const char* new_log_ident; @@ -1282,14 +1274,6 @@ public: my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR)); } Log_event_type get_type_code() { return ROTATE_EVENT;} - virtual int get_event_len() - { - if (flags & ZERO_LEN) - return 0; - if (cached_event_len == 0) - cached_event_len= LOG_EVENT_HEADER_LEN + get_data_size(); - return cached_event_len; - } int get_data_size() { return ident_len + ROTATE_HEADER_LEN;} bool is_valid() const { return new_log_ident != 0; } #ifndef MYSQL_CLIENT diff --git a/sql/slave.cc b/sql/slave.cc index cb52abc68b3..15a70b788e6 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4438,10 +4438,12 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT && buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT && buf[EVENT_TYPE_OFFSET]!=STOP_EVENT) + { mi->master_log_pos+= inc_pos; - memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); - DBUG_ASSERT(rli->ign_master_log_name_end[0]); - rli->ign_master_log_pos_end= mi->master_log_pos; + memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); + DBUG_ASSERT(rli->ign_master_log_name_end[0]); + rli->ign_master_log_pos_end= mi->master_log_pos; + } rli->relay_log.signal_update(); // the slave SQL thread needs to re-check DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); } @@ -4850,8 +4852,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli) DBUG_PRINT("info",("seeing an ignored end segment")); ev= new Rotate_log_event(thd, rli->ign_master_log_name_end, 0, rli->ign_master_log_pos_end, - Rotate_log_event::DUP_NAME | - Rotate_log_event::ZERO_LEN); + Rotate_log_event::DUP_NAME); rli->ign_master_log_name_end[0]= 0; if (unlikely(!ev)) { From a46dd4125572e06943b2a07a35e3c2a7a3197477 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Wed, 12 Oct 2005 22:44:42 -0700 Subject: [PATCH 085/322] BUG# 13052 Clean application of patch - - Added --tz-utc to fix issue of dumping timestamp values between servers with different global time zone settings, particularly with regard to the day of DST changeover, which without this fix, would dump duplicate timestamp values. --- client/client_priv.h | 2 +- client/mysqldump.c | 29 +++++- mysql-test/r/mysqldump.result | 184 ++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 21 ++++ 4 files changed, 234 insertions(+), 2 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 18102fa8b16..a9d5364df49 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -51,5 +51,5 @@ enum options_client #endif OPT_TRIGGERS, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, - OPT_AUTO_CLOSE + OPT_TZ_UTC, OPT_AUTO_CLOSE }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 21933ab03f2..d1ecc30916e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -92,7 +92,7 @@ static my_bool verbose=0,tFlag=0,dFlag=0,quick= 1, extended_insert= 1, opt_single_transaction=0, opt_comments= 0, opt_compact= 0, opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0, opt_complete_insert= 0, opt_drop_database= 0, - opt_dump_triggers= 0, opt_routines=0; + opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*sock=0; static my_bool insert_pat_inited=0; @@ -385,6 +385,9 @@ static struct my_option my_long_options[] = {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table", (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"tz-utc", OPT_TZ_UTC, + "SET TIME_ZONE='UTC' at top of dump to allow dumping of date types between servers with different time zones.", + (gptr*) &opt_tz_utc, (gptr*) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user.", (gptr*) ¤t_user, (gptr*) ¤t_user, 0, GET_STR, REQUIRED_ARG, @@ -509,6 +512,13 @@ static void write_header(FILE *sql_file, char *db_name) "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;" "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;" "\n/*!40101 SET NAMES %s */;\n",default_charset); + + if (opt_tz_utc) + { + fprintf(sql_file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n"); + fprintf(sql_file, "/*!40103 SET TIME_ZONE='+00:00' */;\n"); + } + if (!path) { fprintf(md_result_file,"\ @@ -535,6 +545,9 @@ static void write_footer(FILE *sql_file) } else if (!opt_compact) { + if (opt_tz_utc) + fprintf(sql_file,"/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n"); + fprintf(sql_file,"\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n"); if (!path) { @@ -902,6 +915,20 @@ static int dbConnect(char *host, char *user,char *passwd) safe_exit(EX_MYSQLERR); return 1; } + /* + set time_zone to UTC to allow dumping date types between servers with + different time zone settings + */ + if (opt_tz_utc) + { + my_snprintf(buff, sizeof(buff), "/*!40103 SET TIME_ZONE='+00:00' */"); + if (mysql_query_with_error_report(sock, 0, buff)) + { + mysql_close(sock); + safe_exit(EX_MYSQLERR); + return 1; + } + } return 0; } /* dbConnect */ diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index ca303c57c5c..4757bd17b42 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -64,6 +64,8 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -80,6 +82,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -89,6 +92,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -99,6 +104,7 @@ CREATE TABLE `t1` ( ); INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -157,6 +163,8 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -173,6 +181,7 @@ INSERT INTO `t1` VALUES ('абцде'); INSERT INTO `t1` VALUES (NULL); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -185,6 +194,8 @@ UNLOCK TABLES; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; @@ -200,12 +211,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -221,6 +235,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -239,6 +254,8 @@ create table t1(a int); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -253,6 +270,7 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -262,6 +280,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -276,6 +296,7 @@ CREATE TABLE "t1" ( LOCK TABLES "t1" WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -288,6 +309,8 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -302,6 +325,7 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -311,6 +335,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -325,6 +351,7 @@ CREATE TABLE "t1" ( LOCK TABLES "t1" WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -340,6 +367,8 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; @@ -347,6 +376,7 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; @@ -363,6 +393,8 @@ drop table t1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -371,6 +403,7 @@ drop table t1; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `test`; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -386,6 +419,8 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -394,6 +429,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; USE `mysqldump_test_db`; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -411,6 +447,8 @@ INSERT INTO t1 VALUES (_latin1 ' /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -426,6 +464,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('ÄÖÜß'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -435,6 +474,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -450,12 +491,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('Ž™šá'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -471,12 +515,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('Ž™šá'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -492,6 +539,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('ÄÖÜß'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -508,6 +556,8 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -523,6 +573,7 @@ LOCK TABLES `t2` WRITE; INSERT INTO `t2` VALUES (4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -541,6 +592,8 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -556,6 +609,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (0x602010000280100005E71A); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -574,6 +628,8 @@ INSERT INTO t1 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -589,6 +645,7 @@ LOCK TABLES `t1` WRITE; INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -603,6 +660,8 @@ UNLOCK TABLES; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -616,6 +675,7 @@ CREATE TABLE `t1` ( /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -963,6 +1023,8 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1307,6 +1369,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` (`F_c4ca4238a0b923820dcc509a6f75849b`, `F_c81e728d9d4c2f636f067f89cc14862c`, `F_eccbc87e4b5ce2fe28308fd9f2a7baf3`, `F_a87ff679a2f3e71d9181a67b7542122c`, `F_e4da3b7fbbce2345d7772b0674a318d5`, `F_1679091c5a880faf6fb5e6087eb1b2dc`, `F_8f14e45fceea167a5a36dedd4bea2543`, `F_c9f0f895fb98ab9159f51fd0297e236d`, `F_45c48cce2e2d7fbdea1afc51c7c6ad26`, `F_d3d9446802a44259755d38e6d163e820`, `F_6512bd43d9caa6e02c990b0a82652dca`, `F_c20ad4d76fe97759aa27a0c99bff6710`, `F_c51ce410c124a10e0db5e4b97fc2af39`, `F_aab3238922bcc25a6f606eb525ffdc56`, `F_9bf31c7ff062936a96d3c8bd1f8f2ff3`, `F_c74d97b01eae257e44aa9d5bade97baf`, `F_70efdf2ec9b086079795c442636b55fb`, `F_6f4922f45568161a8cdf4ad2299f6d23`, `F_1f0e3dad99908345f7439f8ffabdffc4`, `F_98f13708210194c475687be6106a3b84`, `F_3c59dc048e8850243be8079a5c74d079`, `F_b6d767d2f8ed5d21a44b0e5886680cb9`, `F_37693cfc748049e45d87b8c7d8b9aacd`, `F_1ff1de774005f8da13f42943881c655f`, `F_8e296a067a37563370ded05f5a3bf3ec`, `F_4e732ced3463d06de0ca9a15b6153677`, `F_02e74f10e0327ad868d138f2b4fdd6f0`, `F_33e75ff09dd601bbe69f351039152189`, `F_6ea9ab1baa0efb9e19094440c317e21b`, `F_34173cb38f07f89ddbebc2ac9128303f`, `F_c16a5320fa475530d9583c34fd356ef5`, `F_6364d3f0f495b6ab9dcf8d3b5c6e0b01`, `F_182be0c5cdcd5072bb1864cdee4d3d6e`, `F_e369853df766fa44e1ed0ff613f563bd`, `F_1c383cd30b7c298ab50293adfecb7b18`, `F_19ca14e7ea6328a42e0eb13d585e4c22`, `F_a5bfc9e07964f8dddeb95fc584cd965d`, `F_a5771bce93e200c36f7cd9dfd0e5deaa`, `F_d67d8ab4f4c10bf22aa353e27879133c`, `F_d645920e395fedad7bbbed0eca3fe2e0`, `F_3416a75f4cea9109507cacd8e2f2aefc`, `F_a1d0c6e83f027327d8461063f4ac58a6`, `F_17e62166fc8586dfa4d1bc0e1742c08b`, `F_f7177163c833dff4b38fc8d2872f1ec6`, `F_6c8349cc7260ae62e3b1396831a8398f`, `F_d9d4f495e875a2e075a1a4a6e1b9770f`, `F_67c6a1e7ce56d3d6fa748ab6d9af3fd7`, `F_642e92efb79421734881b53e1e1b18b6`, `F_f457c545a9ded88f18ecee47145a72c0`, `F_c0c7c76d30bd3dcaefc96f40275bdc0a`, `F_2838023a778dfaecdc212708f721b788`, `F_9a1158154dfa42caddbd0694a4e9bdc8`, `F_d82c8d1619ad8176d665453cfb2e55f0`, `F_a684eceee76fc522773286a895bc8436`, `F_b53b3a3d6ab90ce0268229151c9bde11`, `F_9f61408e3afb633e50cdf1b20de6f466`, `F_72b32a1f754ba1c09b3695e0cb6cde7f`, `F_66f041e16a60928b05a7e228a89c3799`, `F_093f65e080a295f8076b1c5722a46aa2`, `F_072b030ba126b2f4b2374f342be9ed44`, `F_7f39f8317fbdb1988ef4c628eba02591`, `F_44f683a84163b3523afe57c2e008bc8c`, `F_03afdbd66e7929b125f8597834fa83a4`, `F_ea5d2f1c4608232e07d3aa3d998e5135`, `F_fc490ca45c00b1249bbe3554a4fdf6fb`, `F_3295c76acbf4caaed33c36b1b5fc2cb1`, `F_735b90b4568125ed6c3f678819b6e058`, `F_a3f390d88e4c41f2747bfa2f1b5f87db`, `F_14bfa6bb14875e45bba028a21ed38046`, `F_7cbbc409ec990f19c78c75bd1e06f215`, `F_e2c420d928d4bf8ce0ff2ec19b371514`, `F_32bb90e8976aab5298d5da10fe66f21d`, `F_d2ddea18f00665ce8623e36bd4e3c7c5`, `F_ad61ab143223efbc24c7d2583be69251`, `F_d09bf41544a3365a46c9077ebb5e35c3`, `F_fbd7939d674997cdb4692d34de8633c4`, `F_28dd2c7955ce926456240b2ff0100bde`, `F_35f4a8d465e6e1edc05f3d8ab658c551`, `F_d1fe173d08e959397adf34b1d77e88d7`, `F_f033ab37c30201f73f142449d037028d`, `F_43ec517d68b6edd3015b3edc9a11367b`, `F_9778d5d219c5080b9a6a17bef029331c`, `F_fe9fc289c3ff0af142b6d3bead98a923`, `F_68d30a9594728bc39aa24be94b319d21`, `F_3ef815416f775098fe977004015c6193`, `F_93db85ed909c13838ff95ccfa94cebd9`, `F_c7e1249ffc03eb9ded908c236bd1996d`, `F_2a38a4a9316c49e5a833517c45d31070`, `F_7647966b7343c29048673252e490f736`, `F_8613985ec49eb8f757ae6439e879bb2a`, `F_54229abfcfa5649e7003b83dd4755294`, `F_92cc227532d17e56e07902b254dfad10`, `F_98dce83da57b0395e163467c9dae521b`, `F_f4b9ec30ad9f68f89b29639786cb62ef`, `F_812b4ba287f5ee0bc9d43bbf5bbe87fb`, `F_26657d5ff9020d2abefe558796b99584`, `F_e2ef524fbf3d9fe611d5a8e90fefdc9c`, `F_ed3d2c21991e3bef5e069713af9fa6ca`, `F_ac627ab1ccbdb62ec96e702f07f6425b`, `F_f899139df5e1059396431415e770c6dd`, `F_38b3eff8baf56627478ec76a704e9b52`, `F_ec8956637a99787bd197eacd77acce5e`, `F_6974ce5ac660610b44d9b9fed0ff9548`, `F_c9e1074f5b3f9fc8ea15d152add07294`, `F_65b9eea6e1cc6bb9f0cd2a47751a186f`, `F_f0935e4cd5920aa6c7c996a5ee53a70f`, `F_a97da629b098b75c294dffdc3e463904`, `F_a3c65c2974270fd093ee8a9bf8ae7d0b`, `F_2723d092b63885e0d7c260cc007e8b9d`, `F_5f93f983524def3dca464469d2cf9f3e`, `F_698d51a19d8a121ce581499d7b701668`, `F_7f6ffaa6bb0b408017b62254211691b5`, `F_73278a4a86960eeb576a8fd4c9ec6997`, `F_5fd0b37cd7dbbb00f97ba6ce92bf5add`, `F_2b44928ae11fb9384c4cf38708677c48`, `F_c45147dee729311ef5b5c3003946c48f`, `F_eb160de1de89d9058fcb0b968dbbbd68`, `F_5ef059938ba799aaa845e1c2e8a762bd`, `F_07e1cd7dca89a1678042477183b7ac3f`, `F_da4fb5c6e93e74d3df8527599fa62642`, `F_4c56ff4ce4aaf9573aa5dff913df997a`, `F_a0a080f42e6f13b3a2df133f073095dd`, `F_202cb962ac59075b964b07152d234b70`, `F_c8ffe9a587b126f152ed3d89a146b445`, `F_3def184ad8f4755ff269862ea77393dd`, `F_069059b7ef840f0c74a814ec9237b6ec`, `F_ec5decca5ed3d6b8079e2e7e7bacc9f2`, `F_76dc611d6ebaafc66cc0879c71b5db5c`, `F_d1f491a404d6854880943e5c3cd9ca25`, `F_9b8619251a19057cff70779273e95aa6`, `F_1afa34a7f984eeabdbb0a7d494132ee5`, `F_65ded5353c5ee48d0b7d48c591b8f430`, `F_9fc3d7152ba9336a670e36d0ed79bc43`, `F_02522a2b2726fb0a03bb19f2d8d9524d`, `F_7f1de29e6da19d22b51c68001e7e0e54`, `F_42a0e188f5033bc65bf8d78622277c4e`, `F_3988c7f88ebcb58c6ce932b957b6f332`, `F_013d407166ec4fa56eb1e1f8cbe183b9`, `F_e00da03b685a0dd18fb6a08af0923de0`, `F_1385974ed5904a438616ff7bdb3f7439`, `F_0f28b5d49b3020afeecd95b4009adf4c`, `F_a8baa56554f96369ab93e4f3bb068c22`, `F_903ce9225fca3e988c2af215d4e544d3`, `F_0a09c8844ba8f0936c20bd791130d6b6`, `F_2b24d495052a8ce66358eb576b8912c8`, `F_a5e00132373a7031000fd987a3c9f87b`, `F_8d5e957f297893487bd98fa830fa6413`, `F_47d1e990583c9c67424d369f3414728e`, `F_f2217062e9a397a1dca429e7d70bc6ca`, `F_7ef605fc8dba5425d6965fbd4c8fbe1f`, `F_a8f15eda80c50adb0e71943adc8015cf`, `F_37a749d808e46495a8da1e5352d03cae`, `F_b3e3e393c77e35a4a3f3cbd1e429b5dc`, `F_1d7f7abc18fcb43975065399b0d1e48e`, `F_2a79ea27c279e471f4d180b08d62b00a`, `F_1c9ac0159c94d8d0cbedc973445af2da`, `F_6c4b761a28b734fe93831e3fb400ce87`, `F_06409663226af2f3114485aa4e0a23b4`, `F_140f6969d5213fd0ece03148e62e461e`, `F_b73ce398c39f506af761d2277d853a92`, `F_bd4c9ab730f5513206b999ec0d90d1fb`, `F_82aa4b0af34c2313a562076992e50aa3`, `F_0777d5c17d4066b82ab86dff8a46af6f`, `F_fa7cdfad1a5aaf8370ebeda47a1ff1c3`, `F_9766527f2b5d3e95d4a733fcfb77bd7e`, `F_7e7757b1e12abcb736ab9a754ffb617a`, `F_5878a7ab84fb43402106c575658472fa`, `F_006f52e9102a8d3be2fe5614f42ba989`, `F_3636638817772e42b59d74cff571fbb3`, `F_149e9677a5989fd342ae44213df68868`, `F_a4a042cf4fd6bfb47701cbc8a1653ada`, `F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e`, `F_f7e6c85504ce6e82442c770f7c8606f0`, `F_bf8229696f7a3bb4700cfddef19fa23f`, `F_82161242827b703e6acf9c726942a1e4`, `F_38af86134b65d0f10fe33d30dd76442e`, `F_96da2f590cd7246bbde0051047b0d6f7`, `F_8f85517967795eeef66c225f7883bdcb`, `F_8f53295a73878494e9bc8dd6c3c7104f`, `F_045117b0e0a11a242b9765e79cbf113f`, `F_fc221309746013ac554571fbd180e1c8`, `F_4c5bde74a8f110656874902f07378009`, `F_cedebb6e872f539bef8c3f919874e9d7`, `F_6cdd60ea0045eb7a6ec44c54d29ed402`, `F_eecca5b6365d9607ee5a9d336962c534`, `F_9872ed9fc22fc182d371c3e9ed316094`, `F_31fefc0e570cb3860f2a6d4b38c6490d`, `F_9dcb88e0137649590b755372b040afad`, `F_a2557a7b2e94197ff767970b67041697`, `F_cfecdb276f634854f3ef915e2e980c31`, `F_0aa1883c6411f7873cb83dacb17b0afc`, `F_58a2fc6ed39fd083f55d4182bf88826d`, `F_bd686fd640be98efaae0091fa301e613`, `F_a597e50502f5ff68e3e25b9114205d4a`, `F_0336dcbab05b9d5ad24f4333c7658a0e`, `F_084b6fbb10729ed4da8c3d3f5a3ae7c9`, `F_85d8ce590ad8981ca2c8286f79f59954`, `F_0e65972dce68dad4d52d063967f0a705`, `F_84d9ee44e457ddef7f2c4f25dc8fa865`, `F_3644a684f98ea8fe223c713b77189a77`, `F_757b505cfd34c64c85ca5b5690ee5293`, `F_854d6fae5ee42911677c739ee1734486`, `F_e2c0be24560d78c5e599c2a9c9d0bbd2`, `F_274ad4786c3abca69fa097b85867d9a4`, `F_eae27d77ca20db309e056e3d2dcd7d69`, `F_7eabe3a1649ffa2b3ff8c02ebfd5659f`, `F_69adc1e107f7f7d035d7baf04342e1ca`, `F_091d584fced301b442654dd8c23b3fc9`, `F_b1d10e7bafa4421218a51b1e1f1b0ba2`, `F_6f3ef77ac0e3619e98159e9b6febf557`, `F_eb163727917cbba1eea208541a643e74`, `F_1534b76d325a8f591b52d302e7181331`, `F_979d472a84804b9f647bc185a877a8b5`, `F_ca46c1b9512a7a8315fa3c5a946e8265`, `F_3b8a614226a953a8cd9526fca6fe9ba5`, `F_45fbc6d3e05ebd93369ce542e8f2322d`, `F_63dc7ed1010d3c3b8269faf0ba7491d4`, `F_e96ed478dab8595a7dbda4cbcbee168f`, `F_c0e190d8267e36708f955d7ab048990d`, `F_ec8ce6abb3e952a85b8551ba726a1227`, `F_060ad92489947d410d897474079c1477`, `F_bcbe3365e6ac95ea2c0343a2395834dd`, `F_115f89503138416a242f40fb7d7f338e`, `F_13fe9d84310e77f13a6d184dbf1232f3`, `F_d1c38a09acc34845c6be3a127a5aacaf`, `F_9cfdf10e8fc047a44b08ed031e1f0ed1`, `F_705f2172834666788607efbfca35afb3`, `F_74db120f0a8e5646ef5a30154e9f6deb`, `F_57aeee35c98205091e18d1140e9f38cf`, `F_6da9003b743b65f4c0ccd295cc484e57`, `F_9b04d152845ec0a378394003c96da594`, `F_be83ab3ecd0db773eb2dc1b0a17836a1`, `F_e165421110ba03099a1c0393373c5b43`, `F_289dff07669d7a23de0ef88d2f7129e7`, `F_577ef1154f3240ad5b9b413aa7346a1e`, `F_01161aaa0b6d1345dd8fe4e481144d84`, `F_539fd53b59e3bb12d203f45a912eeaf2`, `F_ac1dd209cbcc5e5d1c6e28598e8cbbe8`, `F_555d6702c950ecb729a966504af0a635`, `F_335f5352088d7d9bf74191e006d8e24c`, `F_f340f1b1f65b6df5b5e3f94d95b11daf`, `F_e4a6222cdb5b34375400904f03d8e6a5`, `F_cb70ab375662576bd1ac5aaf16b3fca4`, `F_9188905e74c28e489b44e954ec0b9bca`, `F_0266e33d3f546cb5436a10798e657d97`, `F_38db3aed920cf82ab059bfccbd02be6a`, `F_3cec07e9ba5f5bb252d13f5f431e4bbb`, `F_621bf66ddb7c962aa0d22ac97d69b793`, `F_077e29b11be80ab57e1a2ecabb7da330`, `F_6c9882bbac1c7093bd25041881277658`, `F_19f3cd308f1455b3fa09a282e0d496f4`, `F_03c6b06952c750899bb03d998e631860`, `F_c24cd76e1ce41366a4bbe8a49b02a028`, `F_c52f1bd66cc19d05628bd8bf27af3ad6`, `F_fe131d7f5a6b38b23cc967316c13dae2`, `F_f718499c1c8cef6730f9fd03c8125cab`, `F_d96409bf894217686ba124d7356686c9`, `F_502e4a16930e414107ee22b6198c578f`, `F_cfa0860e83a4c3a763a7e62d825349f7`, `F_a4f23670e1833f3fdb077ca70bbd5d66`, `F_b1a59b315fc9a3002ce38bbe070ec3f5`, `F_36660e59856b4de58a219bcf4e27eba3`, `F_8c19f571e251e61cb8dd3612f26d5ecf`, `F_d6baf65e0b240ce177cf70da146c8dc8`, `F_e56954b4f6347e897f954495eab16a88`, `F_f7664060cc52bc6f3d620bcedc94a4b6`, `F_eda80a3d5b344bc40f3bc04f65b7a357`, `F_8f121ce07d74717e0b1f21d122e04521`, `F_06138bc5af6023646ede0e1f7c1eac75`, `F_39059724f73a9969845dfe4146c5660e`, `F_7f100b7b36092fb9b06dfb4fac360931`, `F_7a614fd06c325499f1680b9896beedeb`, `F_4734ba6f3de83d861c3176a6273cac6d`, `F_d947bf06a885db0d477d707121934ff8`, `F_63923f49e5241343aa7acb6a06a751e7`, `F_db8e1af0cb3aca1ae2d0018624204529`, `F_20f07591c6fcb220ffe637cda29bb3f6`, `F_07cdfd23373b17c6b337251c22b7ea57`, `F_d395771085aab05244a4fb8fd91bf4ee`, `F_92c8c96e4c37100777c7190b76d28233`, `F_e3796ae838835da0b6f6ea37bcf8bcb7`, `F_6a9aeddfc689c1d0e3b9ccc3ab651bc5`, `F_0f49c89d1e7298bb9930789c8ed59d48`, `F_46ba9f2a6976570b0353203ec4474217`, `F_0e01938fc48a2cfb5f2217fbfb00722d`, `F_16a5cdae362b8d27a1d8f8c7b78b4330`, `F_918317b57931b6b7a7d29490fe5ec9f9`, `F_48aedb8880cab8c45637abc7493ecddd`, `F_839ab46820b524afda05122893c2fe8e`, `F_f90f2aca5c640289d0a29417bcb63a37`, `F_9c838d2e45b2ad1094d42f4ef36764f6`, `F_1700002963a49da13542e0726b7bb758`, `F_53c3bce66e43be4f209556518c2fcb54`, `F_6883966fd8f918a4aa29be29d2c386fb`, `F_49182f81e6a13cf5eaa496d51fea6406`, `F_d296c101daa88a51f6ca8cfc1ac79b50`, `F_9fd81843ad7f202f26c1a174c7357585`, `F_26e359e83860db1d11b6acca57d8ea88`, `F_ef0d3930a7b6c95bd2b32ed45989c61f`, `F_94f6d7e04a4d452035300f18b984988c`, `F_34ed066df378efacc9b924ec161e7639`, `F_577bcc914f9e55d5e4e4f82f9f00e7d4`, `F_11b9842e0a271ff252c1903e7132cd68`, `F_37bc2f75bf1bcfe8450a1a41c200364c`, `F_496e05e1aea0a9c4655800e8a7b9ea28`, `F_b2eb7349035754953b57a32e2841bda5`, `F_8e98d81f8217304975ccb23337bb5761`, `F_a8c88a0055f636e4a163a5e3d16adab7`, `F_eddea82ad2755b24c4e168c5fc2ebd40`, `F_06eb61b839a0cefee4967c67ccb099dc`, `F_9dfcd5e558dfa04aaf37f137a1d9d3e5`, `F_950a4152c2b4aa3ad78bdd6b366cc179`, `F_158f3069a435b314a80bdcb024f8e422`, `F_758874998f5bd0c393da094e1967a72b`, `F_ad13a2a07ca4b7642959dc0c4c740ab6`, `F_3fe94a002317b5f9259f82690aeea4cd`, `F_5b8add2a5d98b1a652ea7fd72d942dac`, `F_432aca3a1e345e339f35a30c8f65edce`, `F_8d3bba7425e7c98c50f52ca1b52d3735`, `F_320722549d1751cf3f247855f937b982`, `F_caf1a3dfb505ffed0d024130f58c5cfa`, `F_5737c6ec2e0716f3d8a7a5c4e0de0d9a`, `F_bc6dc48b743dc5d013b1abaebd2faed2`, `F_f2fc990265c712c49d51a18a32b39f0c`, `F_89f0fd5c927d466d6ec9a21b9ac34ffa`, `F_a666587afda6e89aec274a3657558a27`, `F_b83aac23b9528732c23cc7352950e880`, `F_cd00692c3bfe59267d5ecfac5310286c`, `F_6faa8040da20ef399b63a72d0e4ab575`, `F_fe73f687e5bc5280214e0486b273a5f9`) VALUES (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,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,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1324,6 +1387,8 @@ INSERT INTO t1 VALUES (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1345,6 +1410,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1372,6 +1438,8 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1396,6 +1464,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1446,6 +1515,8 @@ INSERT INTO t2 VALUES (1), (2); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1458,6 +1529,7 @@ DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1472,6 +1544,8 @@ CREATE TABLE `t2` ( /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1484,6 +1558,7 @@ DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1608,6 +1683,8 @@ create view v1 as select * from t1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1630,6 +1707,7 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1658,6 +1736,8 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1682,6 +1762,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1702,6 +1783,8 @@ INSERT INTO t1 VALUES ('\''); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1717,6 +1800,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('\''); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1740,6 +1824,8 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1785,6 +1871,7 @@ DROP TABLE IF EXISTS `v3`; /*!50001 DROP TABLE IF EXISTS `v3`*/; /*!50001 DROP VIEW IF EXISTS `v3`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1847,6 +1934,8 @@ update t1 set a = 4 where a=3; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1917,6 +2006,7 @@ end */;; DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1931,6 +2021,8 @@ DELIMITER ; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1961,6 +2053,7 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -2060,6 +2153,8 @@ set sql_mode=''; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -2111,6 +2206,7 @@ select sum(id) from t1 into a; END */;; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -2125,3 +2221,91 @@ DROP FUNCTION bug9056_func2; DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1; +drop table if exists t1; +create table t1 (`d` timestamp, unique (`d`)); +set time_zone='+00:00'; +insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +select * from t1; +d +2003-10-25 22:00:00 +2003-10-25 23:00:00 +set time_zone='Europe/Moscow'; +select * from t1; +d +2003-10-26 02:00:00 +2003-10-26 02:00:00 +set global time_zone='Europe/Moscow'; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + UNIQUE KEY `d` (`d`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + UNIQUE KEY `d` (`d`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop table t1; +set global time_zone=default; +set time_zone=default; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7dafac2bde5..6898dbe7a8d 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -907,3 +907,24 @@ DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1; +# +# BUG# 13052 - mysqldump timestamp reloads broken +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (`d` timestamp, unique (`d`)); +set time_zone='+00:00'; +insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +# results should show two different time values +select * from t1; +set time_zone='Europe/Moscow'; +# results should show two same time values, despite unique +select * from t1; +set global time_zone='Europe/Moscow'; +--exec $MYSQL_DUMP --skip-comments --databases test +--exec $MYSQL_DUMP --skip-tz-utc --skip-comments --databases test +drop table t1; +set global time_zone=default; +set time_zone=default; From b2ff38202d2ba6020ce6b5f3bfb8e2c939d0189c Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 13 Oct 2005 11:53:00 +0400 Subject: [PATCH 086/322] A fix and a test case for Bug#12736 "Server crash during a select". The bug was in JOIN::join_free which was wrongly determining that all joins have been already executed and therefore all used tables can be closed. --- mysql-test/r/subselect_innodb.result | 20 +++++++ mysql-test/t/subselect_innodb.test | 22 ++++++++ sql/item_subselect.cc | 6 +++ sql/item_subselect.h | 16 ++++++ sql/sql_lex.h | 7 ++- sql/sql_select.cc | 78 +++++++++++++++++++++++----- sql/sql_select.h | 2 +- sql/sql_union.cc | 14 +++++ 8 files changed, 151 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 0666fd76661..a23b584e510 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -152,3 +152,23 @@ EXECUTE my_stmt; b count(*) deallocate prepare my_stmt; drop table t1,t2; +CREATE TABLE t1 ( +school_name varchar(45) NOT NULL, +country varchar(45) NOT NULL, +funds_requested float NOT NULL, +schooltype varchar(45) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +insert into t1 values ("the school", "USA", 1200, "Human"); +select count(country) as countrycount, sum(funds_requested) as smcnt, +country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; +countrycount smcnt country total_funds +1 1200 USA 1200 +select count(country) as countrycount, sum(funds_requested) as smcnt, +country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; +countrycount smcnt country total_funds +1 1200 USA 1200 +drop table t1; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 3b1d2f393c2..a07cc93ad68 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -161,3 +161,25 @@ deallocate prepare my_stmt; drop table t1,t2; # End of 4.1 tests + +CREATE TABLE t1 ( + school_name varchar(45) NOT NULL, + country varchar(45) NOT NULL, + funds_requested float NOT NULL, + schooltype varchar(45) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into t1 values ("the school", "USA", 1200, "Human"); + +select count(country) as countrycount, sum(funds_requested) as smcnt, + country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; + +select count(country) as countrycount, sum(funds_requested) as smcnt, + country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; + +drop table t1; + diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 1ef3a92f548..8afc885e59b 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1413,6 +1413,12 @@ void subselect_union_engine::cleanup() } +bool subselect_union_engine::is_executed() const +{ + return unit->executed; +} + + void subselect_uniquesubquery_engine::cleanup() { DBUG_ENTER("subselect_uniquesubquery_engine::cleanup"); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 5b22930ae1f..f1c99f74498 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -109,6 +109,12 @@ public: engine_changed= 1; return eng == 0; } + /* + True if this subquery has been already evaluated. Implemented only for + single select and union subqueries only. + */ + bool is_evaluated() const; + /* Used by max/min subquery to initialize value presence registration mechanism. Engine call this method before rexecution query. @@ -317,6 +323,7 @@ public: virtual void print(String *str)= 0; virtual bool change_result(Item_subselect *si, select_subselect *result)= 0; virtual bool no_tables()= 0; + virtual bool is_executed() const { return FALSE; } }; @@ -342,6 +349,7 @@ public: void print (String *str); bool change_result(Item_subselect *si, select_subselect *result); bool no_tables(); + bool is_executed() const { return executed; } }; @@ -363,6 +371,7 @@ public: void print (String *str); bool change_result(Item_subselect *si, select_subselect *result); bool no_tables(); + bool is_executed() const; }; @@ -411,3 +420,10 @@ public: int exec(); void print (String *str); }; + + +inline bool Item_subselect::is_evaluated() const +{ + return engine->is_executed(); +} + diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8d7ec25f97b..3c34c7aaaea 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -386,12 +386,12 @@ protected: select_result *result; ulong found_rows_for_union; bool res; +public: bool prepared, // prepare phase already performed for UNION (unit) optimized, // optimize phase already performed for UNION (unit) executed, // already executed cleaned; -public: // list of fields which points to temporary table for union List item_list; /* @@ -638,6 +638,11 @@ public: SELECT_LEX and all nested SELECT_LEXes and SELECT_LEX_UNITs). */ bool cleanup(); + /* + Recursively cleanup the join of this select lex and of all nested + select lexes. + */ + void cleanup_all_joins(bool full); }; typedef class st_select_lex SELECT_LEX; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1b1a35d2584..d6a9a64ef70 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1377,7 +1377,7 @@ JOIN::exec() DBUG_PRINT("info",("Creating group table")); /* Free first data from old join */ - curr_join->join_free(0); + curr_join->join_free(); if (make_simple_join(curr_join, curr_tmp_table)) DBUG_VOID_RETURN; calc_group_buffer(curr_join, group_list); @@ -1475,7 +1475,7 @@ JOIN::exec() if (curr_tmp_table->distinct) curr_join->select_distinct=0; /* Each row is unique */ - curr_join->join_free(0); /* Free quick selects */ + curr_join->join_free(); /* Free quick selects */ if (curr_join->select_distinct && ! curr_join->group_list) { thd->proc_info="Removing duplicates"; @@ -5718,34 +5718,88 @@ void JOIN_TAB::cleanup() end_read_record(&read_record); } +/* + Partially cleanup JOIN after it has executed: close index or rnd read + (table cursors), free quick selects. -void JOIN::join_free(bool full) + DESCRIPTION + This function is called in the end of execution of a JOIN, before the used + tables are unlocked and closed. + + For a join that is resolved using a temporary table, the first sweep is + performed against actual tables and an intermediate result is inserted + into the temprorary table. + The last sweep is performed against the temporary table. Therefore, + the base tables and associated buffers used to fill the temporary table + are no longer needed, and this function is called to free them. + + For a join that is performed without a temporary table, this function + is called after all rows are sent, but before EOF packet is sent. + + For a simple SELECT with no subqueries this function performs a full + cleanup of the JOIN and calls mysql_unlock_read_tables to free used base + tables. + + If a JOIN is executed for a subquery or if it has a subquery, we can't + do the full cleanup and need to do a partial cleanup only. + o If a JOIN is not the top level join, we must not unlock the tables + because the outer select may not have been evaluated yet, and we + can't unlock only selected tables of a query. + + o Additionally, if this JOIN corresponds to a correlated subquery, we + should not free quick selects and join buffers because they will be + needed for the next execution of the correlated subquery. + + o However, if this is a JOIN for a [sub]select, which is not + a correlated subquery itself, but has subqueries, we can free it + fully and also free JOINs of all its subqueries. The exception + is a subquery in SELECT list, e.g: + SELECT a, (select max(b) from t1) group by c + This subquery will not be evaluated at first sweep and its value will + not be inserted into the temporary table. Instead, it's evaluated + when selecting from the temporary table. Therefore, it can't be freed + here even though it's not correlated. +*/ + +void JOIN::join_free() { SELECT_LEX_UNIT *unit; SELECT_LEX *sl; - DBUG_ENTER("JOIN::join_free"); - /* Optimization: if not EXPLAIN and we are done with the JOIN, free all tables. */ - full= full || (!select_lex->uncacheable && !thd->lex->describe); + bool full= (!select_lex->uncacheable && !thd->lex->describe); + bool can_unlock= full; + DBUG_ENTER("JOIN::join_free"); cleanup(full); for (unit= select_lex->first_inner_unit(); unit; unit= unit->next_unit()) for (sl= unit->first_select(); sl; sl= sl->next_select()) { - JOIN *join= sl->join; - if (join) - join->join_free(full); + Item_subselect *subselect= sl->master_unit()->item; + bool full_local= full && (!subselect || subselect->is_evaluated()); + /* + If this join is evaluated, we can fully clean it up and clean up all + its underlying joins even if they are correlated -- they will not be + used any more anyway. + If this join is not yet evaluated, we still must clean it up to + close its table cursors -- it may never get evaluated, as in case of + ... HAVING FALSE OR a IN (SELECT ...)) + but all table cursors must be closed before the unlock. + */ + sl->cleanup_all_joins(full_local); + /* Can't unlock if at least one JOIN is still needed */ + can_unlock= can_unlock && full_local; } /* We are not using tables anymore Unlock all tables. We may be in an INSERT .... SELECT statement. */ - if (full && lock && thd->lock && !(select_options & SELECT_NO_UNLOCK) && + if (can_unlock && lock && thd->lock && + !(select_options & SELECT_NO_UNLOCK) && !select_lex->subquery_in_having && (select_lex == (thd->lex->unit.fake_select_lex ? thd->lex->unit.fake_select_lex : &thd->lex->select_lex))) @@ -6059,7 +6113,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables, DBUG_RETURN(0); } - join->join_free(0); + join->join_free(); if (send_row) { @@ -9004,7 +9058,7 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) The following will unlock all cursors if the command wasn't an update command */ - join->join_free(0); // Unlock all cursors + join->join_free(); // Unlock all cursors if (join->result->send_eof()) rc= 1; // Don't send error } diff --git a/sql/sql_select.h b/sql/sql_select.h index 0dc4be8c104..d6161eb6372 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -358,7 +358,7 @@ class JOIN :public Sql_alloc the end of execution in order to increase concurrency and reduce memory consumption. */ - void join_free(bool full); + void join_free(); /* Cleanup this JOIN, possibly for reuse */ void cleanup(bool full); void clear(); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 951248e8cd8..dee88af7d83 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -720,3 +720,17 @@ bool st_select_lex::cleanup() DBUG_RETURN(error); } + +void st_select_lex::cleanup_all_joins(bool full) +{ + SELECT_LEX_UNIT *unit; + SELECT_LEX *sl; + + if (join) + join->cleanup(full); + + for (unit= first_inner_unit(); unit; unit= unit->next_unit()) + for (sl= unit->first_select(); sl; sl= sl->next_select()) + sl->cleanup_all_joins(full); +} + From 8682dffc68911d35382649866b7cfb1bc095bf96 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Thu, 13 Oct 2005 13:25:07 +0500 Subject: [PATCH 087/322] memcpy_overlap() replaced with memmove() during the merging. --- strings/ctype-tis620.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index dcb0e0525b4..35cf10f1bcc 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -498,7 +498,7 @@ static uint thai2sortable(uchar *tstr, uint len) l2bias use to control position weight of l2char example (*=l2char) XX*X must come before X*XX */ - memcpy_overlap((char*) p, (char*) (p+1), tlen-1); + memmove((char*) p, (char*) (p+1), tlen-1); tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1; p--; continue; From a93780b23d76d8add31d51bb9b9dc9c6e39c2592 Mon Sep 17 00:00:00 2001 From: "elliot@mysql.com" <> Date: Thu, 13 Oct 2005 05:12:17 -0400 Subject: [PATCH 088/322] BUG#13343 CREATE|etc TRIGGER|VIEW|USER don't commit the transaction (inconsistency) Updated more DDL statements to cause implicit commit. --- mysql-test/r/rpl_ddl.result | 434 ++++++++++++++++++++++++++++++++++++ mysql-test/t/rpl_ddl.test | 107 +++++++++ sql/sql_parse.cc | 15 ++ 3 files changed, 556 insertions(+) diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result index 9f90001ab67..2a97da63c64 100644 --- a/mysql-test/r/rpl_ddl.result +++ b/mysql-test/r/rpl_ddl.result @@ -1254,6 +1254,440 @@ flush logs; SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to slave ------- SHOW PROCEDURE STATUS LIKE 'p1'; + +######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 18 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to master ------- +CREATE OR REPLACE VIEW v1 as select * from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## ALTER VIEW v1 AS select f1 from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 19 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ALTER VIEW v1 AS select f1 from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## DROP VIEW IF EXISTS v1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 20 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +DROP VIEW IF EXISTS v1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 21 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode +trg1 INSERT t1 SET @a:=1 BEFORE NULL + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode +trg1 INSERT t1 SET @a:=1 BEFORE NULL + +######## DROP TRIGGER trg1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 22 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +DROP TRIGGER trg1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode + +######## CREATE USER user1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 23 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +CREATE USER user1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +######## RENAME USER user1@localhost TO rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 24 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +RENAME USER user1@localhost TO rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +######## DROP USER rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 25 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +DROP USER rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest3; diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index 60a00a7b1b4..d2a41a305b6 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -391,6 +391,113 @@ SHOW PROCEDURE STATUS LIKE 'p1'; connection master; --horizontal_results +############################################################### +# Cases with VIEWs +############################################################### +let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW CREATE VIEW v1; +connection master; + +let $my_stmt= ALTER VIEW v1 AS select f1 from t1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW CREATE VIEW v1; +connection master; + +let $my_stmt= DROP VIEW IF EXISTS v1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +--error 1146 +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +--error 1146 +SHOW CREATE VIEW v1; +connection master; + +############################################################### +# Cases with TRIGGERs +############################################################### +let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW TRIGGERS; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW TRIGGERS; +connection master; + +let $my_stmt= DROP TRIGGER trg1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW TRIGGERS; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW TRIGGERS; +connection master; + +############################################################### +# Cases with USERs +############################################################### +let $my_stmt= CREATE USER user1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'user1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'user1'; +connection master; + +let $my_stmt= RENAME USER user1@localhost TO rename1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'rename1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'rename1'; +connection master; + +let $my_stmt= DROP USER rename1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'rename1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'rename1'; +connection master; + ############################################################### # Cleanup ############################################################### diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b6f23e635c0..4d9fddec770 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3684,6 +3684,8 @@ end_with_restore_list: if (check_access(thd, INSERT_ACL, "mysql", 0, 1, 1, 0) && check_global_access(thd,CREATE_USER_ACL)) break; + if (end_active_trans(thd)) + goto error; if (!(res= mysql_create_user(thd, lex->users_list))) { if (mysql_bin_log.is_open()) @@ -3700,6 +3702,8 @@ end_with_restore_list: if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 1, 0) && check_global_access(thd,CREATE_USER_ACL)) break; + if (end_active_trans(thd)) + goto error; if (!(res= mysql_drop_user(thd, lex->users_list))) { if (mysql_bin_log.is_open()) @@ -3716,6 +3720,8 @@ end_with_restore_list: if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) && check_global_access(thd,CREATE_USER_ACL)) break; + if (end_active_trans(thd)) + goto error; if (!(res= mysql_rename_user(thd, lex->users_list))) { if (mysql_bin_log.is_open()) @@ -4510,6 +4516,9 @@ end_with_restore_list: } case SQLCOM_CREATE_VIEW: { + if (end_active_trans(thd)) + goto error; + if (!(res= mysql_create_view(thd, thd->lex->create_view_mode)) && mysql_bin_log.is_open()) { @@ -4557,6 +4566,9 @@ end_with_restore_list: } case SQLCOM_CREATE_TRIGGER: { + if (end_active_trans(thd)) + goto error; + res= mysql_create_or_drop_trigger(thd, all_tables, 1); /* We don't care about trigger body after this point */ @@ -4566,6 +4578,9 @@ end_with_restore_list: } case SQLCOM_DROP_TRIGGER: { + if (end_active_trans(thd)) + goto error; + res= mysql_create_or_drop_trigger(thd, all_tables, 0); break; } From cf987efb3596c4c8d91484f0255d1e19ba5715a2 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 13 Oct 2005 11:28:06 +0200 Subject: [PATCH 089/322] Updated after testing --- mysql-test/mysql-test-run.pl | 4 +- mysql-test/r/compress.result | 911 +++--------------------------- mysql-test/r/ssl.result | 911 +++--------------------------- mysql-test/r/ssl_compress.result | 914 +++---------------------------- mysql-test/t/compress.test | 10 +- mysql-test/t/ssl.test | 11 +- mysql-test/t/ssl_compress.test | 13 +- 7 files changed, 204 insertions(+), 2570 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 29b4a0a1ed6..8e7b0dd4cca 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1166,7 +1166,7 @@ sub check_ssl_support () { mtr_error("Couldn't find support for SSL"); return; } - mtr_report("Skipping SSL, mysqld does not support it"); + mtr_report("Skipping SSL, mysqld not compiled with SSL"); $opt_ssl_supported= 0; $opt_ssl= 0; return; @@ -1205,7 +1205,7 @@ sub check_ndbcluster_support () { "--help"], "", "/dev/null", "/dev/null", "") != 0 ) { - mtr_report("Skipping ndbcluster, mysqld does not support it"); + mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster"); $opt_with_ndbcluster= 0; return; } diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result index a86fb4e4745..efcafbbe736 100644 --- a/mysql-test/r/compress.result +++ b/mysql-test/r/compress.result @@ -2,8 +2,6 @@ SHOW STATUS LIKE 'Compression'; Variable_name Value Compression ON drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2094,855 +2092,68 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: 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 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index 5c8a7e91c71..bb7297d6807 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -2,8 +2,6 @@ SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2094,855 +2092,68 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: 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 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result index 574726640d4..9c1cf4b0ec3 100644 --- a/mysql-test/r/ssl_compress.result +++ b/mysql-test/r/ssl_compress.result @@ -5,8 +5,6 @@ SHOW STATUS LIKE 'Compression'; Variable_name Value Compression ON drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2097,855 +2095,71 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: 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 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test index fb1c8793f33..46244edd2a8 100644 --- a/mysql-test/t/compress.test +++ b/mysql-test/t/compress.test @@ -3,15 +3,13 @@ -- source include/have_compress.inc - -# Reconnect to turn compress on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,COMPRESS); +connect (comp_con,localhost,root,,,,,COMPRESS); # Check compression turned on SHOW STATUS LIKE 'Compression'; # Source select test case --- source t/select.test +-- source include/common-tests.inc +# Check compression turned on +SHOW STATUS LIKE 'Compression'; diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index 921b3262013..de88569d74a 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -3,16 +3,15 @@ -- source include/have_openssl.inc -# Reconnect to turn ssl on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,SSL); +connect (ssl_con,localhost,root,,,,,SSL); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; # Source select test case --- source t/select.test - +-- source include/common-tests.inc + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test index 2d40b85c33d..f5fe86e9a81 100644 --- a/mysql-test/t/ssl_compress.test +++ b/mysql-test/t/ssl_compress.test @@ -4,11 +4,7 @@ -- source include/have_openssl.inc -- source include/have_compress.inc - -# Reconnect to turn ssl and compress on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,SSL COMPRESS); +connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -17,5 +13,10 @@ SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Compression'; # Source select test case --- source t/select.test +-- source include/common-tests.inc +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Check compression turned on +SHOW STATUS LIKE 'Compression'; From 37aa6efd0a0f483b2a226ce633ecd0e39a6d9510 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 13 Oct 2005 14:55:56 +0400 Subject: [PATCH 090/322] A post-review fix (Bug#12736) --- sql/sql_select.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6b9836e8f09..ce8f9078ee1 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5718,6 +5718,7 @@ void JOIN_TAB::cleanup() end_read_record(&read_record); } + /* Partially cleanup JOIN after it has executed: close index or rnd read (table cursors), free quick selects. From 0ac493d16c03617d7bde630eda8a00ca32095d12 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 13 Oct 2005 13:37:10 +0200 Subject: [PATCH 091/322] Bug #12698 abnormal program termination running mysql_client_test - The testcase create a .frm file consisting of "junk". Unfortunately the "junk" wasn't written to the .frm file if mysql_client_test was run with -s option to make it run silent. This most likely caused the file never to be created on windows, and thus the test case failed. --- tests/mysql_client_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index eadbd37f8f6..6717e31c18f 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -6962,8 +6962,7 @@ static void test_frm_bug() fprintf(stdout, "\n test cancelled"); exit(1); } - if (!opt_silent) - fprintf(test_file, "this is a junk file for test"); + fprintf(test_file, "this is a junk file for test"); rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'"); myquery(rc); From b81f3ef1ef750f2ea5c4e4d71ced6c7429d5ab32 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 13 Oct 2005 15:52:22 +0200 Subject: [PATCH 092/322] Bug #12698 abnormal program termination running mysql_client_test - Move test for bug#93 from mysql_client_test.c to show_check.test - No need for test written in c --- mysql-test/r/show_check.result | 7 +++ mysql-test/t/show_check.test | 13 +++++ tests/mysql_client_test.c | 92 ---------------------------------- 3 files changed, 20 insertions(+), 92 deletions(-) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 1e5e8f442a8..9861daff409 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -513,3 +513,10 @@ t1 CREATE TABLE `t1` ( KEY `c2` USING BTREE (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +flush tables; +SHOW TABLE STATUS like 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm' +show create table t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index e6a404e3b57..d70903adbc4 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -378,4 +378,17 @@ create table t1 ( SHOW CREATE TABLE t1; DROP TABLE t1; +# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS + +flush tables; + +# Create a junk frm file on disk +system echo "this is a junk file for test" >> var/master-data/test/t1.frm ; +--replace_column 6 # 7 # 8 # 9 # +SHOW TABLE STATUS like 't1'; +--error 1033 +show create table t1; +drop table t1; + + # End of 4.1 tests diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 6717e31c18f..99d014107de 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -6899,97 +6899,6 @@ static void test_prepare_grant() } #endif /* EMBEDDED_LIBRARY */ -/* - Test a crash when invalid/corrupted .frm is used in the - SHOW TABLE STATUS - bug #93 (reported by serg@mysql.com). -*/ - -static void test_frm_bug() -{ - MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; - MYSQL_RES *result; - MYSQL_ROW row; - FILE *test_file; - char data_dir[FN_REFLEN]; - char test_frm[FN_REFLEN]; - int rc; - - myheader("test_frm_bug"); - - mysql_autocommit(mysql, TRUE); - - rc= mysql_query(mysql, "drop table if exists test_frm_bug"); - myquery(rc); - - rc= mysql_query(mysql, "flush tables"); - myquery(rc); - - stmt= mysql_simple_prepare(mysql, "show variables like 'datadir'"); - check_stmt(stmt); - - rc= mysql_stmt_execute(stmt); - check_execute(stmt, rc); - - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= data_dir; - bind[0].buffer_length= FN_REFLEN; - bind[0].is_null= 0; - bind[0].length= 0; - bind[1]= bind[0]; - - rc= mysql_stmt_bind_result(stmt, bind); - check_execute(stmt, rc); - - rc= mysql_stmt_fetch(stmt); - check_execute(stmt, rc); - - if (!opt_silent) - fprintf(stdout, "\n data directory: %s", data_dir); - - rc= mysql_stmt_fetch(stmt); - DIE_UNLESS(rc == MYSQL_NO_DATA); - - strxmov(test_frm, data_dir, "/", current_db, "/", "test_frm_bug.frm", NullS); - - if (!opt_silent) - fprintf(stdout, "\n test_frm: %s", test_frm); - - if (!(test_file= my_fopen(test_frm, (int) (O_RDWR | O_CREAT), MYF(MY_WME)))) - { - fprintf(stdout, "\n ERROR: my_fopen failed for '%s'", test_frm); - fprintf(stdout, "\n test cancelled"); - exit(1); - } - fprintf(test_file, "this is a junk file for test"); - - rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'"); - myquery(rc); - - result= mysql_store_result(mysql); - mytest(result);/* It can't be NULL */ - - rc= my_process_result_set(result); - DIE_UNLESS(rc == 1); - - mysql_data_seek(result, 0); - - row= mysql_fetch_row(result); - mytest(row); - - if (!opt_silent) - fprintf(stdout, "\n Comment: %s", row[17]); - DIE_UNLESS(row[17] != 0); - - mysql_free_result(result); - mysql_stmt_close(stmt); - - my_fclose(test_file, MYF(0)); - mysql_query(mysql, "drop table if exists test_frm_bug"); -} - - /* Test DECIMAL conversion */ static void test_decimal_bug() @@ -11975,7 +11884,6 @@ static struct my_tests_st my_tests[]= { #ifndef EMBEDDED_LIBRARY { "test_prepare_grant", test_prepare_grant }, #endif - { "test_frm_bug", test_frm_bug }, { "test_explain_bug", test_explain_bug }, { "test_decimal_bug", test_decimal_bug }, { "test_nstmts", test_nstmts }, From 39b0712cf76c1551ecbb4d051629fb76c72cf7df Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 19:16:19 +0500 Subject: [PATCH 093/322] type_binary.result, type_binary.test: new file mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh: Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding. Many files: Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes. Adding true BINARY/VARBINARY: new pad_char structure member. ctype-bin.c: Adding true BINARY/VARBINARY: new pad_char structure member. New strnxfrm, with two trailing length bytes. field.cc: Adding true BINARY/VARBINARY. --- include/m_ctype.h | 1 + mysql-test/r/alter_table.result | 2 +- mysql-test/r/binary.result | 2 +- mysql-test/r/cast.result | 2 +- mysql-test/r/ctype_cp1251.result | 2 +- mysql-test/r/ctype_many.result | 326 ++++++++++----------- mysql-test/r/federated.result | 4 +- mysql-test/r/func_in.result | 2 +- mysql-test/r/ndb_condition_pushdown.result | 2 +- mysql-test/r/ndb_types.result | 2 +- mysql-test/r/sp.result | 2 +- mysql-test/r/system_mysql_db.result | 2 +- mysql-test/r/type_binary.result | 113 +++++++ mysql-test/r/type_blob.result | 6 +- mysql-test/t/alter_table.test | 2 +- mysql-test/t/binary.test | 2 +- mysql-test/t/cast.test | 2 +- mysql-test/t/ctype_cp1251.test | 2 +- mysql-test/t/ctype_many.test | 4 +- mysql-test/t/federated.test | 4 +- mysql-test/t/func_in.test | 2 +- mysql-test/t/ndb_condition_pushdown.test | 2 +- mysql-test/t/ndb_types.test | 2 +- mysql-test/t/sp.test | 2 +- mysql-test/t/type_binary.test | 67 +++++ mysql-test/t/type_blob.test | 4 +- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- sql/field.cc | 3 +- strings/ctype-big5.c | 2 + strings/ctype-bin.c | 32 +- strings/ctype-cp932.c | 2 + strings/ctype-czech.c | 1 + strings/ctype-euc_kr.c | 2 + strings/ctype-eucjpms.c | 2 + strings/ctype-extra.c | 1 + strings/ctype-gb2312.c | 2 + strings/ctype-gbk.c | 2 + strings/ctype-latin1.c | 3 + strings/ctype-simple.c | 1 + strings/ctype-sjis.c | 2 + strings/ctype-tis620.c | 2 + strings/ctype-uca.c | 37 +++ strings/ctype-ucs2.c | 2 + strings/ctype-ujis.c | 2 + strings/ctype-utf8.c | 3 + strings/ctype-win1250ch.c | 1 + 47 files changed, 471 insertions(+), 198 deletions(-) create mode 100644 mysql-test/r/type_binary.result create mode 100644 mysql-test/t/type_binary.test diff --git a/include/m_ctype.h b/include/m_ctype.h index e0a26c4ce56..b7361cb7d7b 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -231,6 +231,7 @@ typedef struct charset_info_st uint mbmaxlen; uint16 min_sort_char; uint16 max_sort_char; /* For LIKE optimization */ + uchar pad_char; my_bool escape_with_backslash_is_dangerous; MY_CHARSET_HANDLER *cset; diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6a710a8de10..644d92b477e 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -436,7 +436,7 @@ alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; a hex(a) ÔÅÓÔ F2E5F1F2 -alter table t1 change a a binary(10); +alter table t1 change a a binary(4); select a,hex(a) from t1; a hex(a) òåñò F2E5F1F2 diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 5b5f673b071..a8d6c3bf411 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -85,7 +85,7 @@ NULL select b from t1 having binary b like ''; b drop table t1; -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(3) binary, b binary(3)); insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index fa8e810cf2b..9f79a15a181 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -231,7 +231,7 @@ t1 CREATE TABLE `t1` ( `c5` varchar(2) character set utf8 NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -create table t1 (a binary(10), b char(10) character set koi8r); +create table t1 (a binary(4), b char(4) character set koi8r); insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ'); select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; a b cast(a as char character set cp1251) cast(b as binary) diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index c65055e726d..47797af3cbe 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -23,7 +23,7 @@ a b c drop table t1; -create table t1 (a char(15) binary, b binary(15)) character set cp1251; +create table t1 (a char(3) binary, b binary(3)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 87b83acfe0f..125a3fc4286 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -340,7 +340,7 @@ CYR CAPIT SOFT SIGN CYR CAPIT E ü ü CYR CAPIT YU à à CYR CAPIT YA ñ ñ -ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default ''; +ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default ''; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f) @@ -1331,146 +1331,146 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; -SELECT * FROM t1; -comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f -LAT SMALL A a a a a -LAT SMALL B b b b b -LAT SMALL C c c c c -LAT SMALL D d d d d -LAT SMALL E e e e e -LAT SMALL F f f f f -LAT SMALL G g g g g -LAT SMALL H h h h h -LAT SMALL I i i i i -LAT SMALL J j j j j -LAT SMALL K k k k k -LAT SMALL L l l l l -LAT SMALL M m m m m -LAT SMALL N n n n n -LAT SMALL O o o o o -LAT SMALL P p p p p -LAT SMALL Q q q q q -LAT SMALL R r r r r -LAT SMALL S s s s s -LAT SMALL T t t t t -LAT SMALL U u u u u -LAT SMALL V v v v v -LAT SMALL W w w w w -LAT SMALL X x x x x -LAT SMALL Y y y y y -LAT SMALL Z z z z z -LAT CAPIT A A A A A -LAT CAPIT B B B B B -LAT CAPIT C C C C C -LAT CAPIT D D D D D -LAT CAPIT E E E E E -LAT CAPIT F F F F F -LAT CAPIT G G G G G -LAT CAPIT H H H H H -LAT CAPIT I I I I I -LAT CAPIT J J J J J -LAT CAPIT K K K K K -LAT CAPIT L L L L L -LAT CAPIT M M M M M -LAT CAPIT N N N N N -LAT CAPIT O O O O O -LAT CAPIT P P P P P -LAT CAPIT Q Q Q Q Q -LAT CAPIT R R R R R -LAT CAPIT S S S S S -LAT CAPIT T T T T T -LAT CAPIT U U U U U -LAT CAPIT V V V V V -LAT CAPIT W W W W W -LAT CAPIT X X X X X -LAT CAPIT Y Y Y Y Y -LAT CAPIT Z Z Z Z Z -CYR SMALL A а а Á а -CYR SMALL BE б б  б -CYR SMALL VE в в × Ð² -CYR SMALL GE г г Ç Ð³ -CYR SMALL DE д д Ä Ð´ -CYR SMALL IE е е Šе -CYR SMALL IO Ñ‘ Ñ‘ £ Ñ‘ -CYR SMALL ZHE ж ж Ö Ð¶ -CYR SMALL ZE з з Ú Ð· -CYR SMALL I и и É Ð¸ -CYR SMALL KA к к Ë Ðº -CYR SMALL EL л л Ì Ð» -CYR SMALL EM м м Í Ð¼ -CYR SMALL EN н н Πн -CYR SMALL O о о Ï Ð¾ -CYR SMALL PE п п Рп -CYR SMALL ER Ñ€ Ñ€ Ò Ñ€ -CYR SMALL ES Ñ Ñ Ó Ñ -CYR SMALL TE Ñ‚ Ñ‚ Ô Ñ‚ -CYR SMALL U у у Õ Ñƒ -CYR SMALL EF Ñ„ Ñ„ Æ Ñ„ -CYR SMALL HA Ñ… Ñ… È Ñ… -CYR SMALL TSE ц ц à ц -CYR SMALL CHE ч ч Þ Ñ‡ -CYR SMALL SHA ш ш Û Ñˆ -CYR SMALL SCHA щ щ Ý Ñ‰ -CYR SMALL HARD SIGN ÑŠ ÑŠ ß ÑŠ -CYR SMALL YERU Ñ‹ Ñ‹ Ù Ñ‹ -CYR SMALL SOFT SIGN ÑŒ ÑŒ Ø ÑŒ -CYR SMALL E Ñ Ñ Ü Ñ -CYR SMALL YU ÑŽ ÑŽ À ÑŽ -CYR SMALL YA Ñ Ñ Ñ Ñ -CYR CAPIT A Ð Ð á Ð -CYR CAPIT BE Б Б â Б -CYR CAPIT VE Ð’ Ð’ ÷ Ð’ -CYR CAPIT GE Г Г ç Г -CYR CAPIT DE Д Д ä Д -CYR CAPIT IE Е Е å Е -CYR CAPIT IO Ð Ð ³ Ð -CYR CAPIT ZHE Ж Ж ö Ж -CYR CAPIT ZE З З ú З -CYR CAPIT I И И é И -CYR CAPIT KA К К ë К -CYR CAPIT EL Л Л ì Л -CYR CAPIT EM М М í М -CYR CAPIT EN Ð Ð î Ð -CYR CAPIT O О О ï О -CYR CAPIT PE П П ð П -CYR CAPIT ER Р Р ò Р -CYR CAPIT ES С С ó С -CYR CAPIT TE Т Т ô Т -CYR CAPIT U У У õ У -CYR CAPIT EF Ф Ф æ Ф -CYR CAPIT HA Ð¥ Ð¥ è Ð¥ -CYR CAPIT TSE Ц Ц ã Ц -CYR CAPIT CHE Ч Ч þ Ч -CYR CAPIT SHA Ш Ш û Ш -CYR CAPIT SCHA Щ Щ ý Щ -CYR CAPIT HARD SIGN Ъ Ъ ÿ Ъ -CYR CAPIT YERU Ы Ы ù Ы -CYR CAPIT SOFT SIGN Ь Ь ø Ь -CYR CAPIT E Э Э ü Э -CYR CAPIT YU Ю Ю à Ю -CYR CAPIT YA Я Я ñ Я -GREEK CAPIT ALPHA Α Α Α -GREEK CAPIT BETA Î’ Î’ Î’ -GREEK CAPIT GAMMA Γ Γ Γ -GREEK CAPIT DELTA Δ Δ Δ -GREEK CAPIT EPSILON Ε Ε Ε -GREEK SMALL ALPHA α α α -GREEK SMALL BETA β β β -GREEK SMALL GAMMA γ γ γ -GREEK SMALL DELTA δ δ δ -GREEK SMALL EPSILON ε ε ε -ARMENIAN CAPIT AYB Ô± Ô± Ô± -ARMENIAN CAPIT BEN Ô² Ô² Ô² -ARMENIAN CAPIT GIM Ô³ Ô³ Ô³ -ARMENIAN CAPIT DA Ô´ Ô´ Ô´ -ARMENIAN CAPIT ECH Ôµ Ôµ Ôµ -ARMENIAN CAPIT ZA Ô¶ Ô¶ Ô¶ -ARMENIAN SMALL YAB Õ¡ Õ¡ Õ¡ -ARMENIAN SMALL BEN Õ¢ Õ¢ Õ¢ -ARMENIAN SMALL GIM Õ£ Õ£ Õ£ -ARMENIAN SMALL DA Õ¤ Õ¤ Õ¤ -ARMENIAN SMALL ECH Õ¥ Õ¥ Õ¥ -ARMENIAN SMALL ZA Õ¦ Õ¦ Õ¦ +SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1; +comment koi8_ru_f utf8_f hex(bin_f) ucs2_f armscii8_f greek_f +LAT SMALL A a a 61 a +LAT SMALL B b b 62 b +LAT SMALL C c c 63 c +LAT SMALL D d d 64 d +LAT SMALL E e e 65 e +LAT SMALL F f f 66 f +LAT SMALL G g g 67 g +LAT SMALL H h h 68 h +LAT SMALL I i i 69 i +LAT SMALL J j j 6A j +LAT SMALL K k k 6B k +LAT SMALL L l l 6C l +LAT SMALL M m m 6D m +LAT SMALL N n n 6E n +LAT SMALL O o o 6F o +LAT SMALL P p p 70 p +LAT SMALL Q q q 71 q +LAT SMALL R r r 72 r +LAT SMALL S s s 73 s +LAT SMALL T t t 74 t +LAT SMALL U u u 75 u +LAT SMALL V v v 76 v +LAT SMALL W w w 77 w +LAT SMALL X x x 78 x +LAT SMALL Y y y 79 y +LAT SMALL Z z z 7A z +LAT CAPIT A A A 41 A +LAT CAPIT B B B 42 B +LAT CAPIT C C C 43 C +LAT CAPIT D D D 44 D +LAT CAPIT E E E 45 E +LAT CAPIT F F F 46 F +LAT CAPIT G G G 47 G +LAT CAPIT H H H 48 H +LAT CAPIT I I I 49 I +LAT CAPIT J J J 4A J +LAT CAPIT K K K 4B K +LAT CAPIT L L L 4C L +LAT CAPIT M M M 4D M +LAT CAPIT N N N 4E N +LAT CAPIT O O O 4F O +LAT CAPIT P P P 50 P +LAT CAPIT Q Q Q 51 Q +LAT CAPIT R R R 52 R +LAT CAPIT S S S 53 S +LAT CAPIT T T T 54 T +LAT CAPIT U U U 55 U +LAT CAPIT V V V 56 V +LAT CAPIT W W W 57 W +LAT CAPIT X X X 58 X +LAT CAPIT Y Y Y 59 Y +LAT CAPIT Z Z Z 5A Z +CYR SMALL A а а C1 а +CYR SMALL BE б б C2 б +CYR SMALL VE в в D7 в +CYR SMALL GE г г C7 г +CYR SMALL DE д д C4 д +CYR SMALL IE е е C5 е +CYR SMALL IO Ñ‘ Ñ‘ A3 Ñ‘ +CYR SMALL ZHE ж ж D6 ж +CYR SMALL ZE з з DA з +CYR SMALL I и и C9 и +CYR SMALL KA к к CB к +CYR SMALL EL л л CC л +CYR SMALL EM м м CD м +CYR SMALL EN н н CE н +CYR SMALL O о о CF о +CYR SMALL PE п п D0 п +CYR SMALL ER Ñ€ Ñ€ D2 Ñ€ +CYR SMALL ES Ñ Ñ D3 Ñ +CYR SMALL TE Ñ‚ Ñ‚ D4 Ñ‚ +CYR SMALL U у у D5 у +CYR SMALL EF Ñ„ Ñ„ C6 Ñ„ +CYR SMALL HA Ñ… Ñ… C8 Ñ… +CYR SMALL TSE ц ц C3 ц +CYR SMALL CHE ч ч DE ч +CYR SMALL SHA ш ш DB ш +CYR SMALL SCHA щ щ DD щ +CYR SMALL HARD SIGN ÑŠ ÑŠ DF ÑŠ +CYR SMALL YERU Ñ‹ Ñ‹ D9 Ñ‹ +CYR SMALL SOFT SIGN ÑŒ ÑŒ D8 ÑŒ +CYR SMALL E Ñ Ñ DC Ñ +CYR SMALL YU ÑŽ ÑŽ C0 ÑŽ +CYR SMALL YA Ñ Ñ D1 Ñ +CYR CAPIT A Ð Ð E1 Ð +CYR CAPIT BE Б Б E2 Б +CYR CAPIT VE Ð’ Ð’ F7 Ð’ +CYR CAPIT GE Г Г E7 Г +CYR CAPIT DE Д Д E4 Д +CYR CAPIT IE Е Е E5 Е +CYR CAPIT IO Ð Ð B3 Ð +CYR CAPIT ZHE Ж Ж F6 Ж +CYR CAPIT ZE З З FA З +CYR CAPIT I И И E9 И +CYR CAPIT KA К К EB К +CYR CAPIT EL Л Л EC Л +CYR CAPIT EM М М ED М +CYR CAPIT EN Ð Ð EE Ð +CYR CAPIT O О О EF О +CYR CAPIT PE П П F0 П +CYR CAPIT ER Р Р F2 Р +CYR CAPIT ES С С F3 С +CYR CAPIT TE Т Т F4 Т +CYR CAPIT U У У F5 У +CYR CAPIT EF Ф Ф E6 Ф +CYR CAPIT HA Ð¥ Ð¥ E8 Ð¥ +CYR CAPIT TSE Ц Ц E3 Ц +CYR CAPIT CHE Ч Ч FE Ч +CYR CAPIT SHA Ш Ш FB Ш +CYR CAPIT SCHA Щ Щ FD Щ +CYR CAPIT HARD SIGN Ъ Ъ FF Ъ +CYR CAPIT YERU Ы Ы F9 Ы +CYR CAPIT SOFT SIGN Ь Ь F8 Ь +CYR CAPIT E Э Э FC Э +CYR CAPIT YU Ю Ю E0 Ю +CYR CAPIT YA Я Я F1 Я +GREEK CAPIT ALPHA Α 00 Α Α +GREEK CAPIT BETA Î’ 00 Î’ Î’ +GREEK CAPIT GAMMA Γ 00 Γ Γ +GREEK CAPIT DELTA Δ 00 Δ Δ +GREEK CAPIT EPSILON Ε 00 Ε Ε +GREEK SMALL ALPHA α 00 α α +GREEK SMALL BETA β 00 β β +GREEK SMALL GAMMA γ 00 γ γ +GREEK SMALL DELTA δ 00 δ δ +GREEK SMALL EPSILON ε 00 ε ε +ARMENIAN CAPIT AYB Ô± 00 Ô± Ô± +ARMENIAN CAPIT BEN Ô² 00 Ô² Ô² +ARMENIAN CAPIT GIM Ô³ 00 Ô³ Ô³ +ARMENIAN CAPIT DA Ô´ 00 Ô´ Ô´ +ARMENIAN CAPIT ECH Ôµ 00 Ôµ Ôµ +ARMENIAN CAPIT ZA Ô¶ 00 Ô¶ Ô¶ +ARMENIAN SMALL YAB Õ¡ 00 Õ¡ Õ¡ +ARMENIAN SMALL BEN Õ¢ 00 Õ¢ Õ¢ +ARMENIAN SMALL GIM Õ£ 00 Õ£ Õ£ +ARMENIAN SMALL DA Õ¤ 00 Õ¤ Õ¤ +ARMENIAN SMALL ECH Õ¥ 00 Õ¥ Õ¥ +ARMENIAN SMALL ZA Õ¦ 00 Õ¦ Õ¦ SET CHARACTER SET 'binary'; SELECT * FROM t1; comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f @@ -1590,28 +1590,28 @@ CYR CAPIT SOFT SIGN CYR CAPIT E ü Э ü - CYR CAPIT YU à Ю à . CYR CAPIT YA ñ Я ñ / -GREEK CAPIT ALPHA Α ‘ Á -GREEK CAPIT BETA Î’ ’  -GREEK CAPIT GAMMA Γ “ à -GREEK CAPIT DELTA Δ ” Ä -GREEK CAPIT EPSILON Ε • Å -GREEK SMALL ALPHA α ± á -GREEK SMALL BETA β ² â -GREEK SMALL GAMMA γ ³ ã -GREEK SMALL DELTA δ ´ ä -GREEK SMALL EPSILON ε µ å -ARMENIAN CAPIT AYB Ô± 1 ² -ARMENIAN CAPIT BEN Ô² 2 ´ -ARMENIAN CAPIT GIM Ô³ 3 ¶ -ARMENIAN CAPIT DA Ô´ 4 ¸ -ARMENIAN CAPIT ECH Ôµ 5 º -ARMENIAN CAPIT ZA Ô¶ 6 ¼ -ARMENIAN SMALL YAB Õ¡ a ³ -ARMENIAN SMALL BEN Õ¢ b µ -ARMENIAN SMALL GIM Õ£ c · -ARMENIAN SMALL DA Õ¤ d ¹ -ARMENIAN SMALL ECH Õ¥ e » -ARMENIAN SMALL ZA Õ¦ f ½ +GREEK CAPIT ALPHA Α ‘ Á +GREEK CAPIT BETA Î’ ’  +GREEK CAPIT GAMMA Γ “ à +GREEK CAPIT DELTA Δ ” Ä +GREEK CAPIT EPSILON Ε • Å +GREEK SMALL ALPHA α ± á +GREEK SMALL BETA β ² â +GREEK SMALL GAMMA γ ³ ã +GREEK SMALL DELTA δ ´ ä +GREEK SMALL EPSILON ε µ å +ARMENIAN CAPIT AYB Ô± 1 ² +ARMENIAN CAPIT BEN Ô² 2 ´ +ARMENIAN CAPIT GIM Ô³ 3 ¶ +ARMENIAN CAPIT DA Ô´ 4 ¸ +ARMENIAN CAPIT ECH Ôµ 5 º +ARMENIAN CAPIT ZA Ô¶ 6 ¼ +ARMENIAN SMALL YAB Õ¡ a ³ +ARMENIAN SMALL BEN Õ¢ b µ +ARMENIAN SMALL GIM Õ£ c · +ARMENIAN SMALL DA Õ¤ d ¹ +ARMENIAN SMALL ECH Õ¥ e » +ARMENIAN SMALL ZA Õ¦ f ½ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; min(comment) count(*) LAT CAPIT A 2 diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index e0e0bba3271..b5a1016987e 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -504,7 +504,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', -`bincol` binary(4) NOT NULL, +`bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), @@ -515,7 +515,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', -`bincol` binary(4) NOT NULL, +`bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 8562937f1ac..60022ae0d8f 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -187,7 +187,7 @@ select 1 in ('1.1',2); select 1 in ('1.1',2.0); 1 in ('1.1',2.0) 0 -create table t1 (a char(20) character set binary); +create table t1 (a char(2) character set binary); insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); a diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 1c3da1b486f..3e46a487c07 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -3,7 +3,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10), vstring varchar(10), -bin binary(7), +bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/r/ndb_types.result b/mysql-test/r/ndb_types.result index 37ce7732f65..6938277f01d 100644 --- a/mysql-test/r/ndb_types.result +++ b/mysql-test/r/ndb_types.result @@ -3,7 +3,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", vstring varchar(10) default "hello", -bin binary(7), +bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1b8cde6d3db..e3e379ac65d 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1916,7 +1916,7 @@ select bug3788()| bug3788() 2005-03-04 drop function bug3788| -create function bug3788() returns binary(5) return 5| +create function bug3788() returns binary(1) return 5| select bug3788()| bug3788() 5 diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index f68c4805d72..999f12a0573 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -73,7 +73,7 @@ Table Create Table user CREATE TABLE `user` ( `Host` char(60) collate utf8_bin NOT NULL default '', `User` char(16) collate utf8_bin NOT NULL default '', - `Password` binary(41) NOT NULL default '', + `Password` char(41) character set latin1 collate latin1_bin NOT NULL default '', `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result new file mode 100644 index 00000000000..49fd7ba5633 --- /dev/null +++ b/mysql-test/r/type_binary.result @@ -0,0 +1,113 @@ +create table t1 (s1 binary(3)); +insert into t1 values (0x61), (0x6120), (0x612020); +select hex(s1) from t1; +hex(s1) +610000 +612000 +612020 +drop table t1; +create table t1 (s1 binary(2), s2 varbinary(2)); +insert into t1 values (0x4100,0x4100); +select length(concat('*',s1,'*',s2,'*')) from t1; +length(concat('*',s1,'*',s2,'*')) +7 +delete from t1; +insert into t1 values (0x4120,0x4120); +select length(concat('*',s1,'*',s2,'*')) from t1; +length(concat('*',s1,'*',s2,'*')) +7 +drop table t1; +create table t1 (s1 varbinary(20), s2 varbinary(20)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varbinary(20) default NULL, + `s2` varbinary(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120); +select hex(s1), hex(s2) from t1; +hex(s1) hex(s2) +41 4100 +41 4120 +4100 4120 +select count(*) from t1 where s1 < s2; +count(*) +3 +drop table t1; +create table t1 (s1 varbinary(2), s2 varchar(1)); +insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d'); +select hex(s1),s2 from t1 order by s1,s2; +hex(s1) s2 +41 a +41 c +4100 b +4100 d +drop table t1; +create table t1 (s1 binary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +ERROR 23000: Duplicate entry '' for key 1 +select hex(s1) from t1 order by s1; +hex(s1) +0100 +0120 +select hex(s1) from t1 where s1=0x01; +hex(s1) +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +2 +alter table t1 drop primary key; +select hex(s1) from t1 where s1=0x01; +hex(s1) +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +2 +drop table t1; +create table t1 (s1 varbinary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +hex(s1) +01 +0100 +0120 +select hex(s1) from t1 where s1=0x01; +hex(s1) +01 +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +3 +alter table t1 drop primary key; +select hex(s1) from t1 where s1=0x01; +hex(s1) +01 +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +3 +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 193ed298339..fd478c916c9 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -67,7 +67,7 @@ select * from t1; a Where drop table t1; -create table t1 (t text,c char(10),b blob, d binary(10)); +create table t1 (t text,c char(10),b blob, d varbinary(10)); insert into t1 values (NULL,NULL,NULL,NULL); insert into t1 values ("","","",""); insert into t1 values ("hello","hello","hello","hello"); @@ -83,14 +83,14 @@ Field Type Collation Null Key Default Extra Privileges Comment t text latin1_swedish_ci YES NULL # c char(10) latin1_swedish_ci YES NULL # b blob NULL YES NULL # -d binary(10) NULL YES NULL # +d varbinary(10) NULL YES NULL # lock tables t1 WRITE; show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment t text latin1_swedish_ci YES NULL # c char(10) latin1_swedish_ci YES NULL # b blob NULL YES NULL # -d binary(10) NULL YES NULL # +d varbinary(10) NULL YES NULL # unlock tables; select t from t1 where t like "hello"; t diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5695822be6b..bc3a4b0261d 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -278,7 +278,7 @@ insert into t1 values (' select a,hex(a) from t1; alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; -alter table t1 change a a binary(10); +alter table t1 change a a binary(4); select a,hex(a) from t1; alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 02773b32302..1ac0cfebb28 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -56,7 +56,7 @@ drop table t1; # # Test of binary and upper/lower # -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(3) binary, b binary(3)); insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; select lower(a),lower(b) from t1; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 6220b4cbae7..ca16791d9af 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -101,7 +101,7 @@ drop table t1; # Bug 2202 # CAST from BINARY to non-BINARY and from non-BINARY to BINARY # -create table t1 (a binary(10), b char(10) character set koi8r); +create table t1 (a binary(4), b char(4) character set koi8r); insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ'); select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; set names koi8r; diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 1aafe7b7266..463a9cea4bc 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -21,7 +21,7 @@ drop table t1; # # Test of binary and upper/lower # -create table t1 (a char(15) binary, b binary(15)) character set cp1251; +create table t1 (a char(3) binary, b binary(3)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; select lower(a),lower(b) from t1; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 22e844c6868..0903c3dd7fa 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -148,7 +148,7 @@ SET CHARACTER SET koi8r; SELECT * FROM t1; -ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default ''; +ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default ''; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; @@ -204,7 +204,7 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; -SELECT * FROM t1; +SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1; SET CHARACTER SET 'binary'; SELECT * FROM t1; SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index c401468a940..43679c54caf 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -348,7 +348,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(4) NOT NULL, + `bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), @@ -363,7 +363,7 @@ DROP TABLE IF EXISTS federated.t1; eval CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(4) NOT NULL, + `bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index dd4edd8ca48..0472968f918 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -97,7 +97,7 @@ select 1 in ('1.1',2.0); # Test case for bug #6365 -create table t1 (a char(20) character set binary); +create table t1 (a char(2) character set binary); insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test index d090d12e81b..9f512430085 100644 --- a/mysql-test/t/ndb_condition_pushdown.test +++ b/mysql-test/t/ndb_condition_pushdown.test @@ -12,7 +12,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10), vstring varchar(10), - bin binary(7), + bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test index 3446a409b2a..10b8eb87e2c 100644 --- a/mysql-test/t/ndb_types.test +++ b/mysql-test/t/ndb_types.test @@ -12,7 +12,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", vstring varchar(10) default "hello", - bin binary(7), + bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index e16e7456056..1f4d5b6bad5 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -2431,7 +2431,7 @@ create function bug3788() returns date return cast("2005-03-04" as date)| select bug3788()| drop function bug3788| -create function bug3788() returns binary(5) return 5| +create function bug3788() returns binary(1) return 5| select bug3788()| drop function bug3788| diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test new file mode 100644 index 00000000000..b5928cb14c4 --- /dev/null +++ b/mysql-test/t/type_binary.test @@ -0,0 +1,67 @@ +# check 0x00 padding +create table t1 (s1 binary(3)); +insert into t1 values (0x61), (0x6120), (0x612020); +select hex(s1) from t1; +drop table t1; + +# check that 0x00 is not stripped in val_str +create table t1 (s1 binary(2), s2 varbinary(2)); +insert into t1 values (0x4100,0x4100); +select length(concat('*',s1,'*',s2,'*')) from t1; +delete from t1; +insert into t1 values (0x4120,0x4120); +select length(concat('*',s1,'*',s2,'*')) from t1; +drop table t1; + +# check that trailing 0x00 and 0x20 do matter on comparison +create table t1 (s1 varbinary(20), s2 varbinary(20)); +show create table t1; +insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120); +select hex(s1), hex(s2) from t1; +select count(*) from t1 where s1 < s2; +drop table t1; + +# check that trailing 0x00 do matter on filesort +create table t1 (s1 varbinary(2), s2 varchar(1)); +insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d'); +select hex(s1),s2 from t1 order by s1,s2; +drop table t1; + +# check that 0x01 is padded to 0x0100 and thus we get a duplicate value +create table t1 (s1 binary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +--error 1062 +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +# check index search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +alter table t1 drop primary key; +# check non-indexed search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +drop table t1; + +# check that 0x01 is not padded, and all three values are unique +create table t1 (s1 varbinary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +# check index search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +alter table t1 drop primary key; +# check non-indexed search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 1ec5c600296..4f3c02b0465 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -67,9 +67,9 @@ select * from t1; drop table t1; # -# test of blob, text, char and char binary +# test of blob, text, char and varbinary # -create table t1 (t text,c char(10),b blob, d binary(10)); +create table t1 (t text,c char(10),b blob, d varbinary(10)); insert into t1 values (NULL,NULL,NULL,NULL); insert into t1 values ("","","",""); insert into t1 values ("hello","hello","hello","hello"); diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index babf3a1c83f..54f0ef230ad 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -123,7 +123,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password binary(41) DEFAULT '' NOT NULL," + c_u="$c_u Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 7dba854e313..d1b0c35266e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -158,7 +158,7 @@ ALTER TABLE user MODIFY User char(16) NOT NULL default '', ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user - MODIFY Password binary(41) NOT NULL default '', + MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, diff --git a/sql/field.cc b/sql/field.cc index eeff2ec9881..7e3cd004dc2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5881,7 +5881,8 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) memcpy(ptr,from,copy_length); if (copy_length < field_length) // Append spaces if shorter field_charset->cset->fill(field_charset,ptr+copy_length, - field_length-copy_length,' '); + field_length-copy_length, + field_charset->pad_char); if ((copy_length < length) && table->in_use->count_cuted_fields) { // Check if we loosed some info diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 8b50388e4ef..4455025d7a5 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6398,6 +6398,7 @@ CHARSET_INFO my_charset_big5_chinese_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_big5_handler, &my_collation_big5_chinese_ci_handler @@ -6430,6 +6431,7 @@ CHARSET_INFO my_charset_big5_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_big5_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 0fcd9021c4b..a931c6412b3 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -86,6 +86,14 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), } +uint my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr __attribute__((unused)), + uint length) +{ + return length; +} + + /* Compare two strings. Result is sign(first_argument - second_argument) @@ -365,14 +373,29 @@ static int my_wildcmp_bin(CHARSET_INFO *cs, } +uint my_strnxfrmlen_bin(CHARSET_INFO *cs __attribute__((unused)), uint len) +{ + return len + 2; +} + + static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint dstlen, const uchar *src, uint srclen) { if (dest != src) memcpy(dest, src, min(dstlen,srclen)); - if (dstlen > srclen) + + if (dstlen >= srclen + 2) + { + if (dstlen > srclen + 2) + bfill(dest + srclen, dstlen - srclen - 2, 0); + dest[dstlen-2]= srclen >> 8; + dest[dstlen-1]= srclen & 0xFF; + } + else if (dstlen > srclen) bfill(dest + srclen, dstlen - srclen, 0); + return dstlen; } @@ -473,7 +496,7 @@ static MY_COLLATION_HANDLER my_collation_binary_handler = my_strnncoll_binary, my_strnncollsp_binary, my_strnxfrm_bin, - my_strnxfrmlen_simple, + my_strnxfrmlen_bin, my_like_range_simple, my_wildcmp_bin, my_strcasecmp_bin, @@ -491,7 +514,7 @@ static MY_CHARSET_HANDLER my_charset_handler= my_numchars_8bit, my_charpos_8bit, my_well_formed_len_8bit, - my_lengthsp_8bit, + my_lengthsp_binary, my_numcells_8bit, my_mb_wc_bin, my_wc_mb_bin, @@ -516,7 +539,7 @@ static MY_CHARSET_HANDLER my_charset_handler= CHARSET_INFO my_charset_bin = { 63,0,0, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY|MY_CS_STRNXFRM,/* state */ "binary", /* cs name */ "binary", /* name */ "", /* comment */ @@ -539,6 +562,7 @@ CHARSET_INFO my_charset_bin = 1, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + 0, /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_binary_handler diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index b5f36c030bd..9f75757379d 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -5522,6 +5522,7 @@ CHARSET_INFO my_charset_cp932_japanese_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 1, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -5553,6 +5554,7 @@ CHARSET_INFO my_charset_cp932_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 1, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index bdafc5c94b6..fa3a3bf53fe 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -628,6 +628,7 @@ CHARSET_INFO my_charset_latin2_czech_ci = 1, /* mbmaxlen */ 0, /* min_sort_char */ 0, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_8bit_handler, &my_collation_latin2_czech_ci_handler diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index b529bbb0308..97fea517c1b 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8706,6 +8706,7 @@ CHARSET_INFO my_charset_euckr_korean_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -8738,6 +8739,7 @@ CHARSET_INFO my_charset_euckr_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index ccdca2ba595..f9210fcb10e 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -8708,6 +8708,7 @@ CHARSET_INFO my_charset_eucjpms_japanese_ci= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad_char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -8740,6 +8741,7 @@ CHARSET_INFO my_charset_eucjpms_bin= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad_char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index e9a9598abdf..9fa4873c5d3 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -43,6 +43,7 @@ CHARSET_INFO compiled_charsets[] = { 0, /* mbmaxlen */ 0, /* min_sort_ord */ 0, /* max_sort_ord */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ NULL, /* cset handler */ NULL /* coll handler */ diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 3d9a17205cd..f5d9b2627cd 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5757,6 +5757,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -5788,6 +5789,7 @@ CHARSET_INFO my_charset_gb2312_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index e3a76359eaa..edc595875d7 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -10045,6 +10045,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -10076,6 +10077,7 @@ CHARSET_INFO my_charset_gbk_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 9075710610b..1e442d7a26c 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -441,6 +441,7 @@ CHARSET_INFO my_charset_latin1= 1, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_8bit_simple_ci_handler @@ -740,6 +741,7 @@ CHARSET_INFO my_charset_latin1_german2_ci= 1, /* mbmaxlen */ 0, /* min_sort_char */ 247, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_german2_ci_handler @@ -772,6 +774,7 @@ CHARSET_INFO my_charset_latin1_bin= 1, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_8bit_bin_handler diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index d25b9e4d9cf..f6ac740730b 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1316,6 +1316,7 @@ static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint)) { cs->caseup_multiply= 1; cs->casedn_multiply= 1; + cs->pad_char= ' '; return create_fromuni(cs, alloc); } diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 2ed21a40edd..398aea08b05 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4693,6 +4693,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -4724,6 +4725,7 @@ CHARSET_INFO my_charset_sjis_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 762f6d2dfb6..5a5f034b8da 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -922,6 +922,7 @@ CHARSET_INFO my_charset_tis620_thai_ci= 1, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -953,6 +954,7 @@ CHARSET_INFO my_charset_tis620_bin= 1, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_8bit_bin_handler diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index a280ed59352..4768e42a0b0 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7954,6 +7954,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(uint)) { + cs->pad_char= ' '; return create_tailoring(cs, alloc); } @@ -8071,6 +8072,7 @@ CHARSET_INFO my_charset_ucs2_general_uca= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8102,6 +8104,7 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8133,6 +8136,7 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8164,6 +8168,7 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8195,6 +8200,7 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8226,6 +8232,7 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8257,6 +8264,7 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8288,6 +8296,7 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8319,6 +8328,7 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8350,6 +8360,7 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8381,6 +8392,7 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8413,6 +8425,7 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8444,6 +8457,7 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8475,6 +8489,7 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8506,6 +8521,7 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8538,6 +8554,7 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8570,6 +8587,7 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8602,6 +8620,7 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= 2, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_uca_handler @@ -8681,6 +8700,7 @@ CHARSET_INFO my_charset_utf8_general_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8713,6 +8733,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8744,6 +8765,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8775,6 +8797,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8806,6 +8829,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8837,6 +8861,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8868,6 +8893,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8899,6 +8925,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8930,6 +8957,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8961,6 +8989,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -8992,6 +9021,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9024,6 +9054,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9055,6 +9086,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9086,6 +9118,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9117,6 +9150,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9148,6 +9182,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9179,6 +9214,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler @@ -9210,6 +9246,7 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci= 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_any_uca_handler diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index c389f2e7f75..b0d882d3943 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1623,6 +1623,7 @@ CHARSET_INFO my_charset_ucs2_general_ci= 2, /* mbmaxlen */ 0, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_general_ci_handler @@ -1654,6 +1655,7 @@ CHARSET_INFO my_charset_ucs2_bin= 2, /* mbmaxlen */ 0, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_ucs2_handler, &my_collation_ucs2_bin_handler diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 57ca2de2852..696eecaa794 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8576,6 +8576,7 @@ CHARSET_INFO my_charset_ujis_japanese_ci= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_ci_handler @@ -8608,6 +8609,7 @@ CHARSET_INFO my_charset_ujis_bin= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_handler, &my_collation_mb_bin_handler diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 88b6b7d5c86..e1bb746fd9a 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2579,6 +2579,7 @@ CHARSET_INFO my_charset_utf8_general_ci= 3, /* mbmaxlen */ 0, /* min_sort_char */ 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_ci_handler @@ -2611,6 +2612,7 @@ CHARSET_INFO my_charset_utf8_bin= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_mb_bin_handler @@ -2781,6 +2783,7 @@ CHARSET_INFO my_charset_utf8_general_cs= 3, /* mbmaxlen */ 0, /* min_sort_char */ 255, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_utf8_handler, &my_collation_cs_handler diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index c6b396658d4..16b8ce5aac4 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -662,6 +662,7 @@ CHARSET_INFO my_charset_cp1250_czech_ci = 1, /* mbmaxlen */ 0, /* min_sort_char */ 0, /* max_sort_char */ + ' ', /* pad char */ 0, /* escape_with_backslash_is_dangerous */ &my_charset_8bit_handler, &my_collation_czech_ci_handler From 5dad17161862f10f41e29d22cc362216c906e44a Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 13 Oct 2005 17:21:14 +0300 Subject: [PATCH 094/322] Some Netware related fixes and fixes for Metrowerks compiler. --- netware/BUILD/mwenv | 4 ++-- netware/pack_isam.def | 1 + scripts/make_binary_distribution.sh | 3 +-- strings/my_strtoll10.c | 9 +++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index 0acfd3aaf8f..0b3fa9beb6a 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='-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='-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=: diff --git a/netware/pack_isam.def b/netware/pack_isam.def index b93cfdffbeb..fff74806f39 100644 --- a/netware/pack_isam.def +++ b/netware/pack_isam.def @@ -4,6 +4,7 @@ MODULE libc.nlm COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Pack Tool" +SCREENNAME "MySQL ISAM Table Pack Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d622dfed9d3..c00ba1c6f57 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -254,8 +254,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ > $BASE/bin/test_db.sql -# cp ./netware/static_init_db.sql ./netware/init_db.sql -# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 5217564087c..9cfb11524c1 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -19,7 +19,16 @@ #include #undef ULONGLONG_MAX +/* + Needed under MetroWerks Compiler, since MetroWerks compiler does not + properly handle a constant expression containing a mod operator +*/ +#if defined(__NETWARE__) && defined(__MWERKS__) +static ulonglong ulonglong_max= ~(ulonglong) 0; +#define ULONGLONG_MAX ulonglong_max +#else #define ULONGLONG_MAX (~(ulonglong) 0) +#endif /* __NETWARE__ && __MWERKS__ */ #define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) #define INIT_CNT 9 #define LFACTOR ULL(1000000000) From c933505d2da835169be6a5c80cffd2c2b1aa377c Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Thu, 13 Oct 2005 19:23:52 +0500 Subject: [PATCH 095/322] Fix for bug #3874 (Group by field is not considered) --- mysql-test/r/select.result | 36 ++++++++++++++++++++++++++++++++++++ mysql-test/t/select.test | 21 +++++++++++++++++++++ sql/sql_select.cc | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 299e0b6bf33..11a50d6cabc 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2441,3 +2441,39 @@ a c SELECT a, b AS c FROM t1 ORDER BY b+1; a c drop table t1; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), +(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +1 10 2 +1 11 2 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +1 10 2 +1 11 2 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 2adf4f1749c..2607a00bed4 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1992,3 +1992,24 @@ CREATE TABLE t1 (a INT, b INT); SELECT a, b AS c FROM t1 ORDER BY c+1; SELECT a, b AS c FROM t1 ORDER BY b+1; drop table t1; + +# +# Bug #3874 (function in GROUP and LEFT JOIN) +# + +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), + (1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +DROP TABLE IF EXISTS t1, t2; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5292a1fc0e0..7c2c233d754 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3115,7 +3115,7 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab) tab->cached_eq_ref_table=1; if (tab->type == JT_CONST) // We can skip const tables return (tab->eq_ref_table=1); /* purecov: inspected */ - if (tab->type != JT_EQ_REF) + if (tab->type != JT_EQ_REF || tab->table->maybe_null) return (tab->eq_ref_table=0); // We must use this Item **ref_item=tab->ref.items; Item **end=ref_item+tab->ref.key_parts; From 7c81d7fc6928f47be54cdf58d0e6d0a3f3c39260 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 19:24:47 +0500 Subject: [PATCH 096/322] ctype_utf8.result, ctype_utf8.test: New syntax: CHAR(x USING charset) Adding test case. sql_yacc.yy: New syntax: CHAR(x USING charset) Adding new parser rule. item_strfunc.h: New syntax: CHAR(x USING charset) Adding a new constructor. --- mysql-test/r/ctype_utf8.result | 72 +++++++++++++++++++--------------- mysql-test/t/ctype_utf8.test | 34 ++++++++++------ sql/item_strfunc.h | 9 +++-- sql/sql_yacc.yy | 2 + 4 files changed, 71 insertions(+), 46 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 5516be88b75..5104d3d9d42 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1064,46 +1064,56 @@ xxx yyy DROP TABLE t1; set names utf8; -select hex(char(1)); -hex(char(1)) +select hex(char(1 using utf8)); +hex(char(1 using utf8)) 01 -select char(0xd1,0x8f); -char(0xd1,0x8f) +select char(0xd1,0x8f using utf8); +char(0xd1,0x8f using utf8) Ñ -select char(0xd18f); -char(0xd18f) +select char(0xd18f using utf8); +char(0xd18f using utf8) Ñ -select char(53647); -char(53647) +select char(53647 using utf8); +char(53647 using utf8) Ñ -select char(0xff,0x8f); -char(0xff,0x8f) +select char(0xff,0x8f using utf8); +char(0xff,0x8f using utf8) ÿ +Warnings: +Warning 1300 Invalid utf8 character string: 'FF8F' set sql_mode=traditional; -select char(0xff,0x8f); -char(0xff,0x8f) -ÿ -select convert(char(0xff,0x8f) using utf8); -convert(char(0xff,0x8f) using utf8) -ÿ -select char(195); -char(195) -à -select convert(char(195) using utf8); -convert(char(195) using utf8) -à -select char(196); -char(196) -Ä -select convert(char(196) using utf8); -convert(char(196) using utf8) -Ä +select char(0xff,0x8f using utf8); +char(0xff,0x8f using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FF8F' +select char(195 using utf8); +char(195 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C3' +select char(196 using utf8); +char(196 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C4' +select char(2557 using utf8); +char(2557 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FD' +select hex(convert(char(2557 using latin1) using utf8)); +hex(convert(char(2557 using latin1) using utf8)) +09C3BD +select hex(char(195)); +hex(char(195)) +C3 +select hex(char(196)); +hex(char(196)) +C4 select hex(char(2557)); hex(char(2557)) 09FD -select hex(convert(char(2557) using utf8)); -hex(convert(char(2557) using utf8)) -09FD set names utf8; create table t1 (a char(1)) default character set utf8; create table t2 (a char(1)) default character set utf8; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index d186ca8a1f6..8f695ef315c 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -871,22 +871,32 @@ DROP TABLE t1; # set names utf8; # correct value -select hex(char(1)); -select char(0xd1,0x8f); -select char(0xd18f); -select char(53647); +select hex(char(1 using utf8)); +select char(0xd1,0x8f using utf8); +select char(0xd18f using utf8); +select char(53647 using utf8); # incorrect value: return with warning -select char(0xff,0x8f); +select char(0xff,0x8f using utf8); # incorrect value in strict mode: return NULL with "Error" level warning set sql_mode=traditional; -select char(0xff,0x8f); -select convert(char(0xff,0x8f) using utf8); -select char(195); -select convert(char(195) using utf8); -select char(196); -select convert(char(196) using utf8); +select char(0xff,0x8f using utf8); +select char(195 using utf8); +select char(196 using utf8); +select char(2557 using utf8); + +# +# Check convert + char + using +# +select hex(convert(char(2557 using latin1) using utf8)); + +# +# char() without USING returns "binary" by default, any argument is ok +# +select hex(char(195)); +select hex(char(196)); select hex(char(2557)); -select hex(convert(char(2557) using utf8)); + + # # Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index ec470bb242b..5889821293d 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -480,12 +480,15 @@ public: class Item_func_char :public Item_str_func { public: - Item_func_char(List &list) :Item_str_func(list) {} + Item_func_char(List &list) :Item_str_func(list) + { collation.set(&my_charset_bin); } + Item_func_char(List &list, CHARSET_INFO *cs) :Item_str_func(list) + { collation.set(cs); } String *val_str(String *); void fix_length_and_dec() { - collation.set(&my_charset_bin); - maybe_null=0; max_length=arg_count; + maybe_null=0; + max_length=arg_count * collation.collation->mbmaxlen; } const char *func_name() const { return "char"; } }; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 447530d633b..14f617b9f8b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4536,6 +4536,8 @@ simple_expr: { $$= new Item_func_atan($3,$5); } | CHAR_SYM '(' expr_list ')' { $$= new Item_func_char(*$3); } + | CHAR_SYM '(' expr_list USING charset_name ')' + { $$= new Item_func_char(*$3, $5); } | CHARSET '(' expr ')' { $$= new Item_func_charset($3); } | COALESCE '(' expr_list ')' From a6a0bd4ab5be0b6a54f2a9c966333ea88cb95e4d Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Thu, 13 Oct 2005 16:38:38 +0200 Subject: [PATCH 097/322] Bug #13461 Slave Cluster crashed on restart of two data nodes in seperate groups - ensure in ndb_mgmd that the stop command is not issued if a node is restarting - added some new error messages - in ndbcntr on master check so that node does not shutdown id shutdoen in progress --- ndb/include/mgmapi/ndbd_exit_codes.h | 1 + ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 10 ++++- ndb/src/kernel/error/ndbd_exit_codes.c | 3 ++ ndb/src/mgmsrv/MgmtSrvr.cpp | 38 ++++++++++++------- ndb/src/mgmsrv/MgmtSrvr.hpp | 8 ++-- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/ndb/include/mgmapi/ndbd_exit_codes.h b/ndb/include/mgmapi/ndbd_exit_codes.h index 4cb3fa7cde3..2a0802add02 100644 --- a/ndb/include/mgmapi/ndbd_exit_codes.h +++ b/ndb/include/mgmapi/ndbd_exit_codes.h @@ -104,6 +104,7 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification; /* NDBCNTR 6100-> */ #define NDBD_EXIT_RESTART_TIMEOUT 6100 +#define NDBD_EXIT_RESTART_DURING_SHUTDOWN 6101 /* TC 6200-> */ /* DIH 6300-> */ diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 851d217566b..bcf0839adc2 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -525,6 +525,9 @@ Ndbcntr::execCNTR_START_REF(Signal * signal){ cmasterNodeId = ref->masterNodeId; sendCntrStartReq(signal); return; + case CntrStartRef::StopInProgress: + jam(); + progError(__LINE__, NDBD_EXIT_RESTART_DURING_SHUTDOWN); } ndbrequire(false); } @@ -2022,7 +2025,9 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ return; } - if(c_stopRec.stopReq.senderRef != 0){ + if(c_stopRec.stopReq.senderRef != 0 || + (cmasterNodeId == getOwnNodeId() && !c_start.m_starting.isclear())) + { /** * Requested a system shutdown */ @@ -2036,7 +2041,8 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ /** * Requested a node shutdown */ - if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)) + if(c_stopRec.stopReq.senderRef && + StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)) ref->errorCode = StopRef::SystemShutdownInProgress; else ref->errorCode = StopRef::NodeShutdownInProgress; diff --git a/ndb/src/kernel/error/ndbd_exit_codes.c b/ndb/src/kernel/error/ndbd_exit_codes.c index d4592f7ff82..9b8c907cb7c 100644 --- a/ndb/src/kernel/error/ndbd_exit_codes.c +++ b/ndb/src/kernel/error/ndbd_exit_codes.c @@ -101,6 +101,9 @@ static const ErrStruct errArray[] = {NDBD_EXIT_RESTART_TIMEOUT, XCE, "Total restart time too long, consider increasing StartFailureTimeout " "or investigate error(s) on other node(s)"}, + {NDBD_EXIT_RESTART_DURING_SHUTDOWN, XRE, + "Node started while node shutdown in progress. " + "Please wait until shutdown complete before starting node"}, /* DIH */ {NDBD_EXIT_MAX_CRASHED_REPLICAS, XFL, diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index ab0064af7c2..34a0adf46b9 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -277,15 +277,13 @@ static ErrorItem errorTable[] = {MgmtSrvr::NOT_POSSIBLE_TO_SEND_CONFIG_UPDATE_TO_PROCESS_TYPE, "It is not possible to send an update of a configuration variable " "to this kind of process."}, - {5026, "Node shutdown in progress" }, - {5027, "System shutdown in progress" }, - {5028, "Node shutdown would cause system crash" }, - {5029, "Only one shutdown at a time is possible via mgm server" }, - {5060, "Operation not allowed in single user mode." }, - {5061, "DB is not in single user mode." }, - {5062, "The specified node is not an API node." }, - {5063, - "Cannot enter single user mode. DB nodes in inconsistent startlevel."}, + {MgmtSrvr::NODE_SHUTDOWN_IN_PROGESS, "Node shutdown in progress" }, + {MgmtSrvr::SYSTEM_SHUTDOWN_IN_PROGRESS, "System shutdown in progress" }, + {MgmtSrvr::NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH, + "Node shutdown would cause system crash" }, + {MgmtSrvr::NODE_NOT_API_NODE, "The specified node is not an API node." }, + {MgmtSrvr::OPERATION_NOT_ALLOWED_START_STOP, + "Operation not allowed while nodes are starting or stopping."}, {MgmtSrvr::NO_CONTACT_WITH_DB_NODES, "No contact with database nodes" } }; @@ -293,13 +291,13 @@ int MgmtSrvr::translateStopRef(Uint32 errCode) { switch(errCode){ case StopRef::NodeShutdownInProgress: - return 5026; + return NODE_SHUTDOWN_IN_PROGESS; break; case StopRef::SystemShutdownInProgress: - return 5027; + return SYSTEM_SHUTDOWN_IN_PROGRESS; break; case StopRef::NodeShutdownWouldCauseSystemCrash: - return 5028; + return NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH; break; } return 4999; @@ -989,6 +987,18 @@ int MgmtSrvr::sendSTOP_REQ(NodeId nodeId, int MgmtSrvr::stopNode(int nodeId, bool abort) { + if (!abort) + { + NodeId nodeId = 0; + ClusterMgr::Node node; + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) + { + node = theFacade->theClusterMgr->getNodeInfo(nodeId); + if((node.m_state.startLevel != NodeState::SL_STARTED) && + (node.m_state.startLevel != NodeState::SL_NOTHING)) + return OPERATION_NOT_ALLOWED_START_STOP; + } + } NodeBitmask nodes; return sendSTOP_REQ(nodeId, nodes, @@ -1027,7 +1037,7 @@ int MgmtSrvr::stop(int * stopCount, bool abort) int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId) { if (getNodeType(singleUserNodeId) != NDB_MGM_NODE_TYPE_API) - return 5062; + return NODE_NOT_API_NODE; NodeId nodeId = 0; ClusterMgr::Node node; while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) @@ -1035,7 +1045,7 @@ int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId) node = theFacade->theClusterMgr->getNodeInfo(nodeId); if((node.m_state.startLevel != NodeState::SL_STARTED) && (node.m_state.startLevel != NodeState::SL_NOTHING)) - return 5063; + return OPERATION_NOT_ALLOWED_START_STOP; } NodeBitmask nodes; int ret = sendSTOP_REQ(0, diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 9dff185a46d..600d168ee08 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -174,10 +174,12 @@ public: STATIC_CONST( NODE_SHUTDOWN_IN_PROGESS = 5026 ); STATIC_CONST( SYSTEM_SHUTDOWN_IN_PROGRESS = 5027 ); STATIC_CONST( NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH = 5028 ); - STATIC_CONST( NO_CONTACT_WITH_CLUSTER = 6666 ); - STATIC_CONST( OPERATION_IN_PROGRESS = 6667 ); - + STATIC_CONST( NO_CONTACT_WITH_DB_NODES = 5030 ); + + STATIC_CONST( NODE_NOT_API_NODE = 5062 ); + STATIC_CONST( OPERATION_NOT_ALLOWED_START_STOP = 5063 ); + /** * This enum specifies the different signal loggig modes possible to set * with the setSignalLoggingMode method. From 144c873e3923fccdd368c08c496624342a9db1e0 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 13 Oct 2005 17:41:55 +0300 Subject: [PATCH 098/322] Review of new pushed code - No need to check *ref when ref is checked (Simple optimization fix) --- sql/item.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index c3845db904c..38b6516b742 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -351,8 +351,8 @@ bool Item_field::fix_fields(THD *thd,TABLE_LIST *tables) { if (thd->lex.select_lex.is_item_list_lookup) { - Item** res= find_item_in_list(this, thd->lex.select_lex.item_list); - if (res && *res && (*res)->type() == Item::FIELD_ITEM) + Item **res= find_item_in_list(this, thd->lex.select_lex.item_list); + if (res && (*res)->type() == Item::FIELD_ITEM) { set_field((*((Item_field**)res))->field); return 0; From 27d8bc5b1fae0b384250922f1b5983c5bd79dfbc Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Thu, 13 Oct 2005 19:51:07 +0500 Subject: [PATCH 099/322] merging --- mysql-test/r/select.result | 55 -------------------------------------- mysql-test/t/select.test | 1 - 2 files changed, 56 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 025bd1c6ba5..be46d180f2d 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2653,60 +2653,6 @@ t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL select 123 as a from t1 where f1 is null; a drop table t1,t11; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; CREATE TABLE t1 (a INT, b INT); (SELECT a, b AS c FROM t1) ORDER BY c+1; a c @@ -2717,7 +2663,6 @@ a c SELECT a, b AS c FROM t1 ORDER BY b+1; a c drop table t1; -DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 938518fcb14..56fab52729e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2213,7 +2213,6 @@ drop table t1; # Bug #3874 (function in GROUP and LEFT JOIN) # -DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); From 829a4831b1054a769ed34e111ab88be0619aa06e Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 13 Oct 2005 19:24:01 +0300 Subject: [PATCH 100/322] Fixes during review of new code --- sql/slave.cc | 5 +++-- vio/vio.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index ebae8461f11..2fc4eef0f64 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4330,7 +4330,8 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", time_t save_timestamp= rli->last_master_timestamp; rli->last_master_timestamp= 0; - DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count); + DBUG_ASSERT(rli->relay_log.get_open_count() == + rli->cur_log_old_open_count); if (rli->ign_master_log_name_end[0]) { @@ -4341,13 +4342,13 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", Rotate_log_event::DUP_NAME | Rotate_log_event::ZERO_LEN); rli->ign_master_log_name_end[0]= 0; + pthread_mutex_unlock(log_lock); if (unlikely(!ev)) { errmsg= "Slave SQL thread failed to create a Rotate event " "(out of memory?), SHOW SLAVE STATUS may be inaccurate"; goto err; } - pthread_mutex_unlock(log_lock); ev->server_id= 0; // don't be ignored by slave SQL thread DBUG_RETURN(ev); } diff --git a/vio/vio.c b/vio/vio.c index f60a53d2f04..427c52e29d3 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -146,7 +146,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) reports that the socket is set for non-blocking when it really will block. */ - fcntl(sd, F_SETFL, vio->fcntl_mode); + fcntl(sd, F_SETFL, 0); vio->fcntl_mode= fcntl(sd, F_GETFL); #elif defined(HAVE_SYS_IOCTL_H) /* hpux */ /* Non blocking sockets doesn't work good on HPUX 11.0 */ From bf1a3bc030b20255ae582bbf436743604dc70431 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 21:28:44 +0500 Subject: [PATCH 101/322] select.result, mysqldump-max.result: after merge fix. range.result: fixing result accordingly , cast.result: after merge fix range.test: Avoid SELECT'ing of BINARY column not to output 0x00 bytes. --- mysql-test/r/cast.result | 6 +++--- mysql-test/r/mysqldump-max.result | 6 ++++++ mysql-test/r/range.result | 6 +++--- mysql-test/r/select.result | 20 ++++++++++---------- mysql-test/t/range.test | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 6246d574a82..817be3a2e7c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -334,6 +334,9 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 select cast('1.2' as decimal(3,2)); cast('1.2' as decimal(3,2)) 1.20 @@ -367,6 +370,3 @@ DROP TABLE t1; select cast(NULL as decimal(6)) as t1; t1 NULL -select cast(1.0e+300 as signed int); -cast(1.0e+300 as signed int) -9223372036854775807 diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 699552bd514..39d607910aa 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -99,6 +99,8 @@ id name /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -167,6 +169,7 @@ CREATE TABLE `t6` ( /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -181,6 +184,8 @@ INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first va /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -249,6 +254,7 @@ CREATE TABLE `t6` ( /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 6dedd020249..f6b7409ea6a 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -813,7 +813,7 @@ update t1 set a='b' where a<>'a'; explain select * from t1 where a not between 'b' and 'b'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 13 NULL # Using where -select * from t1 where a not between 'b' and 'b'; -a filler -a +select a, hex(filler) from t1 where a not between 'b' and 'b'; +a hex(filler) +a 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 drop table t1,t2,t3; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index fd8a0a35275..31cbeb89584 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2620,6 +2620,16 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; create table t1(f1 int, f2 int); create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); @@ -2737,16 +2747,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; -CREATE TABLE t1 (a INT, b INT); -(SELECT a, b AS c FROM t1) ORDER BY c+1; -a c -(SELECT a, b AS c FROM t1) ORDER BY b+1; -a c -SELECT a, b AS c FROM t1 ORDER BY c+1; -a c -SELECT a, b AS c FROM t1 ORDER BY b+1; -a c -drop table t1; create table t1 (a int, b int); create table t2 like t1; select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 89376d33f61..f6493bac244 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -628,6 +628,6 @@ explain select * from t2 where a = 'a' or a='a '; update t1 set a='b' where a<>'a'; --replace_column 9 # explain select * from t1 where a not between 'b' and 'b'; -select * from t1 where a not between 'b' and 'b'; +select a, hex(filler) from t1 where a not between 'b' and 'b'; drop table t1,t2,t3; From 3ef920a7c783b2da98f72fd52b51cf064b874da0 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 13 Oct 2005 19:34:15 +0300 Subject: [PATCH 102/322] Merged from 4.1. --- mysql-test/r/cast.result | 6 +++--- mysql-test/r/select.result | 40 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7bf710f3491..fff6f039f6e 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -334,6 +334,9 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 select cast('1.2' as decimal(3,2)); cast('1.2' as decimal(3,2)) 1.20 @@ -367,6 +370,3 @@ DROP TABLE t1; select cast(NULL as decimal(6)) as t1; t1 NULL -select cast(1.0e+300 as signed int); -cast(1.0e+300 as signed int) -9223372036854775807 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index b3ba3c4b0e0..10ecd64c53f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2620,6 +2620,16 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; create table t1(f1 int, f2 int); create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); @@ -2636,6 +2646,16 @@ select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); f1 f2 f3 2 NULL 2 drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL +t11 MyISAM 10 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); @@ -2737,16 +2757,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; -CREATE TABLE t1 (a INT, b INT); -(SELECT a, b AS c FROM t1) ORDER BY c+1; -a c -(SELECT a, b AS c FROM t1) ORDER BY b+1; -a c -SELECT a, b AS c FROM t1 ORDER BY c+1; -a c -SELECT a, b AS c FROM t1 ORDER BY b+1; -a c -drop table t1; create table t1 (a int, b int); create table t2 like t1; select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; @@ -3078,13 +3088,3 @@ from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; count(*) 6 drop table a, b, c; -create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); -create table t11 like t1; -insert into t1 values(1,""),(2,""); -show table status like 't1%'; -Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 MyISAM 9 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL -t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL -select 123 as a from t1 where f1 is null; -a -drop table t1,t11; From 49a30ef51397c810055c0d6e7db191e67b42c86d Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 13 Oct 2005 19:40:46 +0300 Subject: [PATCH 103/322] Fixes during review of new pushed code --- sql/handler.cc | 13 +++++++------ sql/item.cc | 4 ++-- sql/table.cc | 8 +++++--- sql/unireg.cc | 6 +++--- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 15394851e02..81e94af5dc7 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -185,16 +185,16 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen) handlerton **types; if (thd && !my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)"DEFAULT", 7)) + (const uchar *)name, namelen, + (const uchar *)"DEFAULT", 7)) return (enum db_type) thd->variables.table_type; retest: for (types= sys_table_types; *types; types++) { if (!my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)(*types)->name, strlen((*types)->name))) + (const uchar *)name, namelen, + (const uchar *)(*types)->name, strlen((*types)->name))) return (enum db_type) (*types)->db_type; } @@ -204,8 +204,9 @@ retest: for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { if (!my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)table_alias->alias, strlen(table_alias->alias))) + (const uchar *)name, namelen, + (const uchar *)table_alias->alias, + strlen(table_alias->alias))) { name= table_alias->type; namelen= strlen(name); diff --git a/sql/item.cc b/sql/item.cc index 5961db0bc1f..dd6c7493ef9 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4628,7 +4628,7 @@ void Item_ref::cleanup() void Item_ref::print(String *str) { - if (ref && *ref) + if (ref) (*ref)->print(str); else Item_ident::print(str); @@ -4814,7 +4814,7 @@ void Item_ref::make_field(Send_field *field) void Item_ref_null_helper::print(String *str) { str->append("(", 18); - if (ref && *ref) + if (ref) (*ref)->print(str); else str->append('?'); diff --git a/sql/table.cc b/sql/table.cc index 66881c1a31c..722e4e4df25 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -310,6 +310,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, char *buff, *next_chunk, *buff_end; if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME)))) goto err; + buff_end= buff + n_length; if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength, MYF(MY_NABP))) { @@ -324,13 +325,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, goto err; } next_chunk+= share->connect_string.length + 2; - buff_end= buff + n_length; if (next_chunk + 2 < buff_end) { uint str_db_type_length= uint2korr(next_chunk); share->db_type= ha_resolve_by_name(next_chunk + 2, str_db_type_length); - DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n", share->db_type, - str_db_type_length, str_db_type_length, next_chunk + 2)); + DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n", + share->db_type, + str_db_type_length, str_db_type_length, + next_chunk + 2)); next_chunk+= str_db_type_length + 2; } my_free(buff, MYF(0)); diff --git a/sql/unireg.cc b/sql/unireg.cc index 3420e359c27..065f8583f71 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -119,10 +119,10 @@ bool mysql_create_frm(THD *thd, my_string file_name, reclength=uint2korr(forminfo+266); /* Calculate extra data segment length */ - str_db_type.str= (char *)ha_get_storage_engine(create_info->db_type); + str_db_type.str= (char *) ha_get_storage_engine(create_info->db_type); str_db_type.length= strlen(str_db_type.str); - create_info->extra_size= 2 + str_db_type.length; - create_info->extra_size+= create_info->connect_string.length + 2; + create_info->extra_size= (2 + str_db_type.length + + 2 + create_info->connect_string.length); if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys)) < 0) From 8f659d05a2d4641b437973be577a6b1427920729 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Oct 2005 11:05:59 -0700 Subject: [PATCH 104/322] Fix typo (thread_cache should be thread_cache_size) in example configuration files. (Bug #13811) --- support-files/my-huge.cnf.sh | 2 +- support-files/my-innodb-heavy-4G.cnf.sh | 2 +- support-files/my-large.cnf.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index d25686f1c21..06683994a72 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -33,7 +33,7 @@ sort_buffer_size = 2M read_buffer_size = 2M read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M -thread_cache = 8 +thread_cache_size = 8 query_cache_size = 32M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 062d106ce6a..4204e172016 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -128,7 +128,7 @@ join_buffer_size = 8M # the amount of thread creations needed if you have a lot of new # connections. (Normally this doesn't give a notable performance # improvement if you have a good thread implementation.) -thread_cache = 8 +thread_cache_size = 8 # This permits the application to give the threads system a hint for the # desired number of threads that should be run at the same time. This diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index 59aca4b32f2..85151eb1077 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -33,7 +33,7 @@ sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M -thread_cache = 8 +thread_cache_size = 8 query_cache_size= 16M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 From 8ae2cfb0f74eaf8a87707c839d1f9c0a8adacbc0 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Oct 2005 11:10:45 -0700 Subject: [PATCH 105/322] Force a server restart for the not_embedded_server test to satisfy conditions of its first test. (Bug #13796) --- mysql-test/t/not_embedded_server-master.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/t/not_embedded_server-master.opt diff --git a/mysql-test/t/not_embedded_server-master.opt b/mysql-test/t/not_embedded_server-master.opt new file mode 100644 index 00000000000..35fcc5f30c6 --- /dev/null +++ b/mysql-test/t/not_embedded_server-master.opt @@ -0,0 +1 @@ +--loose-to-force-a-restart From a315d1be766565347331374736de4e9954734992 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 13 Oct 2005 22:01:02 +0200 Subject: [PATCH 106/322] RPM spec file fixes: - added a usermod call to assign a potential existing mysql user to the correct user group (BUG#12823) - Save the perror binary built during Max build so it supports the NDB error codes (BUG#13740) - added a separate macro "mysqld_group" to be able to define the user group of the mysql user seperately, if desired. --- support-files/mysql.spec.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 0f597e1dda5..7247bfbaf3e 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -10,6 +10,7 @@ %endif %define license GPL %define mysqld_user mysql +%define mysqld_group mysql %define server_suffix -standard %define mysqldatadir /var/lib/mysql @@ -313,6 +314,8 @@ make test-force || true # Save mysqld-max mv sql/mysqld sql/mysqld-max nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym +# Save the perror binary so it supports the NDB error codes (BUG#13740) +mv extra/perror extra/perror.ndb # Install the ndb binaries (cd ndb; make install DESTDIR=$RBR) @@ -321,7 +324,7 @@ nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ # Include libgcc.a in the devel subpackage (BUG 4921) -if [ "$CC" = gcc ] +if expr "$CC" : ".*gcc.*" > /dev/null ; then libgcc=`$CC --print-libgcc-file` if [ -f $libgcc ] @@ -384,6 +387,9 @@ make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} # install saved mysqld-max install -s -m755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max +# install saved perror binary with NDB support (BUG#13740) +install -s -m755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror + # install symbol files ( for stack trace resolution) install -m644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym install -m644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym @@ -439,18 +445,20 @@ fi # Create a MySQL user and group. Do not report any problems if it already # exists. -groupadd -r %{mysqld_user} 2> /dev/null || true -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true +groupadd -r %{mysqld_group} 2> /dev/null || true +useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true +# The user may already exist, make sure it has the proper group nevertheless (BUG#12823) +usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true # Change permissions so that the user that will run the MySQL daemon # owns all database files. -chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # Initiate databases %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} # Change permissions again to fix any new files. -chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # Fix permissions for the permission database so that only the user # can read them. @@ -668,6 +676,15 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Oct 13 2005 Lenz Grimmer + +- added a usermod call to assign a potential existing mysql user to the + correct user group (BUG#12823) +- Save the perror binary built during Max build so it supports the NDB + error codes (BUG#13740) +- added a separate macro "mysqld_group" to be able to define the + user group of the mysql user seperately, if desired. + * Thu Sep 29 2005 Lenz Grimmer - fixed the removing of the RPM_BUILD_ROOT in the %clean section (the From c93927eef02715da9cb3d2be87f769f6667bc78e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 13 Oct 2005 22:10:54 +0200 Subject: [PATCH 107/322] - added a usermod call in the postinstall section of the RPM spec file to assign a potential existing mysql user to the correct user group (BUG#12823) --- support-files/mysql.spec.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 6104b7a4882..16845aa4be7 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -2,6 +2,7 @@ %define release 0 %define license GPL %define mysqld_user mysql +%define mysqld_group mysql %define server_suffix -standard %define mysqldatadir /var/lib/mysql @@ -371,18 +372,20 @@ fi # Create a MySQL user and group. Do not report any problems if it already # exists. -groupadd -r %{mysqld_user} 2> /dev/null || true -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true +groupadd -r %{mysqld_group} 2> /dev/null || true +useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true +# The user may already exist, make sure it has the proper group nevertheless (BUG#12823) +usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true # Change permissions so that the user that will run the MySQL daemon # owns all database files. -chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # Initiate databases %{_bindir}/mysql_install_db -IN-RPM --user=%{mysqld_user} # Change permissions again to fix any new files. -chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # Fix permissions for the permission database so that only the user # can read them. @@ -562,6 +565,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Oct 13 2005 Lenz Grimmer + +- added a usermod call to assign a potential existing mysql user to the + correct user group (BUG#12823) * Thu Sep 29 2005 Lenz Grimmer - fixed the removing of the RPM_BUILD_ROOT in the %clean section (the From d86f40650f77512ecd11d58a981511c82dd63dcd Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Thu, 13 Oct 2005 13:42:56 -0700 Subject: [PATCH 108/322] BUG# 13146 Re-application of patch to clean 5.0 tree. Fixed issue with ANSI quotes when dumping triggers --- client/mysqldump.c | 30 ++++++++++++++-- mysql-test/r/mysqldump.result | 65 +++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 34 ++++++++++++++++++ 3 files changed, 127 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index d1ecc30916e..3768f967f5c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -975,6 +975,22 @@ static my_bool test_if_special_chars(const char *str) +/* + quote_name(name, buff, force) + + Quotes char string, taking into account compatible mode + + Args + + name Unquoted string containing that which will be quoted + buff The buffer that contains the quoted value, also returned + force Flag to make it ignore 'test_if_special_chars' + + Returns + + buff quoted string + +*/ static char *quote_name(const char *name, char *buff, my_bool force) { char *to= buff; @@ -1782,14 +1798,19 @@ continue_xml: static void dump_triggers_for_table (char *table, char *db) { - MYSQL_RES *result; - MYSQL_ROW row; char *result_table; char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3]; char query_buff[512]; + uint old_opt_compatible_mode=opt_compatible_mode; FILE *sql_file = md_result_file; + MYSQL_RES *result; + MYSQL_ROW row; + DBUG_ENTER("dump_triggers_for_table"); DBUG_PRINT("enter", ("db: %s, table: %s", db, table)); + + /* Do not use ANSI_QUOTES on triggers in dump */ + opt_compatible_mode&= ~MASK_ANSI_QUOTES; result_table= quote_name(table, table_buff, 1); my_snprintf(query_buff, sizeof(query_buff), @@ -1822,6 +1843,11 @@ DELIMITER ;;\n"); "DELIMITER ;\n" "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;\n"); mysql_free_result(result); + /* + make sure to set back opt_compatible mode to + original value + */ + opt_compatible_mode=old_opt_compatible_mode; DBUG_VOID_RETURN; } diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 4757bd17b42..c3f2e55939e 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2309,3 +2309,68 @@ UNLOCK TABLES; drop table t1; set global time_zone=default; set time_zone=default; +DROP TABLE IF EXISTS `t1 test`; +CREATE TABLE `t1 test` ( +`a1` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `t2 test`; +CREATE TABLE `t2 test` ( +`a2` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END // +INSERT INTO `t1 test` VALUES (1); +INSERT INTO `t1 test` VALUES (2); +INSERT INTO `t1 test` VALUES (3); +SELECT * FROM `t2 test`; +a2 +1 +2 +3 +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS "t1 test"; +CREATE TABLE "t1 test" ( + "a1" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t1 test" DISABLE KEYS */; +LOCK TABLES "t1 test" WRITE; +INSERT INTO "t1 test" VALUES (1),(2),(3); +UNLOCK TABLES; +/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */; + +/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="" */;; +/*!50003 CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END */;; + +DELIMITER ; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +DROP TABLE IF EXISTS "t2 test"; +CREATE TABLE "t2 test" ( + "a2" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t2 test" DISABLE KEYS */; +LOCK TABLES "t2 test" WRITE; +INSERT INTO "t2 test" VALUES (1),(2),(3); +UNLOCK TABLES; +/*!40000 ALTER TABLE "t2 test" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TRIGGER `test trig`; +DROP TABLE `t1 test`; +DROP TABLE `t2 test`; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 6898dbe7a8d..377a8c8179e 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -928,3 +928,37 @@ set global time_zone='Europe/Moscow'; drop table t1; set global time_zone=default; set time_zone=default; + +# +# Test of fix to BUG 13146 - ansi quotes break loading of triggers +# +--disable_warnings +DROP TABLE IF EXISTS `t1 test`; +CREATE TABLE `t1 test` ( + `a1` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `t2 test`; +CREATE TABLE `t2 test` ( + `a2` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +--enable_warnings + +DELIMITER //; +CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END // +DELIMITER ;// + +INSERT INTO `t1 test` VALUES (1); +INSERT INTO `t1 test` VALUES (2); +INSERT INTO `t1 test` VALUES (3); +SELECT * FROM `t2 test`; +# dump with compatible=ansi. Everything except triggers should be double +# quoted +--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test + +--disable_warnings +DROP TRIGGER `test trig`; +DROP TABLE `t1 test`; +DROP TABLE `t2 test`; +--enable_warnings From 6d6e107f1275c6e55b91bed29a75388c6b0a2706 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Fri, 14 Oct 2005 00:02:38 +0300 Subject: [PATCH 109/322] - set 'updating' in both tables list if we have two of them (because of subquery) (BUG#13236) - fixed test --- mysql-test/r/rpl_multi_update2.result | 13 +++++++++++++ mysql-test/t/rpl_multi_update2.test | 27 +++++++++++++++++++++++++++ sql/sql_update.cc | 8 ++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result index 99356ebf970..5bb262764fa 100644 --- a/mysql-test/r/rpl_multi_update2.result +++ b/mysql-test/r/rpl_multi_update2.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +drop table if exists t1,t2; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned @@ -40,3 +41,15 @@ SELECT * FROM t2 ORDER BY a; a b 1 0 2 1 +drop table t1,t2; +reset master; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (0); +UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; +select * from t1; +a +3 +select * from t1; +a +3 +drop table t1; diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test index f92c5504f43..a78b1901f51 100644 --- a/mysql-test/t/rpl_multi_update2.test +++ b/mysql-test/t/rpl_multi_update2.test @@ -4,6 +4,10 @@ source include/master-slave.inc; +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned @@ -32,4 +36,27 @@ sync_with_master; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; +connection master; +drop table t1,t2; +sync_slave_with_master; + +# +# BUG#13236 multi-update with subquery & --replicate-ignore-table +# +reset master; + +connection master; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (0); +UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; +select * from t1; +sync_slave_with_master; + +connection slave; +select * from t1; + +connection master; +drop table t1; +sync_slave_with_master; + # End of 4.1 tests diff --git a/sql/sql_update.cc b/sql/sql_update.cc index a978a5edc64..ca40ed554dd 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -569,7 +569,9 @@ int mysql_multi_update_lock(THD *thd, } DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); tl->lock_type= thd->lex->multi_lock_option; - tl->updating= 1; + tl->updating= 1; // loacal or only list + if (tl->table_list) + tl->table_list->updating= 1; // global list (if we have 2 lists) wants= UPDATE_ACL; } else @@ -579,7 +581,9 @@ int mysql_multi_update_lock(THD *thd, // correct order of statements. Otherwise, we use a TL_READ lock to // improve performance. tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ; - tl->updating= 0; + tl->updating= 0; // loacal or only list + if (tl->table_list) + tl->table_list->updating= 0; // global list (if we have 2 lists) wants= SELECT_ACL; } From 3da5f1c223cae7a20e2e5e2e15e32fa2c6bab03f Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 14 Oct 2005 00:04:52 +0300 Subject: [PATCH 110/322] Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects field::sort_key() now adds length last for varbinary/blob VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones Fixed issues in test cases from last merge --- mysql-test/r/select.result | 13 +++-- mysql-test/r/type_blob.result | 70 ++++++++++++++++++++++++++ mysql-test/t/select.test | 46 ++++++----------- mysql-test/t/type_blob.test | 19 +++++++ sql/field.cc | 43 ++++++++++++++++ sql/field.h | 7 +++ sql/filesort.cc | 93 +++++++++++++++++++++++++++-------- sql/sql_class.h | 1 + sql/sql_select.cc | 2 +- strings/ctype-bin.c | 21 ++------ 10 files changed, 238 insertions(+), 77 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 31a6cbc675b..abf607dd438 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2668,10 +2668,9 @@ a c drop table t1; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); -CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); -INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), -(1,2,3); -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; a b c d 1 2 1 1 @@ -2679,14 +2678,14 @@ a b c d 1 2 3 1 1 10 2 1 11 2 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; a b c d 1 10 4 1 2 1 1 1 2 2 1 1 2 3 1 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; a b c d 1 2 1 1 @@ -2694,7 +2693,7 @@ a b c d 1 2 3 1 1 10 2 1 11 2 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; a b c d 1 2 1 1 diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index fd478c916c9..b366b1ed755 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -718,3 +718,73 @@ t1 CREATE TABLE `t1` ( KEY `a` (`a`,`b`,`d`,`e`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE table t1 (a blob); +insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL); +select hex(a) from t1 order by a; +hex(a) +NULL +61 +6100 +6120 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +6100 +610000 +612000 +616100 +6200 +alter table t1 modify a varbinary(5); +select hex(a) from t1 order by a; +hex(a) +NULL +61 +6100 +6120 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +6100 +610000 +612000 +616100 +6200 +alter table t1 modify a char(5); +select hex(a) from t1 order by a; +hex(a) +NULL +6100 +61 +61 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +610000 +6100 +6100 +616100 +6200 +alter table t1 modify a binary(5); +select hex(a) from t1 order by a; +hex(a) +NULL +6100000000 +6100000000 +6100000000 +6161000000 +6200000000 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +610000000000 +610000000000 +610000000000 +616100000000 +620000000000 +drop table t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 50b5f42079d..6fc149e2e1f 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -7,7 +7,7 @@ # --disable_warnings -drop table if exists t1,t2,t3,t4; +drop table if exists t1,t2,t3,t4,t11; # The following may be left from older tests drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; drop view if exists v1; @@ -2232,16 +2232,15 @@ drop table t1; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); -CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); -INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), - (1,2,3); -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; DROP TABLE IF EXISTS t1, t2; @@ -2635,31 +2634,18 @@ drop view v1, v2, v3; # nested right join. # -create table a ( - id int(11) not null default '0' -) engine=myisam default charset=latin1; - -insert into a values (123),(191),(192); - -create table b ( - id char(16) character set utf8 not null default '' -) engine=myisam default charset=latin1; - -insert into b values ('58013'),('58014'),('58015'),('58016'); - -create table c ( - a_id int(11) not null default '0', - b_id char(16) character set utf8 default null -) engine=myisam default charset=latin1; - -insert into c values -(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +create table t1 (id int(11) not null default '0'); +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); -- both queries are equivalent select count(*) -from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id; +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; select count(*) -from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; -drop table a, b, c; +drop table t1,t2,t3; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 4f3c02b0465..503d7ffc0b9 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -404,3 +404,22 @@ alter table t1 add primary key (a,b,c(255),d); alter table t1 add key (a,b,d,e); show create table t1; drop table t1; + +# +# Test that blob's and varbinary are sorted according to length +# + +CREATE table t1 (a blob); +insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a varbinary(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a char(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a binary(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 7e3cd004dc2..b4ba89f613c 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6402,6 +6402,17 @@ int Field_varstring::key_cmp(const byte *a,const byte *b) void Field_varstring::sort_string(char *to,uint length) { uint tot_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr); + + if (field_charset == &my_charset_bin) + { + /* Store length last in high-byte order to sort longer strings first */ + if (length_bytes == 1) + to[length-1]= tot_length; + else + mi_int2store(to+length-2, tot_length); + length-= length_bytes; + } + tot_length= my_strnxfrm(field_charset, (uchar*) to, length, (uchar*) ptr + length_bytes, @@ -7093,6 +7104,13 @@ int Field_blob::key_cmp(const byte *a,const byte *b) } +uint32 Field_blob::sort_length() const +{ + return (uint32) (current_thd->variables.max_sort_length + + (field_charset == &my_charset_bin ? 0 : packlength)); +} + + void Field_blob::sort_string(char *to,uint length) { char *blob; @@ -7102,6 +7120,31 @@ void Field_blob::sort_string(char *to,uint length) bzero(to,length); else { + if (field_charset == &my_charset_bin) + { + char *pos; + + /* + Store length of blob last in blob to shorter blobs before longer blobs + */ + length-= packlength; + pos= to+length; + + switch (packlength) { + case 1: + *pos= (char) blob_length; + break; + case 2: + mi_int2store(pos, blob_length); + break; + case 3: + mi_int3store(pos, blob_length); + break; + case 4: + mi_int4store(pos, blob_length); + break; + } + } memcpy_fixed(&blob,ptr+packlength,sizeof(char*)); blob_length=my_strnxfrm(field_charset, diff --git a/sql/field.h b/sql/field.h index 632169868bc..a9f47ecc4a9 100644 --- a/sql/field.h +++ b/sql/field.h @@ -132,6 +132,7 @@ public: virtual bool eq_def(Field *field); virtual uint32 pack_length() const { return (uint32) field_length; } virtual uint32 pack_length_in_rec() const { return pack_length(); } + virtual uint32 sort_length() const { return pack_length(); } virtual void reset(void) { bzero(ptr,pack_length()); } virtual void reset_fields() {} virtual void set_default() @@ -1048,6 +1049,11 @@ public: void reset(void) { bzero(ptr,field_length+length_bytes); } uint32 pack_length() const { return (uint32) field_length+length_bytes; } uint32 key_length() const { return (uint32) field_length; } + uint32 sort_length() const + { + return (uint32) field_length + (field_charset == &my_charset_bin ? + length_bytes : 0); + } int store(const char *to,uint length,CHARSET_INFO *charset); int store(longlong nr, bool unsigned_val); int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */ @@ -1120,6 +1126,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return (uint32) (packlength+table->s->blob_ptr_size); } + uint32 sort_length() const; inline uint32 max_data_length() const { return (uint32) (((ulonglong) 1 << (packlength*8)) -1); diff --git a/sql/filesort.cc b/sql/filesort.cc index ad784c729fa..42d25dbbaee 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -50,7 +50,8 @@ static int merge_index(SORTPARAM *param,uchar *sort_buffer, IO_CACHE *outfile); static bool save_index(SORTPARAM *param,uchar **sort_keys, uint count, FILESORT_INFO *table_sort); -static uint sortlength(SORT_FIELD *sortorder, uint s_length, +static uint suffix_length(ulong string_length); +static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset); static SORT_ADDON_FIELD *get_addon_fields(THD *thd, Field **ptabfield, uint sortlength, uint *plength); @@ -123,7 +124,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, sort_keys= (uchar **) NULL; error= 1; bzero((char*) ¶m,sizeof(param)); - param.sort_length= sortlength(sortorder, s_length, &multi_byte_charset); + param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset); param.ref_length= table->file->ref_length; param.addon_field= 0; param.addon_length= 0; @@ -585,6 +586,28 @@ err: } /* write_keys */ +/* + Store length as suffix in high-byte-first order +*/ + +static inline void store_length(uchar *to, uint length, uint pack_length) +{ + switch (pack_length) { + case 1: + *to= (uchar) length; + break; + case 2: + mi_int2store(to, length); + break; + case 3: + mi_int3store(to, length); + default: + mi_int4store(to, length); + break; + } +} + + /* makes a sort-key from record */ static void make_sortkey(register SORTPARAM *param, @@ -623,9 +646,11 @@ static void make_sortkey(register SORTPARAM *param, maybe_null= item->maybe_null; switch (sort_field->result_type) { case STRING_RESULT: - { + { CHARSET_INFO *cs=item->collation.collation; char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' '); + int diff; + uint sort_field_length; if (maybe_null) *to++=1; @@ -644,24 +669,32 @@ static void make_sortkey(register SORTPARAM *param, } break; } - length=res->length(); - int diff=(int) (sort_field->length-length); + length= res->length(); + sort_field_length= sort_field->length - sort_field->suffix_length; + diff=(int) (sort_field_length - length); if (diff < 0) { diff=0; /* purecov: inspected */ - length=sort_field->length; + length= sort_field_length; } + if (sort_field->suffix_length) + { + /* Store length last in result_string */ + store_length(to + sort_field_length, length, + sort_field->suffix_length); + } if (sort_field->need_strxnfrm) { char *from=(char*) res->ptr(); + uint tmp_length; if ((unsigned char *)from == to) { set_if_smaller(length,sort_field->length); memcpy(param->tmp_buffer,from,length); from=param->tmp_buffer; } - uint tmp_length=my_strnxfrm(cs,to,sort_field->length, - (unsigned char *) from, length); + tmp_length= my_strnxfrm(cs,to,sort_field->length, + (unsigned char *) from, length); DBUG_ASSERT(tmp_length == sort_field->length); } else @@ -670,7 +703,7 @@ static void make_sortkey(register SORTPARAM *param, cs->cset->fill(cs, (char *)to+length,diff,fill_char); } break; - } + } case INT_RESULT: { longlong value= item->val_int_result(); @@ -1170,11 +1203,25 @@ static int merge_index(SORTPARAM *param, uchar *sort_buffer, } /* merge_index */ +static uint suffix_length(ulong string_length) +{ + if (string_length < 256) + return 1; + if (string_length < 256L*256L) + return 2; + if (string_length < 256L*256L*256L) + return 3; + return 4; // Can't sort longer than 4G +} + + + /* Calculate length of sort key SYNOPSIS sortlength() + thd Thread handler sortorder Order of items to sort uint s_length Number of items to sort multi_byte_charset (out) @@ -1190,10 +1237,10 @@ static int merge_index(SORTPARAM *param, uchar *sort_buffer, */ static uint -sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) +sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, + bool *multi_byte_charset) { reg2 uint length; - THD *thd= current_thd; CHARSET_INFO *cs; *multi_byte_charset= 0; @@ -1201,19 +1248,17 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) for (; s_length-- ; sortorder++) { sortorder->need_strxnfrm= 0; + sortorder->suffix_length= 0; if (sortorder->field) { - if (sortorder->field->type() == FIELD_TYPE_BLOB) - sortorder->length= thd->variables.max_sort_length; - else + cs= sortorder->field->sort_charset(); + sortorder->length= sortorder->field->sort_length(); + + if (use_strnxfrm((cs=sortorder->field->sort_charset()))) { - sortorder->length=sortorder->field->pack_length(); - if (use_strnxfrm((cs=sortorder->field->sort_charset()))) - { - sortorder->need_strxnfrm= 1; - *multi_byte_charset= 1; - sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length); - } + sortorder->need_strxnfrm= 1; + *multi_byte_charset= 1; + sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length); } if (sortorder->field->maybe_null()) length++; // Place for NULL marker @@ -1229,6 +1274,12 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) sortorder->need_strxnfrm= 1; *multi_byte_charset= 1; } + else if (cs == &my_charset_bin) + { + /* Store length last to be able to sort blob/varbinary */ + sortorder->suffix_length= suffix_length(sortorder->length); + sortorder->length+= sortorder->suffix_length; + } break; case INT_RESULT: #if SIZEOF_LONG_LONG > 4 diff --git a/sql/sql_class.h b/sql/sql_class.h index 48a2837eb04..02afbcfe304 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1899,6 +1899,7 @@ typedef struct st_sort_field { Field *field; /* Field to sort */ Item *item; /* Item if not sorting fields */ uint length; /* Length of sort field */ + uint suffix_length; /* Length suffix (0-4) */ Item_result result_type; /* Type of item */ bool reverse; /* if descending sort */ bool need_strxnfrm; /* If we have to use strxnfrm() */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2d482290909..806a6d3ea32 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11410,7 +11410,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, ulong total_length= 0; for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) { - uint length= (*ptr)->pack_length(); + uint length= (*ptr)->sort_length(); (*field_length++)= length; total_length+= length; } diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index a931c6412b3..973a6ebf12a 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -373,29 +373,14 @@ static int my_wildcmp_bin(CHARSET_INFO *cs, } -uint my_strnxfrmlen_bin(CHARSET_INFO *cs __attribute__((unused)), uint len) -{ - return len + 2; -} - - static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint dstlen, const uchar *src, uint srclen) { if (dest != src) memcpy(dest, src, min(dstlen,srclen)); - - if (dstlen >= srclen + 2) - { - if (dstlen > srclen + 2) - bfill(dest + srclen, dstlen - srclen - 2, 0); - dest[dstlen-2]= srclen >> 8; - dest[dstlen-1]= srclen & 0xFF; - } - else if (dstlen > srclen) + if (dstlen > srclen) bfill(dest + srclen, dstlen - srclen, 0); - return dstlen; } @@ -496,7 +481,7 @@ static MY_COLLATION_HANDLER my_collation_binary_handler = my_strnncoll_binary, my_strnncollsp_binary, my_strnxfrm_bin, - my_strnxfrmlen_bin, + my_strnxfrmlen_simple, my_like_range_simple, my_wildcmp_bin, my_strcasecmp_bin, @@ -539,7 +524,7 @@ static MY_CHARSET_HANDLER my_charset_handler= CHARSET_INFO my_charset_bin = { 63,0,0, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY|MY_CS_STRNXFRM,/* state */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */ "binary", /* cs name */ "binary", /* name */ "", /* comment */ From aff8dbe130b08c167c0284c53713318c26da9558 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Fri, 14 Oct 2005 01:22:24 +0400 Subject: [PATCH 111/322] Fix bug #13855 select distinct with group by caused server crash DISTINCT wasn't optimized away and caused creation of tmp table in wrong case. This result in integer overrun and running out of memory. Fix backported from 4.1. Now if optimizer founds that in result be only 1 row it removes distinct. --- mysql-test/r/select.result | 8 ++++++++ mysql-test/t/select.test | 9 +++++++++ sql/sql_select.cc | 1 + 3 files changed, 18 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 11a50d6cabc..98d474821c9 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2477,3 +2477,11 @@ a b c d 1 2 2 1 1 2 3 1 DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 2607a00bed4..984b467d435 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2013,3 +2013,12 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; DROP TABLE IF EXISTS t1, t2; +# +# Bug #13855 select distinct with group by caused server crash +# +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +drop table t1,t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7c2c233d754..46f0139a608 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -626,6 +626,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, { order=0; // The output has only one row simple_order=1; + select_distinct= 0; // No need in distinct for 1 row } calc_group_buffer(&join,group); From c6c4f03282e006d28924dc3f1c2ab2c1abe657e2 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 14 Oct 2005 00:03:30 +0200 Subject: [PATCH 112/322] configure.in: rc => GA --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index adc4af3c8f3..c700c5b9896 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.15-rc) +AM_INIT_AUTOMAKE(mysql, 5.0.15) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -19,7 +19,7 @@ SHARED_LIB_VERSION=15:0:0 NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 NDB_VERSION_BUILD=15 -NDB_VERSION_STATUS="rc" +NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 From bae115423598ae7019a18cb8a8377987c0faca30 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Oct 2005 15:32:31 -0700 Subject: [PATCH 113/322] Fix calculation of TIMESTAMPDIFF() of months and years. (Bug #13534) --- mysql-test/r/func_time.result | 51 ++++++++++++++++++++++++++++ mysql-test/t/func_time.test | 24 +++++++++++++ sql/item_timefunc.cc | 63 ++++++++++++----------------------- 3 files changed, 96 insertions(+), 42 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 9275a893309..64dafa132b4 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -760,3 +760,54 @@ call t_sysdate(); @a != @b 1 drop procedure t_sysdate; +select timestampdiff(month,'2004-09-11','2004-09-11'); +timestampdiff(month,'2004-09-11','2004-09-11') +0 +select timestampdiff(month,'2004-09-11','2005-09-11'); +timestampdiff(month,'2004-09-11','2005-09-11') +12 +select timestampdiff(month,'2004-09-11','2006-09-11'); +timestampdiff(month,'2004-09-11','2006-09-11') +24 +select timestampdiff(month,'2004-09-11','2007-09-11'); +timestampdiff(month,'2004-09-11','2007-09-11') +36 +select timestampdiff(month,'2005-09-11','2004-09-11'); +timestampdiff(month,'2005-09-11','2004-09-11') +-12 +select timestampdiff(month,'2005-09-11','2003-09-11'); +timestampdiff(month,'2005-09-11','2003-09-11') +-24 +select timestampdiff(month,'2004-02-28','2005-02-28'); +timestampdiff(month,'2004-02-28','2005-02-28') +12 +select timestampdiff(month,'2004-02-29','2005-02-28'); +timestampdiff(month,'2004-02-29','2005-02-28') +11 +select timestampdiff(month,'2004-02-28','2005-02-28'); +timestampdiff(month,'2004-02-28','2005-02-28') +12 +select timestampdiff(month,'2004-03-29','2005-03-28'); +timestampdiff(month,'2004-03-29','2005-03-28') +11 +select timestampdiff(month,'2003-02-28','2004-02-29'); +timestampdiff(month,'2003-02-28','2004-02-29') +12 +select timestampdiff(month,'2003-02-28','2005-02-28'); +timestampdiff(month,'2003-02-28','2005-02-28') +24 +select timestampdiff(month,'1999-09-11','2001-10-10'); +timestampdiff(month,'1999-09-11','2001-10-10') +24 +select timestampdiff(month,'1999-09-11','2001-9-11'); +timestampdiff(month,'1999-09-11','2001-9-11') +24 +select timestampdiff(year,'1999-09-11','2001-9-11'); +timestampdiff(year,'1999-09-11','2001-9-11') +2 +select timestampdiff(year,'2004-02-28','2005-02-28'); +timestampdiff(year,'2004-02-28','2005-02-28') +1 +select timestampdiff(year,'2004-02-29','2005-02-28'); +timestampdiff(year,'2004-02-29','2005-02-28') +0 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 3dd7f7276fb..3a2eea59bed 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -404,4 +404,28 @@ delimiter ;// call t_sysdate(); drop procedure t_sysdate; +# +# Bug #13534: timestampdiff() returned incorrect results across leap years +# +select timestampdiff(month,'2004-09-11','2004-09-11'); +select timestampdiff(month,'2004-09-11','2005-09-11'); +select timestampdiff(month,'2004-09-11','2006-09-11'); +select timestampdiff(month,'2004-09-11','2007-09-11'); +select timestampdiff(month,'2005-09-11','2004-09-11'); +select timestampdiff(month,'2005-09-11','2003-09-11'); + +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-02-29','2005-02-28'); +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-03-29','2005-03-28'); +select timestampdiff(month,'2003-02-28','2004-02-29'); +select timestampdiff(month,'2003-02-28','2005-02-28'); + +select timestampdiff(month,'1999-09-11','2001-10-10'); +select timestampdiff(month,'1999-09-11','2001-9-11'); + +select timestampdiff(year,'1999-09-11','2001-9-11'); +select timestampdiff(year,'2004-02-28','2005-02-28'); +select timestampdiff(year,'2004-02-29','2005-02-28'); + # End of 5.0 tests diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 7f94c19647e..459b5a22cb1 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2723,16 +2723,16 @@ longlong Item_func_timestamp_diff::val_int() int_type == INTERVAL_QUARTER || int_type == INTERVAL_MONTH) { - uint year; - uint year_beg, year_end, month_beg, month_end; - uint diff_days= (uint) (seconds/86400L); - uint diff_years= 0; + uint year_beg, year_end, month_beg, month_end, day_beg, day_end; + uint years= 0; if (neg == -1) { year_beg= ltime2.year; year_end= ltime1.year; month_beg= ltime2.month; month_end= ltime1.month; + day_beg= ltime2.day; + day_end= ltime1.day; } else { @@ -2740,53 +2740,32 @@ longlong Item_func_timestamp_diff::val_int() year_end= ltime2.year; month_beg= ltime1.month; month_end= ltime2.month; - } - /* calc years*/ - for (year= year_beg;year < year_end; year++) - { - uint days=calc_days_in_year(year); - if (days > diff_days) - break; - diff_days-= days; - diff_years++; + day_beg= ltime1.day; + day_end= ltime2.day; } - /* calc months; Current year is in the 'year' variable */ - month_beg--; /* Change months to be 0-11 for easier calculation */ - month_end--; + /* calc years */ + years= year_end - year_beg; + if (month_end < month_beg || (month_end == month_beg && day_end < day_beg)) + years-= 1; - months= 12*diff_years; - while (month_beg != month_end) - { - uint m_days= (uint) days_in_month[month_beg]; - if (month_beg == 1) - { - /* This is only calculated once so there is no reason to cache it*/ - uint leap= (uint) ((year & 3) == 0 && (year%100 || - (year%400 == 0 && year))); - m_days+= leap; - } - if (m_days > diff_days) - break; - diff_days-= m_days; - months++; - if (month_beg++ == 11) /* if we wrap to next year */ - { - month_beg= 0; - year++; - } - } - if (neg == -1) - months= -months; + /* calc months */ + months= 12*years; + if (month_end < month_beg || (month_end == month_beg && day_end < day_beg)) + months+= 12 - (month_beg - month_end); + else + months+= (month_end - month_beg); + if (day_end < day_beg) + months-= 1; } switch (int_type) { case INTERVAL_YEAR: - return months/12; + return months/12*neg; case INTERVAL_QUARTER: - return months/3; + return months/3*neg; case INTERVAL_MONTH: - return months; + return months*neg; case INTERVAL_WEEK: return seconds/86400L/7L*neg; case INTERVAL_DAY: From 0abcffcb5df992724794582f21bbcdb552fa6d98 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Fri, 14 Oct 2005 01:14:23 +0200 Subject: [PATCH 114/322] WL#2835: Base64 mysys functions --- .../util/Base64.hpp => include/base64.h | 41 ++- mysys/Makefile.am | 7 +- mysys/base64.c | 265 ++++++++++++++++++ ndb/config/type_ndbapi.mk.am | 4 +- ndb/config/type_util.mk.am | 7 +- ndb/src/common/util/Base64.cpp | 212 -------------- ndb/src/common/util/Makefile.am | 2 +- ndb/src/common/util/Parser.cpp | 7 +- ndb/src/mgmapi/mgmapi.cpp | 14 +- ndb/src/mgmsrv/Services.cpp | 12 +- 10 files changed, 330 insertions(+), 241 deletions(-) rename ndb/include/util/Base64.hpp => include/base64.h (53%) create mode 100644 mysys/base64.c delete mode 100644 ndb/src/common/util/Base64.cpp diff --git a/ndb/include/util/Base64.hpp b/include/base64.h similarity index 53% rename from ndb/include/util/Base64.hpp rename to include/base64.h index f4b11ad9214..fcc2f8b40dc 100644 --- a/ndb/include/util/Base64.hpp +++ b/include/base64.h @@ -14,15 +14,38 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __BASE64_HPP_INCLUDED__ -#define __BASE64_HPP_INCLUDED__ +#ifndef __BASE64_H_INCLUDED__ +#define __BASE64_H_INCLUDED__ -#include -#include +#ifdef __cplusplus +extern "C" { +#endif -int base64_encode(const UtilBuffer &src, BaseString &dst); -int base64_encode(const void * s, size_t src_len, BaseString &dst); -int base64_decode(const BaseString &src, UtilBuffer &dst); -int base64_decode(const char * s, size_t len, UtilBuffer &dst); -#endif /* !__BASE64_HPP_INCLUDED__ */ +#include + +/* + Calculate how much memory needed for dst of base64_encode() +*/ +int base64_needed_encoded_length(int length_of_data); + +/* + Calculate how much memory needed for dst of base64_decode() +*/ +int base64_needed_decoded_length(int length_of_encoded_data); + +/* + Encode data as a base64 string +*/ +int base64_encode(const void *src, size_t src_len, char *dst); + +/* + Decode a base64 string into data +*/ +int base64_decode(const char *src, size_t src_len, void *dst); + + +#ifdef __cplusplus +} +#endif +#endif /* !__BASE64_H_INCLUDED__ */ diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 9c58c18cf59..ee0dcb544b6 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -55,7 +55,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ my_gethostbyname.c rijndael.c my_aes.c sha1.c \ my_handler.c my_netware.c my_largepage.c \ - my_windac.c my_access.c + my_windac.c my_access.c base64.c EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ thr_mutex.c thr_rwlock.c libmysys_a_LIBADD = @THREAD_LOBJECTS@ @@ -116,5 +116,10 @@ test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES) $(LINK) $(FLAGS) -DMAIN ./test_gethwaddr.c $(LDADD) $(LIBS) $(RM) -f ./test_gethwaddr.c +test_base64$(EXEEXT): base64.c $(LIBRARIES) + $(CP) $(srcdir)/base64.c ./test_base64.c + $(LINK) $(FLAGS) -DMAIN ./test_base64.c $(LDADD) $(LIBS) + $(RM) -f ./test_base64.c + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/mysys/base64.c b/mysys/base64.c new file mode 100644 index 00000000000..d4ddf333c84 --- /dev/null +++ b/mysys/base64.c @@ -0,0 +1,265 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include // strchr() + +#ifndef MAIN + +static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + +int +base64_needed_encoded_length(int length_of_data) +{ + return ceil(length_of_data * 4 / 3) /* base64 chars */ + + ceil(length_of_data / (76 * 3 / 4)) /* Newlines */ + + 3 /* Padding */; +} + + +int +base64_needed_decoded_length(int length_of_encoded_data) +{ + return ceil(length_of_encoded_data * 3 / 4); +} + + +/* + Encode a data as base64. + + Note: We require that dst is pre-allocated to correct size. + See base64_needed_encoded_length(). +*/ + +int +base64_encode(const void *src, size_t src_len, char *dst) +{ + const unsigned char *s= (const unsigned char*)src; + size_t i= 0; + size_t len= 0; + + for (; i < src_len; len += 4) + { + if (len == 76) + { + len= 0; + *dst++= '\n'; + } + + unsigned c; + c= s[i++]; + c <<= 8; + + if (i < src_len) + c += s[i]; + c <<= 8; + i++; + + if (i < src_len) + c += s[i]; + i++; + + *dst++= base64_table[(c >> 18) & 0x3f]; + *dst++= base64_table[(c >> 12) & 0x3f]; + + if (i > (src_len + 1)) + *dst++= '='; + else + *dst++= base64_table[(c >> 6) & 0x3f]; + + if (i > src_len) + *dst++= '='; + else + *dst++= base64_table[(c >> 0) & 0x3f]; + } + + return 0; +} + + +static inline unsigned +pos(unsigned char c) +{ + return strchr(base64_table, c) - base64_table; +} + + +#define SKIP_SPACE(src, i, size) \ +{ \ + while (i < size && my_isspace(default_charset_info, * src)) \ + { \ + i++; \ + src++; \ + } \ + if (i == size) \ + { \ + i= size + 1; \ + break; \ + } \ +} + + +/* + Decode a base64 string + + Note: We require that dst is pre-allocated to correct size. + See base64_needed_decoded_length(). + + RETURN Number of bytes produced in dst or -1 in case of failure +*/ +int +base64_decode(const char *src, size_t size, void *dst) +{ + char b[3]; + size_t i= 0; + void *d= dst; + size_t j; + + while (i < size) + { + unsigned c= 0; + size_t mark= 0; + + SKIP_SPACE(src, i, size); + + c += pos(*src++); + c <<= 6; + i++; + + SKIP_SPACE(src, i, size); + + c += pos(*src++); + c <<= 6; + i++; + + SKIP_SPACE(src, i, size); + + if (* src != '=') + c += pos(*src++); + else + { + i= size; + mark= 2; + c <<= 6; + goto end; + } + c <<= 6; + i++; + + SKIP_SPACE(src, i, size); + + if (*src != '=') + c += pos(*src++); + else + { + i= size; + mark= 1; + goto end; + } + i++; + + end: + b[0]= (c >> 16) & 0xff; + b[1]= (c >> 8) & 0xff; + b[2]= (c >> 0) & 0xff; + + for (j=0; j<3-mark; j++) + *(char *)d++= b[j]; + } + + if (i != size) + { + return -1; + } + return d - dst; +} + + +#else /* MAIN */ + +#define require(b) { \ + if (!(b)) { \ + printf("Require failed at %s:%d\n", __FILE__, __LINE__); \ + abort(); \ + } \ +} + + +int +main(void) +{ + int i; + size_t j; + size_t k, l; + size_t dst_len; + + for (i= 0; i < 500; i++) + { + /* Create source data */ + const size_t src_len= rand() % 1000 + 1; + + char * src= (char *) malloc(src_len); + char * s= src; + + for (j= 0; j -#include - -static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - -int -base64_encode(const UtilBuffer &src, BaseString &dst) -{ - return base64_encode(src.get_data(), src.length(), dst); -} - -int -base64_encode(const void * _s, size_t src_len, BaseString &dst) { - const unsigned char * s = (const unsigned char*)_s; - size_t i = 0; - size_t len = 0; - while(i < src_len) { - if(len == 76){ - len = 0; - dst.append('\n'); - } - - unsigned c; - c = s[i++]; - c <<= 8; - - if(i < src_len) - c += s[i]; - c <<= 8; - i++; - - if(i < src_len) - c += s[i]; - i++; - - dst.append(base64_table[(c >> 18) & 0x3f]); - dst.append(base64_table[(c >> 12) & 0x3f]); - - if(i > (src_len + 1)) - dst.append('='); - else - dst.append(base64_table[(c >> 6) & 0x3f]); - - if(i > src_len) - dst.append('='); - else - dst.append(base64_table[(c >> 0) & 0x3f]); - - len += 4; - } - return 0; -} - -static inline unsigned -pos(unsigned char c) { - return strchr(base64_table, c) - base64_table; -} - - -int -base64_decode(const BaseString &src, UtilBuffer &dst) { - return base64_decode(src.c_str(), src.length(), dst); -} - -#define SKIP_SPACE(src, i, size){ \ - while(i < size && isspace(* src)){ \ - i++; \ - src++; \ - } \ - if(i == size){ \ - i = size + 1; \ - break; \ - } \ -} - -int -base64_decode(const char * src, size_t size, UtilBuffer &dst) { - size_t i = 0; - while(i < size){ - unsigned c = 0; - int mark = 0; - - SKIP_SPACE(src, i, size); - - c += pos(*src++); - c <<= 6; - i++; - - SKIP_SPACE(src, i, size); - - c += pos(*src++); - c <<= 6; - i++; - - SKIP_SPACE(src, i, size); - - if(* src != '=') - c += pos(*src++); - else { - i = size; - mark = 2; - c <<= 6; - goto end; - } - c <<= 6; - i++; - - SKIP_SPACE(src, i, size); - - if(*src != '=') - c += pos(*src++); - else { - i = size; - mark = 1; - goto end; - } - i++; - - end: - char b[3]; - b[0] = (c >> 16) & 0xff; - b[1] = (c >> 8) & 0xff; - b[2] = (c >> 0) & 0xff; - - dst.append((void *)b, 3-mark); - } - - if(i != size){ - abort(); - return -1; - } - return 0; -} - -#ifdef __TEST__B64 -/** - * USER_FLAGS="-D__TEST__B64" make Base64.o && g++ Base64.o BaseString.o - */ -inline -void -require(bool b){ - if(!b) - abort(); -} - -int -main(void){ - for(int i = 0; i < 500; i++){ - const size_t len = rand() % 10000 + 1; - UtilBuffer src; - for(size_t j = 0; j%s<\n", str.c_str()); - } - - UtilBuffer dst; - require(base64_decode(str, dst) == 0); - require(dst.length() == src.length()); - - const char * c_src = (char*)src.get_data(); - const char * c_dst = (char*)dst.get_data(); - if(memcmp(src.get_data(), dst.get_data(), src.length()) != 0){ - printf("-- src --\n"); - for(int i2 = 0; i2 #include -#include #undef DEBUG #define DEBUG(x) ndbout << x << endl; @@ -316,11 +315,7 @@ ParserImpl::parseArg(Context * ctx, } case DummyRow::Properties: { - Properties *sp = new Properties(); - BaseString v(value); - UtilBuffer b; - base64_decode(v, b); - sp->unpack((const Uint32 *)b.get_data(), b.length()); + abort(); break; } default: diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 8263e8cbc93..df27b1b358a 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -34,8 +34,8 @@ #include #include #include -#include +#include #define MGM_CMD(name, fun, desc) \ { name, \ @@ -1770,11 +1770,15 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { } while(start < len); if(buf64 == 0) break; - + + void *tmp_data = malloc(base64_needed_decoded_length((size_t) (len - 1))); + const int res = base64_decode(buf64, len-1, tmp_data); + delete[] buf64; UtilBuffer tmp; - const int res = base64_decode(buf64, len-1, tmp); - delete[] buf64; - if(res != 0){ + tmp.append((void *) tmp_data, res); + free(tmp_data); + if (res < 0) + { fprintf(handle->errstream, "Failed to decode buffer\n"); break; } diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index ed32ab9c963..9a4980eefdc 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -33,6 +32,8 @@ #include "Services.hpp" #include "../mgmapi/ndb_logevent.hpp" +#include + extern bool g_StopServer; static const unsigned int MAX_READ_TIMEOUT = 1000 ; @@ -598,17 +599,18 @@ MgmApiSession::getConfig_common(Parser_t::Context &, cfg->pack(src); NdbMutex_Unlock(m_mgmsrv.m_configMutex); - BaseString str; - int res = base64_encode(src, str); + char *tmp_str = (char *) malloc(base64_needed_encoded_length(src.length())); + int res = base64_encode(src.get_data(), src.length(), tmp_str); m_output->println("get config reply"); m_output->println("result: Ok"); - m_output->println("Content-Length: %d", str.length()); + m_output->println("Content-Length: %d", strlen(tmp_str)); m_output->println("Content-Type: ndbconfig/octet-stream"); m_output->println("Content-Transfer-Encoding: base64"); m_output->println(""); - m_output->println(str.c_str()); + m_output->println(tmp_str); + free(tmp_str); return; } From c9d1e83edd1379d8159494777589b61786419c64 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 14 Oct 2005 01:46:26 +0200 Subject: [PATCH 115/322] configure.in: New version 5.0.16 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index adc4af3c8f3..40ff480bb94 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.15-rc) +AM_INIT_AUTOMAKE(mysql, 5.0.16) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -18,8 +18,8 @@ SHARED_LIB_VERSION=15:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=15 -NDB_VERSION_STATUS="rc" +NDB_VERSION_BUILD=16 +NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 From a662bbe132aeedef0b38c9b3e647b6fae320a4e2 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 14 Oct 2005 03:19:22 +0200 Subject: [PATCH 116/322] .del-mysqlwatch.vcproj~91c7061bceb731ad: Delete: VC++Files/mysqlwatch/mysqlwatch.vcproj .del-mysqlshutdown.vcproj~b956e6769cf4fe76: Delete: VC++Files/mysqlshutdown/mysqlshutdown.vcproj .del-pack_isam_ia64.dsp~6172aec32da6de5d: Delete: VC++Files/pack_isam/pack_isam_ia64.dsp .del-pack_isam.vcproj~82b3c430c0c623f2: Delete: VC++Files/pack_isam/pack_isam.vcproj .del-pack_isam.dsp~1f236852e0bcc13d: Delete: VC++Files/pack_isam/pack_isam.dsp .del-isamchk_ia64.dsp~abb473e7d3025305: Delete: VC++Files/isamchk/isamchk_ia64.dsp .del-isamchk.vcproj~19838e6a73320284: Delete: VC++Files/isamchk/isamchk.vcproj .del-isamchk.dsp~6349525f4cf767a4: Delete: VC++Files/isamchk/isamchk.dsp .del-isam_ia64.dsp~e6dffc47e113891: Delete: VC++Files/isam/isam_ia64.dsp .del-isam.vcproj~53282403e12348c3: Delete: VC++Files/isam/isam.vcproj .del-isam.dsw~c64a212cb134161a: Delete: VC++Files/isam/isam.dsw .del-isam.dsp~9c26247a621084bf: Delete: VC++Files/isam/isam.dsp mysql.sln: Removed isam from Visual Studio .Net project files, accidently merged over from 4.1 --- VC++Files/isam/isam.dsp | 260 ---- VC++Files/isam/isam.dsw | 28 - VC++Files/isam/isam.vcproj | 1283 ------------------ VC++Files/isam/isam_ia64.dsp | 260 ---- VC++Files/isamchk/isamchk.dsp | 129 -- VC++Files/isamchk/isamchk.vcproj | 272 ---- VC++Files/isamchk/isamchk_ia64.dsp | 100 -- VC++Files/mysql.sln | 171 --- VC++Files/mysqlshutdown/mysqlshutdown.vcproj | 162 --- VC++Files/mysqlwatch/mysqlwatch.vcproj | 93 -- VC++Files/pack_isam/pack_isam.dsp | 130 -- VC++Files/pack_isam/pack_isam.vcproj | 244 ---- VC++Files/pack_isam/pack_isam_ia64.dsp | 133 -- 13 files changed, 3265 deletions(-) delete mode 100644 VC++Files/isam/isam.dsp delete mode 100644 VC++Files/isam/isam.dsw delete mode 100644 VC++Files/isam/isam.vcproj delete mode 100644 VC++Files/isam/isam_ia64.dsp delete mode 100644 VC++Files/isamchk/isamchk.dsp delete mode 100644 VC++Files/isamchk/isamchk.vcproj delete mode 100644 VC++Files/isamchk/isamchk_ia64.dsp delete mode 100644 VC++Files/mysqlshutdown/mysqlshutdown.vcproj delete mode 100644 VC++Files/mysqlwatch/mysqlwatch.vcproj delete mode 100644 VC++Files/pack_isam/pack_isam.dsp delete mode 100644 VC++Files/pack_isam/pack_isam.vcproj delete mode 100644 VC++Files/pack_isam/pack_isam_ia64.dsp diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp deleted file mode 100644 index 759a1b6ee03..00000000000 --- a/VC++Files/isam/isam.dsp +++ /dev/null @@ -1,260 +0,0 @@ -# Microsoft Developer Studio Project File - Name="isam" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=isam - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "isam.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "isam.mak" CFG="isam - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - Win32 TLS" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "isam - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=xilink6.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_release\isam.lib" - -!ELSEIF "$(CFG)" == "isam - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "debug" -# PROP Intermediate_Dir "debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=xilink6.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib" - -!ELSEIF "$(CFG)" == "isam - Win32 TLS_DEBUG" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "isam___Win32_TLS_DEBUG" -# PROP BASE Intermediate_Dir "isam___Win32_TLS_DEBUG" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "isam___Win32_TLS_DEBUG" -# PROP Intermediate_Dir "isam___Win32_TLS_DEBUG" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" - -!ELSEIF "$(CFG)" == "isam - Win32 TLS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "isam___Win32_TLS" -# PROP BASE Intermediate_Dir "isam___Win32_TLS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "isam___Win32_TLS" -# PROP Intermediate_Dir "isam___Win32_TLS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib" - -!ENDIF - -# Begin Target - -# Name "isam - Win32 Release" -# Name "isam - Win32 Debug" -# Name "isam - Win32 TLS_DEBUG" -# Name "isam - Win32 TLS" -# Begin Source File - -SOURCE=.\_cache.c -# End Source File -# Begin Source File - -SOURCE=.\_dbug.c -# End Source File -# Begin Source File - -SOURCE=.\_dynrec.c -# End Source File -# Begin Source File - -SOURCE=.\_key.c -# End Source File -# Begin Source File - -SOURCE=.\_locking.c -# End Source File -# Begin Source File - -SOURCE=.\_packrec.c -# End Source File -# Begin Source File - -SOURCE=.\_page.c -# End Source File -# Begin Source File - -SOURCE=.\_search.c -# End Source File -# Begin Source File - -SOURCE=.\_statrec.c -# End Source File -# Begin Source File - -SOURCE=.\changed.c -# End Source File -# Begin Source File - -SOURCE=.\close.c -# End Source File -# Begin Source File - -SOURCE=.\create.c -# End Source File -# Begin Source File - -SOURCE=.\delete.c -# End Source File -# Begin Source File - -SOURCE=.\extra.c -# End Source File -# Begin Source File - -SOURCE=.\info.c -# End Source File -# Begin Source File - -SOURCE=.\log.c -# End Source File -# Begin Source File - -SOURCE=.\open.c -# End Source File -# Begin Source File - -SOURCE=.\panic.c -# End Source File -# Begin Source File - -SOURCE=.\range.c -# End Source File -# Begin Source File - -SOURCE=.\rfirst.c -# End Source File -# Begin Source File - -SOURCE=.\rkey.c -# End Source File -# Begin Source File - -SOURCE=.\rlast.c -# End Source File -# Begin Source File - -SOURCE=.\rnext.c -# End Source File -# Begin Source File - -SOURCE=.\rprev.c -# End Source File -# Begin Source File - -SOURCE=.\rrnd.c -# End Source File -# Begin Source File - -SOURCE=.\rsame.c -# End Source File -# Begin Source File - -SOURCE=.\rsamepos.c -# End Source File -# Begin Source File - -SOURCE=.\static.c -# End Source File -# Begin Source File - -SOURCE=.\update.c -# End Source File -# Begin Source File - -SOURCE=.\write.c -# End Source File -# End Target -# End Project diff --git a/VC++Files/isam/isam.dsw b/VC++Files/isam/isam.dsw deleted file mode 100644 index c18224a6d73..00000000000 --- a/VC++Files/isam/isam.dsw +++ /dev/null @@ -1,28 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "isam"=".\isam.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### diff --git a/VC++Files/isam/isam.vcproj b/VC++Files/isam/isam.vcproj deleted file mode 100644 index aada6539a1f..00000000000 --- a/VC++Files/isam/isam.vcproj +++ /dev/null @@ -1,1283 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/isam/isam_ia64.dsp b/VC++Files/isam/isam_ia64.dsp deleted file mode 100644 index f9dce0bed4a..00000000000 --- a/VC++Files/isam/isam_ia64.dsp +++ /dev/null @@ -1,260 +0,0 @@ -# Microsoft Developer Studio Project File - Name="isam" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=isam - WinIA64 TLS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "isam.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "isam.mak" CFG="isam - WinIA64 TLS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "isam - WinIA64 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - WinIA64 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - WinIA64 TLS_DEBUG" (based on "Win32 (x86) Static Library") -!MESSAGE "isam - WinIA64 TLS" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "isam - WinIA64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN64" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_release\isam.lib" - -!ELSEIF "$(CFG)" == "isam - WinIA64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "debug" -# PROP Intermediate_Dir "debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN64" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Zi /Od /GF /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib" - -!ELSEIF "$(CFG)" == "isam - WinIA64 TLS_DEBUG" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "isam___WinIA64_TLS_DEBUG" -# PROP BASE Intermediate_Dir "isam___WinIA64_TLS_DEBUG" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "isam___WinIA64_TLS_DEBUG" -# PROP Intermediate_Dir "isam___WinIA64_TLS_DEBUG" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /GF /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MTd /W3 /Zi /O2 /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" - -!ELSEIF "$(CFG)" == "isam - WinIA64 TLS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "isam___WinIA64_TLS" -# PROP BASE Intermediate_Dir "isam___WinIA64_TLS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "isam___WinIA64_TLS" -# PROP Intermediate_Dir "isam___WinIA64_TLS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib" - -!ENDIF - -# Begin Target - -# Name "isam - WinIA64 Release" -# Name "isam - WinIA64 Debug" -# Name "isam - WinIA64 TLS_DEBUG" -# Name "isam - WinIA64 TLS" -# Begin Source File - -SOURCE=.\_cache.c -# End Source File -# Begin Source File - -SOURCE=.\_dbug.c -# End Source File -# Begin Source File - -SOURCE=.\_dynrec.c -# End Source File -# Begin Source File - -SOURCE=.\_key.c -# End Source File -# Begin Source File - -SOURCE=.\_locking.c -# End Source File -# Begin Source File - -SOURCE=.\_packrec.c -# End Source File -# Begin Source File - -SOURCE=.\_page.c -# End Source File -# Begin Source File - -SOURCE=.\_search.c -# End Source File -# Begin Source File - -SOURCE=.\_statrec.c -# End Source File -# Begin Source File - -SOURCE=.\changed.c -# End Source File -# Begin Source File - -SOURCE=.\close.c -# End Source File -# Begin Source File - -SOURCE=.\create.c -# End Source File -# Begin Source File - -SOURCE=.\delete.c -# End Source File -# Begin Source File - -SOURCE=.\extra.c -# End Source File -# Begin Source File - -SOURCE=.\info.c -# End Source File -# Begin Source File - -SOURCE=.\log.c -# End Source File -# Begin Source File - -SOURCE=.\open.c -# End Source File -# Begin Source File - -SOURCE=.\panic.c -# End Source File -# Begin Source File - -SOURCE=.\range.c -# End Source File -# Begin Source File - -SOURCE=.\rfirst.c -# End Source File -# Begin Source File - -SOURCE=.\rkey.c -# End Source File -# Begin Source File - -SOURCE=.\rlast.c -# End Source File -# Begin Source File - -SOURCE=.\rnext.c -# End Source File -# Begin Source File - -SOURCE=.\rprev.c -# End Source File -# Begin Source File - -SOURCE=.\rrnd.c -# End Source File -# Begin Source File - -SOURCE=.\rsame.c -# End Source File -# Begin Source File - -SOURCE=.\rsamepos.c -# End Source File -# Begin Source File - -SOURCE=.\static.c -# End Source File -# Begin Source File - -SOURCE=.\update.c -# End Source File -# Begin Source File - -SOURCE=.\write.c -# End Source File -# End Target -# End Project diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp deleted file mode 100644 index 2026be94ea0..00000000000 --- a/VC++Files/isamchk/isamchk.dsp +++ /dev/null @@ -1,129 +0,0 @@ -# Microsoft Developer Studio Project File - Name="isamchk" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=isamchk - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "isamchk.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "isamchk.mak" CFG="isamchk - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "isamchk - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "isamchk - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "isamchk - Win32 classic" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "isamchk - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x41d /d "NDEBUG" -# ADD RSC /l 0x41d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "isamchk - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "isamchk_" -# PROP BASE Intermediate_Dir "isamchk_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "debug" -# PROP Intermediate_Dir "debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /Fr /YX -# ADD BASE RSC /l 0x41d /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept -# SUBTRACT LINK32 /verbose /pdb:none - -!ELSEIF "$(CFG)" == "isamchk - Win32 classic" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "isamchk___Win32_classic" -# PROP BASE Intermediate_Dir "isamchk___Win32_classic" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "classic" -# PROP Intermediate_Dir "classic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x41d /d "NDEBUG" -# ADD RSC /l 0x41d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "isamchk - Win32 Release" -# Name "isamchk - Win32 Debug" -# Name "isamchk - Win32 classic" -# Begin Source File - -SOURCE=..\isam\isamchk.c -# End Source File -# Begin Source File - -SOURCE=..\isam\sort.c -# End Source File -# End Target -# End Project diff --git a/VC++Files/isamchk/isamchk.vcproj b/VC++Files/isamchk/isamchk.vcproj deleted file mode 100644 index d0a66635c8f..00000000000 --- a/VC++Files/isamchk/isamchk.vcproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/isamchk/isamchk_ia64.dsp b/VC++Files/isamchk/isamchk_ia64.dsp deleted file mode 100644 index 61eab230e1f..00000000000 --- a/VC++Files/isamchk/isamchk_ia64.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="isamchk" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=isamchk - WinIA64 classic -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "isamchk_ia64.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "isamchk_ia64.mak" CFG="isamchk - WinIA64 classic" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "isamchk - WinIA64 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "isamchk - WinIA64 classic" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "isamchk - WinIA64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN64" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x41d /d "NDEBUG" -# ADD RSC /l 0x41d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:IA64 -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /out:"../client_release/isamchk.exe" /machine:IA64 - -!ELSEIF "$(CFG)" == "isamchk - WinIA64 classic" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "isamchk___WinIA64_classic" -# PROP BASE Intermediate_Dir "isamchk___WinIA64_classic" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "classic" -# PROP Intermediate_Dir "classic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x41d /d "NDEBUG" -# ADD RSC /l 0x41d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /out:"../client_release/isamchk.exe" /machine:IA64 -# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\" /machine:IA64 - -!ENDIF - -# Begin Target - -# Name "isamchk - WinIA64 Release" -# Name "isamchk - WinIA64 classic" -# Begin Source File - -SOURCE=..\isam\isamchk.c -# End Source File -# Begin Source File - -SOURCE=..\isam\sort.c -# End Source File -# End Target -# End Project diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index ae3b9290cce..a2f6f0cd062 100644 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -58,10 +58,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "my_print_defaults", "my_pri {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isam", "isam\isam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam", "myisam\myisam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D2}" ProjectSection(ProjectDependencies) = postProject EndProjectSection @@ -74,15 +70,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam_ftdump", "myisam_ftd {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isamchk", "isamchk\isamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0E}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D3} = {262280A8-37D5-4037-BDFB-242468DFB3D3} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamchk", "myisamchk\myisamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0F}" ProjectSection(ProjectDependencies) = postProject {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} @@ -105,15 +92,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisammrg", "myisammrg\myis ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pack_isam", "pack_isam\pack_isam.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CD}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D3} = {262280A8-37D5-4037-BDFB-242468DFB3D3} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisampack", "myisampack\myisampack.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CC}" ProjectSection(ProjectDependencies) = postProject {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} @@ -180,20 +158,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldemb", "mysqldemb\mysq ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlshutdown", "mysqlshutdown\mysqlshutdown.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92D}" - ProjectSection(ProjectDependencies) = postProject - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlwatch", "mysqlwatch\mysqlwatch.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92C}" - ProjectSection(ProjectDependencies) = postProject - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldump", "client\mysqldump.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92B}" ProjectSection(ProjectDependencies) = postProject {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} @@ -628,33 +592,6 @@ Global {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl nt.Build.0 = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.classic nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Debug.ActiveCfg = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Debug.Build.0 = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Classic.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Pro.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_ProGPL.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Embedded_Release.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Max nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.pro gpl nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D3}.Release.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.Build.0 = Release|Win32 {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.ActiveCfg = Release|Win32 @@ -709,33 +646,6 @@ Global {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl nt.Build.0 = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic.ActiveCfg = classic|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic.Build.0 = classic|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.classic nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Debug.Build.0 = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Classic.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Pro.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_ProGPL.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Embedded_Release.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Max nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.pro gpl nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0E}.Release.Build.0 = Release|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.Build.0 = classic|Win32 {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.ActiveCfg = Release|Win32 @@ -822,33 +732,6 @@ Global {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl nt.Build.0 = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic.Build.0 = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.classic nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Debug.ActiveCfg = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Debug.Build.0 = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Classic.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Debug.ActiveCfg = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Pro.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_ProGPL.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Embedded_Release.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Max nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.pro gpl nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CD}.Release.Build.0 = Release|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.Build.0 = classic|Win32 {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.ActiveCfg = Release|Win32 @@ -1065,60 +948,6 @@ Global {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl nt.Build.0 = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.classic nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Debug.Build.0 = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Classic.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Pro.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_ProGPL.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Embedded_Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Max nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.pro gpl nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92C}.Release.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.classic nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Debug.Build.0 = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Classic.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Pro.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_ProGPL.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Embedded_Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Max nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.pro gpl nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92D}.Release.Build.0 = Release|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.Build.0 = classic|Win32 {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.ActiveCfg = classic|Win32 diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.vcproj b/VC++Files/mysqlshutdown/mysqlshutdown.vcproj deleted file mode 100644 index 60b6a810b61..00000000000 --- a/VC++Files/mysqlshutdown/mysqlshutdown.vcproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysqlwatch/mysqlwatch.vcproj b/VC++Files/mysqlwatch/mysqlwatch.vcproj deleted file mode 100644 index 25102603dc0..00000000000 --- a/VC++Files/mysqlwatch/mysqlwatch.vcproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp deleted file mode 100644 index f5f8f0bcd7a..00000000000 --- a/VC++Files/pack_isam/pack_isam.dsp +++ /dev/null @@ -1,130 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pack_isam" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=pack_isam - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pack_isam.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pack_isam.mak" CFG="pack_isam - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pack_isam - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pack_isam - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pack_isam - Win32 classic" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "pack_isam - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe" - -!ELSEIF "$(CFG)" == "pack_isam - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "debug" -# PROP Intermediate_Dir "debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /Fr -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept - -!ELSEIF "$(CFG)" == "pack_isam - Win32 classic" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pack_isam___Win32_classic" -# PROP BASE Intermediate_Dir "pack_isam___Win32_classic" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "classic" -# PROP Intermediate_Dir "classic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe" -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\" - -!ENDIF - -# Begin Target - -# Name "pack_isam - Win32 Release" -# Name "pack_isam - Win32 Debug" -# Name "pack_isam - Win32 classic" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\isam\pack_isam.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VC++Files/pack_isam/pack_isam.vcproj b/VC++Files/pack_isam/pack_isam.vcproj deleted file mode 100644 index 15a47439924..00000000000 --- a/VC++Files/pack_isam/pack_isam.vcproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/pack_isam/pack_isam_ia64.dsp b/VC++Files/pack_isam/pack_isam_ia64.dsp deleted file mode 100644 index 58b88f02f08..00000000000 --- a/VC++Files/pack_isam/pack_isam_ia64.dsp +++ /dev/null @@ -1,133 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pack_isam" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=pack_isam - WinIA64 classic -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pack_isam_ia64.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pack_isam_ia64.mak" CFG="pack_isam - WinIA64 classic" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pack_isam - WinIA64 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pack_isam - WinIA64 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pack_isam - WinIA64 classic" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pack_isam - WinIA64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "release" -# PROP Intermediate_Dir "release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WinIA64" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:IA64 -# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/pack_isam.exe" /machine:IA64 - -!ELSEIF "$(CFG)" == "pack_isam - WinIA64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "debug" -# PROP Intermediate_Dir "debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WinIA64" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Zi /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# SUBTRACT CPP /Fr -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:IA64 -# ADD LINK32 ..\lib_debug\dbug.lib ..\lib_debug\isam.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/pack_isam.exe" /machine:IA64 - -!ELSEIF "$(CFG)" == "pack_isam - WinIA64 classic" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pack_isam___WinIA64 _classic" -# PROP BASE Intermediate_Dir "pack_isam___WinIA64 _classic" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "classic" -# PROP Intermediate_Dir "classic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c -# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /out:"../client_release/pack_isam.exe" /machine:IA64 -# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\" /machine:IA64 - -!ENDIF - -# Begin Target - -# Name "pack_isam - WinIA64 Release" -# Name "pack_isam - WinIA64 Debug" -# Name "pack_isam - WinIA64 classic" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\isam\pack_isam.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project From 66fa2eb7b8d05bb227b89b09a58751e50114195f Mon Sep 17 00:00:00 2001 From: "elliot@mysql.com" <> Date: Thu, 13 Oct 2005 22:17:47 -0400 Subject: [PATCH 117/322] Fix link failure on OS X --- ndb/src/mgmsrv/Services.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 9d87e33b47f..b94eaa93ea5 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -1574,4 +1574,3 @@ MgmApiSession::report_event(Parser_t::Context &ctx, template class MutexVector; template class Vector const*>; -template class Vector; From 63ac3040a88079cc61728631043b18d535efe152 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Fri, 14 Oct 2005 08:45:41 +0300 Subject: [PATCH 118/322] Small fixes for Netware. --- netware/mysql_test_run.c | 2 +- netware/pack_isam.def | 1 + scripts/make_binary_distribution.sh | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index 7ca242178ff..92ed89b4770 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -173,7 +173,7 @@ void report_stats() log_msg("\nFailed %u/%u test(s), %.02f%% successful.\n", total_fail, total_test, percent); log_msg("\nThe .out and .err files in %s may give you some\n", result_dir); - log_msg("hint of what when wrong.\n"); + log_msg("hint of what went wrong.\n"); log_msg("\nIf you want to report this error, please first read the documentation\n"); log_msg("at: http://www.mysql.com/doc/en/MySQL_test_suite.html\n"); } diff --git a/netware/pack_isam.def b/netware/pack_isam.def index fff74806f39..9ea72a4f2e7 100644 --- a/netware/pack_isam.def +++ b/netware/pack_isam.def @@ -2,6 +2,7 @@ # Pack ISAM #------------------------------------------------------------------------------ MODULE libc.nlm +SCREENNAME "MySQL ISAM Table Pack Tool" COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Pack Tool" SCREENNAME "MySQL ISAM Table Pack Tool" diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index dea41f57e6b..750c98c80e2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -275,8 +275,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ > $BASE/bin/test_db.sql - sh ./scripts/mysql_create_system_tables.sh real >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test > $BASE/bin/test_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # From ea26f5e2ea30e40342f6677223bc4095f18d1866 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Fri, 14 Oct 2005 09:32:30 +0300 Subject: [PATCH 119/322] Had to revert change, because it breaks compilation for Netware. Hartmut informed about this. --- extra/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/Makefile.am b/extra/Makefile.am index 91ec8318f08..457fddce673 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -26,7 +26,7 @@ CLEANFILES = $(BUILT_SOURCES) DIST_SUBDIRS= yassl # This will build mysqld_error.h and sql_state.h -$(top_builddir)/include/mysqld_error.h: comp_err$(EXEEXT) +$(top_builddir)/include/mysqld_error.h: comp_err $(top_builddir)/extra/comp_err \ --charset=$(top_srcdir)/sql/share/charsets \ --out-dir=$(top_builddir)/sql/share/ \ From 25e40bd403d23277b5da3469d210803a22df5409 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 14 Oct 2005 13:24:21 +0500 Subject: [PATCH 120/322] ctype_utf8.result: after merge fix , --- mysql-test/r/ctype_utf8.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 44fb53ec77c..29133c53cf9 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1044,6 +1044,11 @@ hex(a) 5B E880BD drop table t1; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +a +drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; @@ -1126,8 +1131,3 @@ a i ã„ drop table t1,t2; -set names 'latin1'; -create table t1 (a varchar(255)) default charset=utf8; -select * from t1 where find_in_set('-1', a); -a -drop table t1; From 4561014afa8e703e96aa663d13a1ee98e27e93fe Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 14 Oct 2005 11:44:46 +0300 Subject: [PATCH 121/322] Fixed compile errors on windows --- VC++Files/test1/mysql_thr.c | 2 +- VC++Files/thr_test/thr_test.c | 2 +- sql/log_event.cc | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/VC++Files/test1/mysql_thr.c b/VC++Files/test1/mysql_thr.c index de1d936806e..a1ac09f2784 100644 --- a/VC++Files/test1/mysql_thr.c +++ b/VC++Files/test1/mysql_thr.c @@ -33,7 +33,7 @@ typedef CRITICAL_SECTION pthread_mutex_t; #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) -#define pthread_handler_t unsigned __cdecl * +#define pthread_handler_t unsigned __cdecl typedef unsigned (__cdecl *pthread_handler)(void *); #define pthread_self() GetCurrentThread() diff --git a/VC++Files/thr_test/thr_test.c b/VC++Files/thr_test/thr_test.c index 100fcb9c45e..efb9ea27ba7 100644 --- a/VC++Files/thr_test/thr_test.c +++ b/VC++Files/thr_test/thr_test.c @@ -44,7 +44,7 @@ typedef CRITICAL_SECTION pthread_mutex_t; #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) -#define pthread_handler_t unsigned __cdecl * +#define pthread_handler_t unsigned __cdecl typedef unsigned (__cdecl *pthread_handler)(void *); #define pthread_self() GetCurrentThread() diff --git a/sql/log_event.cc b/sql/log_event.cc index 9bc62b30899..2ec63febca4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1160,7 +1160,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, But it's likely that we don't want to use 32 bits for 3 bits; in the future we will probably want to reclaim the 29 bits. So we need the &. */ - flags2= thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG; + flags2= (uint32) (thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG); DBUG_ASSERT(thd->variables.character_set_client->number < 256*256); DBUG_ASSERT(thd->variables.collation_connection->number < 256*256); DBUG_ASSERT(thd->variables.collation_server->number < 256*256); @@ -2984,9 +2984,8 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, llstr(pos_arg, buff), flags)); #endif if (flags & DUP_NAME) - new_log_ident= my_strdup_with_length(new_log_ident_arg, - ident_len, - MYF(MY_WME)); + new_log_ident= my_strdup_with_length((const byte*) new_log_ident_arg, + ident_len, MYF(MY_WME)); DBUG_VOID_RETURN; } #endif From 921803e40944e0e2b7de1aa90841d83502a06c45 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 14 Oct 2005 11:03:40 +0200 Subject: [PATCH 122/322] - revert version number in configure.in to 5.0.15 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 40ff480bb94..7b3a47200be 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.16) +AM_INIT_AUTOMAKE(mysql, 5.0.15) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From dcb347bf8b8556069532524c1a345df8136f7148 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 14 Oct 2005 11:11:19 +0200 Subject: [PATCH 123/322] configure.in: - reverted NDB version number, too --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7b3a47200be..c700c5b9896 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=16 +NDB_VERSION_BUILD=15 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From e7fa41ebf72de22a4c6844df94495706d47a8d66 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 14 Oct 2005 14:19:15 +0500 Subject: [PATCH 124/322] mysql.cc: After merge fix. --- client/mysql.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 989e2dae3ef..3882b61b9ad 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1193,16 +1193,16 @@ static bool add_line(String &buffer,char *line,char *in_string, #ifdef USE_MB int length; if (use_mb(charset_info) && - (lenght= my_ismbchar(charset_info, pos, end_of_line))) + (length= my_ismbchar(charset_info, pos, end_of_line))) { if (!*ml_comment) { - while (lenght--) + while (length--) *out++ = *pos++; pos--; } else - pos+= lenght - 1; + pos+= length - 1; continue; } #endif From f9b58b0805d54d6066687ce5996afc703d54cf7e Mon Sep 17 00:00:00 2001 From: "mskold@mysql.com" <> Date: Fri, 14 Oct 2005 11:23:02 +0200 Subject: [PATCH 125/322] Fix for Bug #13961 Triggers on tables with auto_increment insert bogus values into table (clean version) --- sql/ha_ndbcluster.cc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index c478e565220..608dc3eaa54 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3177,7 +3177,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) { PRINT_OPTION_FLAGS(thd); - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN | OPTION_TABLE_LOCK))) + if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { // Autocommit transaction DBUG_ASSERT(!thd->transaction.stmt.ndb_tid); @@ -3328,11 +3328,11 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) } /* - When using LOCK TABLE's external_lock is only called when the actual - TABLE LOCK is done. - Under LOCK TABLES, each used tables will force a call to start_stmt. - Ndb doesn't currently support table locks, and will do ordinary - startTransaction for each transaction/statement. + Start a transaction for running a statement if one is not + already running in a transaction. This will be the case in + a BEGIN; COMMIT; block + When using LOCK TABLE's external_lock will start a transaction + since ndb does not currently does not support table locking */ int ha_ndbcluster::start_stmt(THD *thd) @@ -3341,16 +3341,13 @@ int ha_ndbcluster::start_stmt(THD *thd) DBUG_ENTER("start_stmt"); PRINT_OPTION_FLAGS(thd); - NdbConnection *trans= (NdbConnection*)thd->transaction.stmt.ndb_tid; + NdbConnection *trans= + (thd->transaction.stmt.ndb_tid) + ? (NdbConnection *)(thd->transaction.stmt.ndb_tid) + : (NdbConnection *)(thd->transaction.all.ndb_tid); if (!trans){ Ndb *ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; DBUG_PRINT("trans",("Starting transaction stmt")); - - NdbConnection *tablock_trans= - (NdbConnection*)thd->transaction.all.ndb_tid; - DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans)); - DBUG_ASSERT(tablock_trans); -// trans= ndb->hupp(tablock_trans); trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(ndb->getNdbError()); @@ -4041,7 +4038,12 @@ longlong ha_ndbcluster::get_auto_increment() --retries && ndb->getNdbError().status == NdbError::TemporaryError); if (auto_value == NDB_FAILED_AUTO_INCREMENT) - ERR_RETURN(ndb->getNdbError()); + { + const NdbError err= ndb->getNdbError(); + sql_print_error("Error %lu in ::get_auto_increment(): %s", + (ulong) err.code, err.message); + DBUG_RETURN(~(ulonglong) 0); + } DBUG_RETURN((longlong)auto_value); } From 58f2a6aa6434f2ec11cf1220b41ce4a94964a46c Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 14 Oct 2005 13:35:36 +0200 Subject: [PATCH 126/322] Change the "Password" column type for the Perl suite running the tests. bug#14023 --- mysql-test/lib/init_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index b366a429ab2..fd7b035e038 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -62,7 +62,7 @@ comment='Host privileges; Merged with database privileges'; CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, - Password binary(41) DEFAULT '' NOT NULL, + Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, From 845b9fbf58365d5832db40fd66cbc55c6280d8e8 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Fri, 14 Oct 2005 15:34:52 +0200 Subject: [PATCH 127/322] fix for Valgrind errors: query_id needs to be inited early (already fixed in 5.0 by Konstantin) and so does client_capabilities (not fixed in 5.0); because they are used by net_printf() and push_warning(), which can be called if check_connection() fails. --- sql/mysqld.cc | 1 - sql/repl_failsafe.cc | 1 - sql/slave.cc | 1 - sql/sql_class.cc | 2 ++ 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bb5402de3fd..e1e87652255 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3460,7 +3460,6 @@ static int bootstrap(FILE *file) THD *thd= new THD; thd->bootstrap=1; - thd->client_capabilities=0; my_net_init(&thd->net,(st_vio*) 0); thd->max_client_packet_length= thd->net.max_packet; thd->master_access= ~(ulong)0; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 2d8e8a5bf81..61fd5d9bce4 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -67,7 +67,6 @@ static int init_failsafe_rpl_thread(THD* thd) */ thd->system_thread = thd->bootstrap = 1; thd->host_or_ip= ""; - thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->max_client_packet_length=thd->net.max_packet; diff --git a/sql/slave.cc b/sql/slave.cc index 2fc4eef0f64..b2862a437bb 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2617,7 +2617,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) thd->system_thread = (thd_type == SLAVE_THD_SQL) ? SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; thd->host_or_ip= ""; - thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->master_access= ~(ulong)0; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 11b45b848c8..947da6b10d6 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -186,6 +186,7 @@ THD::THD() variables.pseudo_thread_id= 0; one_shot_set= 0; file_id = 0; + query_id= 0; warn_id= 0; db_charset= global_system_variables.collation_database; mysys_var=0; @@ -196,6 +197,7 @@ THD::THD() net.vio=0; #endif net.last_error[0]=0; // If error on boot + client_capabilities= 0; // minimalistic client ull=0; system_thread=cleanup_done=0; peer_port= 0; // For SHOW PROCESSLIST From 35c75bebe6f430f064af72e69f3f85e101cdeb10 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Fri, 14 Oct 2005 19:12:54 +0500 Subject: [PATCH 128/322] Use Field_longlong::store(longlong nr, bool unsigned_val) for ulonglong values instead of Field_longlong::store(double nr). --- sql/sql_show.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e53b7c24833..a03eca54b9d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2333,14 +2333,14 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables, table->field[7]->store((longlong) file->records, TRUE); table->field[7]->set_notnull(); } - table->field[8]->store((longlong) file->mean_rec_length); - table->field[9]->store((longlong) file->data_file_length); + table->field[8]->store((longlong) file->mean_rec_length, TRUE); + table->field[9]->store((longlong) file->data_file_length, TRUE); if (file->max_data_file_length) { - table->field[10]->store((longlong) file->max_data_file_length); + table->field[10]->store((longlong) file->max_data_file_length, TRUE); } - table->field[11]->store((longlong) file->index_file_length); - table->field[12]->store((longlong) file->delete_length); + table->field[11]->store((longlong) file->index_file_length, TRUE); + table->field[12]->store((longlong) file->delete_length, TRUE); if (show_table->found_next_number_field) { table->field[13]->store((longlong) file->auto_increment_value, TRUE); From 5035abf052af06fc1f55cad00e7e106c74022c62 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 14 Oct 2005 22:11:52 +0200 Subject: [PATCH 129/322] mysql.spec.sh: Removed unneeded/obsolte configure options Added archive engine to standard server Removed the embedded server from experimental server Changed suffix "-Max" => "-max" Changed comment string "Max" => "Experimental" --- support-files/mysql.spec.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 588e367a080..6e71ec198bc 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -252,8 +252,6 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --with-readline ; # Add this for more debugging support # --with-debug - # Add this for MyISAM RAID support: - # --with-raid " # benchdir does not fit in above model. Maybe a separate bench distribution @@ -296,7 +294,6 @@ then fi BuildMySQL "--enable-shared \ - --without-openssl \ --with-berkeley-db \ --with-innodb \ --with-ndbcluster \ @@ -305,9 +302,8 @@ BuildMySQL "--enable-shared \ --with-example-storage-engine \ --with-blackhole-storage-engine \ --with-federated-storage-engine \ - --with-embedded-server \ - --with-comment=\"MySQL Community Edition - Max (GPL)\" \ - --with-server-suffix='-Max'" + --with-comment=\"MySQL Community Edition - Experimental (GPL)\" \ + --with-server-suffix='-max'" make test-force || true @@ -356,11 +352,8 @@ BuildMySQL "--disable-shared \ %endif --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ --with-server-suffix='%{server_suffix}' \ - --without-embedded-server \ - --without-berkeley-db \ - --with-innodb \ - --without-vio \ - --without-openssl" + --with-archive-storage-engine \ + --with-innodb" nm --numeric-sort sql/mysqld > sql/mysqld.sym make test-force || true From 4ea2aacb2a45c0e20d2d56f2baab67fd70ffa19f Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 14 Oct 2005 22:49:53 +0200 Subject: [PATCH 130/322] mysql.spec.sh: For 5.x, always compile with --with-big-tables Copy the config.log file to location outside the build tree --- support-files/mysql.spec.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 6e71ec198bc..2c28b5921c3 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -249,7 +249,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --includedir=%{_includedir} \ --mandir=%{_mandir} \ --enable-thread-safe-client \ - --with-readline ; + --with-readline ; \ # Add this for more debugging support # --with-debug " @@ -302,9 +302,16 @@ BuildMySQL "--enable-shared \ --with-example-storage-engine \ --with-blackhole-storage-engine \ --with-federated-storage-engine \ + --with-big-tables \ --with-comment=\"MySQL Community Edition - Experimental (GPL)\" \ --with-server-suffix='-max'" +# We might want to save the config log file +if test -n "$MYSQL_MAXCONFLOG_DEST" +then + cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" +fi + make test-force || true # Save mysqld-max @@ -353,9 +360,16 @@ BuildMySQL "--disable-shared \ --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ --with-server-suffix='%{server_suffix}' \ --with-archive-storage-engine \ - --with-innodb" + --with-innodb \ + --with-big-tables" nm --numeric-sort sql/mysqld > sql/mysqld.sym +# We might want to save the config log file +if test -n "$MYSQL_CONFLOG_DEST" +then + cp -fp config.log "$MYSQL_CONFLOG_DEST" +fi + make test-force || true %install From dcd4b9923a6807eb4822363bf39c4798f4e9ec2b Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 15 Oct 2005 01:40:28 +0200 Subject: [PATCH 131/322] mysql.spec.sh: Give mode arguments the same way in all places Moved copy of mysqld.a to "standard" build, but disabled it as we don't do embedded yet in 5.0 --- support-files/mysql.spec.sh | 46 +++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 2c28b5921c3..d4d0b4e810b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -323,9 +323,6 @@ mv extra/perror extra/perror.ndb # Install the ndb binaries (cd ndb; make install DESTDIR=$RBR) -# Install embedded server library in the build root -install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ - # Include libgcc.a in the devel subpackage (BUG 4921) if expr "$CC" : ".*gcc.*" > /dev/null ; then @@ -393,18 +390,22 @@ make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} (cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) # install saved mysqld-max -install -s -m755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max +install -s -m 755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max # install saved perror binary with NDB support (BUG#13740) -install -s -m755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror +install -s -m 755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror # install symbol files ( for stack trace resolution) -install -m644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym -install -m644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym +install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym +install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym # Install logrotate and autostart -install -m644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql -install -m755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql +install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql +install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql + +# Install embedded server library in the build root +# FIXME No libmysqld on 5.0 yet +#install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ # Create a symlink "rcmysql", pointing to the init.script. SuSE users # will appreciate that, as all services usually offer this. @@ -438,7 +439,7 @@ fi mysql_datadir=%{mysqldatadir} # Create data directory if needed -if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi +if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi @@ -485,7 +486,7 @@ sleep 2 mysql_clusterdir=/var/lib/mysql-cluster # Create cluster directory if needed -if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi +if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi %post Max @@ -677,12 +678,33 @@ fi %files embedded %defattr(-, root, root, 0755) -%attr(644, root, root) %{_libdir}/mysql/libmysqld.a +# %attr(644, root, root) %{_libdir}/mysql/libmysqld.a # The spec file changelog only includes changes made to the spec file # itself - note that they must be ordered by date (important when # merging BK trees) %changelog + +* Sat Oct 15 2005 Kent Boortz + +- Give mode arguments the same way in all places +- Moved copy of mysqld.a to "standard" build, but + disabled it as we don't do embedded yet in 5.0 + +* Fri Oct 14 2005 Kent Boortz + +- For 5.x, always compile with --with-big-tables +- Copy the config.log file to location outside + the build tree + +* Fri Oct 14 2005 Kent Boortz + +- Removed unneeded/obsolte configure options +- Added archive engine to standard server +- Removed the embedded server from experimental server +- Changed suffix "-Max" => "-max" +- Changed comment string "Max" => "Experimental" + * Thu Oct 13 2005 Lenz Grimmer - added a usermod call to assign a potential existing mysql user to the From a345a438bbd6b47bae9387acad9ee8cd0c8fcd9f Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 15 Oct 2005 14:37:08 +0200 Subject: [PATCH 132/322] mysql.sln: Missing yaSSL added to pro-gpl target --- VC++Files/mysql.sln | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index a2f6f0cd062..e119fe8d8a3 100644 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -1041,6 +1041,8 @@ Global {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.Build.0 = Debug|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.ActiveCfg = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_ProGPL.Build.0 = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.ActiveCfg = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.Build.0 = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.ActiveCfg = Release|Win32 @@ -1053,6 +1055,10 @@ Global {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.Build.0 = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.ActiveCfg = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl nt.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl nt.Build.0 = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.ActiveCfg = Release|Win32 {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.Build.0 = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.ActiveCfg = Release|Win32 @@ -1067,6 +1073,8 @@ Global {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Debug.Build.0 = Debug|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.ActiveCfg = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_ProGPL.Build.0 = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.ActiveCfg = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.Build.0 = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.ActiveCfg = Release|Win32 @@ -1079,6 +1087,10 @@ Global {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.Build.0 = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.ActiveCfg = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl nt.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl nt.Build.0 = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.ActiveCfg = Release|Win32 {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32 @@ -1451,6 +1463,8 @@ Global {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.Build.0 = Debug|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.ActiveCfg = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.Build.0 = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_ProGPL.ActiveCfg = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_ProGPL.Build.0 = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.ActiveCfg = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.Build.0 = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.ActiveCfg = Release|Win32 @@ -1463,6 +1477,10 @@ Global {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.Build.0 = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.ActiveCfg = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.Build.0 = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl.ActiveCfg = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl.Build.0 = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl nt.ActiveCfg = Release|Win32 + {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl nt.Build.0 = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.ActiveCfg = Release|Win32 {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.Build.0 = Release|Win32 EndGlobalSection From 3f76925d0670544b0e0be82fd7ef1ab39c285f7f Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 15 Oct 2005 21:57:32 +0500 Subject: [PATCH 133/322] Fix for bug #13573 (wrong data inserted for too big decimals) --- mysql-test/r/type_newdecimal.result | 28 ++++++++++++-- mysql-test/t/type_newdecimal.test | 15 ++++++++ sql/item_func.cc | 12 +++--- sql/my_decimal.cc | 2 +- sql/my_decimal.h | 60 +++++++++++++++++++++-------- 5 files changed, 91 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index be5e29ab662..a99e60e5780 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -846,15 +846,14 @@ select 0/0; NULL select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x; x -999999999999999999999999999999999999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999999999999999999999999999999999 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x -NULL +100000000000000000000000000000000000000000000000000000000000000000 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1019,3 +1018,26 @@ drop procedure wg2; select cast(@non_existing_user_var/2 as DECIMAL); cast(@non_existing_user_var/2 as DECIMAL) NULL +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values(1e100); +Warnings: +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +select * from t1; +c1 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 3f04aa931d2..bfebef6207a 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1044,3 +1044,18 @@ drop procedure wg2; # select cast(@non_existing_user_var/2 as DECIMAL); + + +# +# Bug #13573 (Wrong data inserted for too big values) +# + +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +insert into t1 values(1e100); +select * from t1; +drop table t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 491243e9de7..9e92049dea4 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -972,8 +972,8 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } @@ -1045,8 +1045,8 @@ my_decimal *Item_func_minus::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } @@ -1083,8 +1083,8 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index f188d27ff78..1bd16940b47 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -185,7 +185,7 @@ int str2my_decimal(uint mask, const char *from, uint length, } } } - check_result(mask, err); + check_result_and_overflow(mask, err, decimal_value); return err; } diff --git a/sql/my_decimal.h b/sql/my_decimal.h index b65e6aedaa2..b02abacf0a3 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -126,6 +126,19 @@ inline int decimal_operation_results(int result) } #endif /*MYSQL_CLIENT*/ +inline +void max_my_decimal(my_decimal *to, int precision, int frac) +{ + DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& + (frac <= DECIMAL_MAX_SCALE)); + max_decimal(precision, frac, (decimal_t*) to); +} + +inline void max_internal_decimal(my_decimal *to) +{ + max_my_decimal(to, DECIMAL_MAX_PRECISION, 0); +} + inline int check_result(uint mask, int result) { if (result & mask) @@ -133,6 +146,18 @@ inline int check_result(uint mask, int result) return result; } +inline int check_result_and_overflow(uint mask, int result, my_decimal *val) +{ + if (check_result(mask, result) & E_DEC_OVERFLOW) + { + bool sign= val->sign(); + val->fix_buffer_pointer(); + max_internal_decimal(val); + val->sign(sign); + } + return result; +} + inline uint my_decimal_length_to_precision(uint length, uint scale, bool unsigned_flag) { @@ -256,7 +281,8 @@ int my_decimal2double(uint mask, const my_decimal *d, double *result) inline int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) { - return check_result(mask, string2decimal(str, (decimal_t*) d, end)); + return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), + d); } @@ -274,7 +300,7 @@ int string2my_decimal(uint mask, const String *str, my_decimal *d) inline int double2my_decimal(uint mask, double val, my_decimal *d) { - return check_result(mask, double2decimal(val, (decimal_t*) d)); + return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); } @@ -303,7 +329,9 @@ inline int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_add((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_add((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -311,7 +339,9 @@ inline int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_sub((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_sub((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -319,7 +349,9 @@ inline int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_mul((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_mul((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -327,8 +359,10 @@ inline int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc) { - return check_result(mask, decimal_div((decimal_t*) a, (decimal_t*) b, res, - div_scale_inc)); + return check_result_and_overflow(mask, + decimal_div((decimal_t*)a,(decimal_t*)b,res, + div_scale_inc), + res); } @@ -336,7 +370,9 @@ inline int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_mod((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_mod((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -347,13 +383,5 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b) return decimal_cmp((decimal_t*) a, (decimal_t*) b); } -inline -void max_my_decimal(my_decimal *to, int precision, int frac) -{ - DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& - (frac <= DECIMAL_MAX_SCALE)); - max_decimal(precision, frac, (decimal_t*) to); -} - #endif /*my_decimal_h*/ From 9910198aafe774d6ad50b47339a127ebc43a5d2d Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 15 Oct 2005 22:23:13 +0500 Subject: [PATCH 134/322] Additional fix for bug #12267 (Can't use POINT for primary key) --- mysql-test/r/gis.result | 3 +++ mysql-test/t/gis.test | 3 +++ sql/sql_table.cc | 3 +++ sql/sql_yacc.yy | 4 +++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 2748199efad..90857ecfc6d 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -682,6 +682,9 @@ POINT(1 1) drop function fn3; create table t1(pt POINT); alter table t1 add primary key pti(pt); +drop table t1; +create table t1(pt GEOMETRY); +alter table t1 add primary key pti(pt); ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length alter table t1 add primary key pti(pt(20)); drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 1f30407c2b7..142bd29fa2d 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -399,6 +399,9 @@ drop function fn3; # Bug #12267 (primary key over GIS) # create table t1(pt POINT); +alter table t1 add primary key pti(pt); +drop table t1; +create table t1(pt GEOMETRY); --error 1170 alter table t1 add primary key pti(pt); alter table t1 add primary key pti(pt(20)); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 922f04be25a..8aed27e7fa4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1156,6 +1156,9 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name); DBUG_RETURN(-1); } + if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type == + Field::GEOM_POINT) + column->length= 21; if (!column->length) { my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 14f617b9f8b..316564f52f7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2969,7 +2969,9 @@ type: spatial_type: GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; } | GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; } - | POINT_SYM { $$= Field::GEOM_POINT; } + | POINT_SYM { Lex->length= (char*)"21"; + $$= Field::GEOM_POINT; + } | MULTIPOINT { $$= Field::GEOM_MULTIPOINT; } | LINESTRING { $$= Field::GEOM_LINESTRING; } | MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; } From 85ab53357b005852b51c3b405b9c01cbf6214f5a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 06:49:19 +0200 Subject: [PATCH 135/322] thread_registry.h, thread_registry.cc: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX Makefile.am: Preserve executable mode on scripts make_binary_distribution.sh: Copy *.imtest files --- mysql-test/Makefile.am | 5 +++-- scripts/make_binary_distribution.sh | 3 ++- server-tools/instance-manager/thread_registry.cc | 8 ++++++++ server-tools/instance-manager/thread_registry.h | 9 +++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 1fb5f82c475..f1194d7fc2f 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -53,7 +53,8 @@ dist-hook: -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(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)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data @@ -79,7 +80,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 750c98c80e2..5767728fe4f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -234,7 +234,8 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ +$CP mysql-test/t/*.test mysql-test/t/*.imtest \ + mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc index f9b98eacbee..1578ba3e9b2 100644 --- a/server-tools/instance-manager/thread_registry.cc +++ b/server-tools/instance-manager/thread_registry.cc @@ -37,6 +37,14 @@ static void handle_signal(int __attribute__((unused)) sig_no) } #endif +/* + Thread_info initializer methods +*/ + +Thread_info::Thread_info() {} +Thread_info::Thread_info(pthread_t thread_id_arg) : + thread_id(thread_id_arg) {} + /* TODO: think about moving signal information (now it's shutdown_in_progress) to Thread_info. It will reduce contention and allow signal deliverence to diff --git a/server-tools/instance-manager/thread_registry.h b/server-tools/instance-manager/thread_registry.h index a1075e719d6..6a9e2e115d4 100644 --- a/server-tools/instance-manager/thread_registry.h +++ b/server-tools/instance-manager/thread_registry.h @@ -67,13 +67,14 @@ class Thread_info { +public: + Thread_info(); + Thread_info(pthread_t thread_id_arg); + friend class Thread_registry; +private: pthread_cond_t *current_cond; Thread_info *prev, *next; pthread_t thread_id; - Thread_info() {} - friend class Thread_registry; -public: - Thread_info(pthread_t thread_id_arg) : thread_id(thread_id_arg) {} }; From 00b535280da9fdf396b48a19bffed1cddc7528da Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 17:05:14 +0200 Subject: [PATCH 136/322] mysql-test-run.pl: Put socket files into $opt_tmpdir, to avoid problems with platforms that can't handle long socket paths. --- mysql-test/mysql-test-run.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 05e6169b4c7..92d8c8f1139 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -840,8 +840,8 @@ sub command_line_setup () { server_id => 1, port => $im_mysqld1_port, path_datadir => "$opt_vardir/im_mysqld_1.data", - path_sock => "$opt_vardir/mysqld_1.sock", - path_pid => "$opt_vardir/mysqld_1.pid", + path_sock => "$opt_tmpdir/mysqld_1.sock", + path_pid => "$opt_vardir/run/mysqld_1.pid", }; $instance_manager->{'instances'}->[1]= @@ -849,8 +849,8 @@ sub command_line_setup () { server_id => 2, port => $im_mysqld2_port, path_datadir => "$opt_vardir/im_mysqld_2.data", - path_sock => "$opt_vardir/mysqld_2.sock", - path_pid => "$opt_vardir/mysqld_2.pid", + path_sock => "$opt_tmpdir/mysqld_2.sock", + path_pid => "$opt_vardir/run/mysqld_2.pid", nonguarded => 1, }; From 1b0566c20b8ddb5ad9ef06d9d7241e1eb9be37ab Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Sun, 16 Oct 2005 19:30:10 +0400 Subject: [PATCH 137/322] portability fix: sh does not support "==". This resulted in IM tests failing on range of platforms. --- mysql-test/t/kill_n_check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/t/kill_n_check.sh index 7fe30c4774c..e722b3a180d 100755 --- a/mysql-test/t/kill_n_check.sh +++ b/mysql-test/t/kill_n_check.sh @@ -39,7 +39,7 @@ new_pid="" # echo "New PID: $new_pid" -if [ "$expected_result" == "restarted" ]; then +if [ "$expected_result" = "restarted" ]; then if [ -z "$new_pid" ]; then echo "Error: the process was killed." @@ -54,7 +54,7 @@ if [ "$expected_result" == "restarted" ]; then echo "Success: the process was restarted." exit 0 -else # $expected_result == killed +else # $expected_result = killed if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then echo "Error: the process was restarted." From 35e16842064d53093b86d18625721c95026455a3 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Sun, 16 Oct 2005 22:47:19 +0400 Subject: [PATCH 138/322] sp-security.result, sp.result, sp-security.test, sp.test: Test for bug#12812 moved from sp.test to sp-security.test --- mysql-test/r/sp-security.result | 12 ++++++++++++ mysql-test/r/sp.result | 12 ------------ mysql-test/t/sp-security.test | 24 ++++++++++++++++++++++++ mysql-test/t/sp.test | 22 ---------------------- 4 files changed, 36 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index eb2e2ce334e..614e670f25d 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -251,3 +251,15 @@ drop procedure mysqltest_1.p1; drop database mysqltest_1; revoke usage on *.* from mysqltest_1@localhost; drop user mysqltest_1@localhost; +drop function if exists bug12812| +create function bug12812() returns char(2) +begin +return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +CREATE VIEW v1 AS SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +DROP USER user_bug12812@localhost| +drop function bug12812| diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index e3e379ac65d..8f1006b4fa1 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3206,18 +3206,6 @@ set f1= concat( 'hello', f1 ); return f1; end| drop function bug9048| -drop function if exists bug12812| -create function bug12812() returns char(2) -begin -return 'ok'; -end; -create user user_bug12812@localhost IDENTIFIED BY 'ABC'| -SELECT test.bug12812()| -ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' -CREATE VIEW v1 AS SELECT test.bug12812()| -ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' -DROP USER user_bug12812@localhost| -drop function bug12812| drop procedure if exists bug12849_1| create procedure bug12849_1(inout x char) select x into x| set @var='a'| diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 6f1332f80d5..afbc383a17a 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -412,4 +412,28 @@ drop database mysqltest_1; revoke usage on *.* from mysqltest_1@localhost; drop user mysqltest_1@localhost; +# +# BUG#12812 create view calling a function works without execute right +# on function +delimiter |; +--disable_warnings +drop function if exists bug12812| +--enable_warnings +create function bug12812() returns char(2) +begin + return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (test_user_12812,localhost,user_bug12812,ABC,test)| +--error 1370 +SELECT test.bug12812()| +--error 1370 +CREATE VIEW v1 AS SELECT test.bug12812()| +# Cleanup +connection default| +disconnect test_user_12812| +DROP USER user_bug12812@localhost| +drop function bug12812| +delimiter ;| # End of 5.0 bugs. diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 1f4d5b6bad5..0faa303df54 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4037,28 +4037,6 @@ begin end| drop function bug9048| -# -# BUG#12812 create view calling a function works without execute right -# on function ---disable_warnings -drop function if exists bug12812| ---enable_warnings -create function bug12812() returns char(2) -begin - return 'ok'; -end; -create user user_bug12812@localhost IDENTIFIED BY 'ABC'| ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (test_user_12812,localhost,user_bug12812,ABC,test)| ---error 1370 -SELECT test.bug12812()| ---error 1370 -CREATE VIEW v1 AS SELECT test.bug12812()| -# Cleanup -connection default| -disconnect test_user_12812| -DROP USER user_bug12812@localhost| -drop function bug12812| # Bug #12849 Stored Procedure: Crash on procedure call with CHAR type # 'INOUT' parameter # From 7635353bc8c7aa2cb5c3bc306674ca02a1be44f0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 20:51:19 +0200 Subject: [PATCH 139/322] mysql-test-run.pl: Added --skip-im option handling Don't terminate script if IM fails to create PID file mtr_cases.pl: Added --skip-im option handling mtr_process.pl: Kill left over 'mysqld' processes started by IM --- mysql-test/lib/mtr_cases.pl | 8 ++--- mysql-test/lib/mtr_process.pl | 11 +++++++ mysql-test/mysql-test-run.pl | 55 ++++++++++++++++------------------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index ca984d37ecf..fb622f2bbb3 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -68,7 +68,7 @@ sub collect_test_cases ($) { # # Otherwise, try to guess the target component. - if ( defined $component_id ) + if ( $component_id ) { if ( ! -f "$testdir/$elem") { @@ -80,11 +80,11 @@ sub collect_test_cases ($) { my $mysqld_test_exists = -f "$testdir/$tname.test"; my $im_test_exists = -f "$testdir/$tname.imtest"; - if ( $mysqld_test_exists && $im_test_exists ) + if ( $mysqld_test_exists and $im_test_exists ) { mtr_error("Ambiguos test case name ($tname)"); } - elsif ( ! $mysqld_test_exists && !$im_test_exists ) + elsif ( ! $mysqld_test_exists and ! $im_test_exists ) { mtr_error("Test case $tname is not found"); } @@ -405,7 +405,7 @@ sub collect_one_test_case($$$$$$$) { "Instance Manager tests are not run with --ps-protocol. " . "Test case '$tname' is skipped."); } - elsif ( !$::exe_im ) + elsif ( $::opt_skip_im ) { $tinfo->{'skip'}= 1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index eb60df4a5cb..b3a243444c1 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -360,9 +360,20 @@ sub mtr_kill_leftovers () { # First, kill all masters and slaves that would conflict with # this run. Make sure to remove the PID file, if any. + # FIXME kill IM manager first, else it will restart the servers, how?! my @args; + for ( my $idx; $idx < 2; $idx++ ) + { + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::instance_manager->{'instances'}->[$idx]->{'path_pid'}, + sockfile => $::instance_manager->{'instances'}->[$idx]->{'path_sock'}, + port => $::instance_manager->{'instances'}->[$idx]->{'port'}, + }); + } + for ( my $idx; $idx < 2; $idx++ ) { push(@args,{ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 92d8c8f1139..35f26199fc8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -233,6 +233,7 @@ our $opt_result_ext; our $opt_skip; our $opt_skip_rpl; our $opt_skip_test; +our $opt_skip_im; our $opt_sleep; our $opt_ps_protocol; @@ -490,6 +491,7 @@ sub command_line_setup () { 'do-test=s' => \$opt_do_test, 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, + 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, # Specify ports @@ -1118,7 +1120,7 @@ sub kill_and_cleanup () { foreach my $instance (@{$instance_manager->{'instances'}}) { - push (@data_dir_lst, $instance->{'path_datadir'}); + push(@data_dir_lst, $instance->{'path_datadir'}); } foreach my $data_dir (@data_dir_lst) @@ -1364,7 +1366,7 @@ sub mysql_install_db () { install_db('slave', $slave->[1]->{'path_myddir'}); install_db('slave', $slave->[2]->{'path_myddir'}); - if ( defined $exe_im) + if ( ! $opt_skip_im ) { im_prepare_env($instance_manager); } @@ -1513,12 +1515,7 @@ skip-ndbcluster EOF ; - if ( exists $instance->{nonguarded} and - defined $instance->{nonguarded} ) - { - print OUT "nonguarded\n"; - } - + print OUT "nonguarded\n" if $instance->{'nonguarded'}; print OUT "\n"; } @@ -1678,7 +1675,7 @@ sub run_testcase ($) { $master->[0]->{'running_master_is_special'}= 1; } } - elsif ( $tinfo->{'component_id'} eq 'im') + elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' ) { # We have to create defaults file every time, in order to ensure that it # will be the same for each test. The problem is that test can change the @@ -1776,7 +1773,8 @@ sub run_testcase ($) { # Stop Instance Manager if we are processing an IM-test case. # ---------------------------------------------------------------------- - if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' ) + if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' and + $instance_manager->{'pid'} ) { im_stop($instance_manager); } @@ -2195,7 +2193,7 @@ sub stop_masters_slaves () { print "Ending Tests\n"; - if (defined $instance_manager->{'pid'}) + if ( $instance_manager->{'pid'} ) { print "Shutting-down Instance Manager\n"; im_stop($instance_manager); @@ -2269,14 +2267,10 @@ sub im_start($$) { my $instance_manager = shift; my $opts = shift; - if ( ! defined $exe_im) - { - return; - } - my $args; mtr_init_args(\$args); - mtr_add_arg($args, "--defaults-file=" . $instance_manager->{'defaults_file'}); + mtr_add_arg($args, "--defaults-file=%s", + $instance_manager->{'defaults_file'}); foreach my $opt (@{$opts}) { @@ -2294,7 +2288,7 @@ sub im_start($$) { { append_log_file => 1 } # append log files ); - if ( ! defined $instance_manager->{'pid'} ) + if ( ! $instance_manager->{'pid'} ) { mtr_report('Could not start Instance Manager'); return; @@ -2304,10 +2298,14 @@ sub im_start($$) { # several processes and the parent process, created by mtr_spawn(), exits just # after start. So, we have to obtain Instance Manager PID from the PID file. - sleep_until_file_created( - $instance_manager->{'path_pid'}, - $instance_manager->{'start_timeout'}, - -1); # real PID is still unknown + if ( ! sleep_until_file_created( + $instance_manager->{'path_pid'}, + $instance_manager->{'start_timeout'}, + -1)) # real PID is still unknown + { + mtr_report("Instance Manager PID file is missing"); + return; + } $instance_manager->{'pid'} = mtr_get_pid_from_file($instance_manager->{'path_pid'}); @@ -2316,16 +2314,12 @@ sub im_start($$) { sub im_stop($) { my $instance_manager = shift; - if (! defined $instance_manager->{'pid'}) - { - return; - } - # Re-read pid from the file, since during tests Instance Manager could have # been restarted, so its pid could have been changed. $instance_manager->{'pid'} = - mtr_get_pid_from_file($instance_manager->{'path_pid'}); + mtr_get_pid_from_file($instance_manager->{'path_pid'}) + if -f $instance_manager->{'path_pid'}; # Inspired from mtr_stop_mysqld_servers(). @@ -2340,12 +2334,12 @@ sub im_stop($) { if ( -r $instances->[0]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'})); } if ( -r $instances->[1]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'})); } # Kill processes. @@ -2601,6 +2595,7 @@ Options to control what test suites or cases to run start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" skip-rpl Skip the replication test cases. + skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX Options that specify ports From 5423ab00deaaea044875ba3644e67eeb7eb20820 Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Mon, 17 Oct 2005 05:14:03 +0400 Subject: [PATCH 140/322] Fix im tests on powermacg5: temporarily fix for problem with Darwin kernels. For more details see bug 2030. Will push a proper fix later --- server-tools/instance-manager/manager.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index a42a25eadf3..cc16ee6562f 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -231,6 +231,10 @@ void manager(const Options &options) } #ifndef __WIN__ +#ifdef IGNORE_SIGHUP_SIGQUIT + if ( SIGHUP == signo ) + continue; +#endif if (THR_SERVER_ALARM == signo) process_alarm(signo); else From 1412bd72b89f0565650b1bff459b2bc598af0a3f Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Mon, 17 Oct 2005 08:29:58 +0200 Subject: [PATCH 141/322] ndb - ndbapi testprogram bugfix testBackup, fix assertion --- ndb/test/ndbapi/testBackup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ndb/test/ndbapi/testBackup.cpp b/ndb/test/ndbapi/testBackup.cpp index 1ab348e735f..da3c52cf4d2 100644 --- a/ndb/test/ndbapi/testBackup.cpp +++ b/ndb/test/ndbapi/testBackup.cpp @@ -229,10 +229,13 @@ int runVerifyOne(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; int count = 0; - ndbout << *(const NDBT_Table*)ctx->getTab() << endl; - - UtilTransactions utilTrans(*ctx->getTab()); - HugoTransactions hugoTrans(*ctx->getTab()); + const NdbDictionary::Table* tab = + GETNDB(step)->getDictionary()->getTable(ctx->getTab()->getName()); + if(tab == 0) + return NDBT_FAILED; + + UtilTransactions utilTrans(* tab); + HugoTransactions hugoTrans(* tab); do{ From 99bc9c3a4ad121eca16bb083b6a3939d1534346f Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Mon, 17 Oct 2005 09:29:41 +0200 Subject: [PATCH 142/322] Fix testDict -n FragmentTypeSingle T1 Init KeyDescriptor before sending to DIH, make sure that its always inited --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 76 ++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 7c4b97c8f0f..45efaac30bc 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -4346,6 +4346,44 @@ Dbdict::createTab_dih(Signal* signal, sendSignal(DBDIH_REF, GSN_DIADDTABREQ, signal, DiAddTabReq::SignalLength, JBB); + + /** + * Create KeyDescriptor + */ + KeyDescriptor* desc= g_key_descriptor_pool.getPtr(tabPtr.i); + new (desc) KeyDescriptor(); + + Uint32 key = 0; + Uint32 tAttr = tabPtr.p->firstAttribute; + while (tAttr != RNIL) + { + jam(); + AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr); + if (aRec->tupleKey) + { + desc->noOfKeyAttr ++; + desc->keyAttr[key].attributeDescriptor = aRec->attributeDescriptor; + + Uint32 csNumber = (aRec->extPrecision >> 16); + if(csNumber) + { + desc->keyAttr[key].charsetInfo = all_charsets[csNumber]; + ndbrequire(all_charsets[csNumber]); + desc->hasCharAttr = 1; + } + else + { + desc->keyAttr[key].charsetInfo = 0; + } + if(AttributeDescriptor::getDKey(aRec->attributeDescriptor)) + { + desc->noOfDistrKeys ++; + } + key++; + } + tAttr = aRec->nextAttrInTable; + } + ndbrequire(key == tabPtr.p->noOfPrimkey); } static @@ -4448,44 +4486,6 @@ Dbdict::execADD_FRAGREQ(Signal* signal) { sendSignal(DBLQH_REF, GSN_LQHFRAGREQ, signal, LqhFragReq::SignalLength, JBB); } - - /** - * Create KeyDescriptor - */ - KeyDescriptor* desc= g_key_descriptor_pool.getPtr(tabPtr.i); - new (desc) KeyDescriptor(); - - Uint32 key = 0; - Uint32 tAttr = tabPtr.p->firstAttribute; - while (tAttr != RNIL) - { - jam(); - AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr); - if (aRec->tupleKey) - { - desc->noOfKeyAttr ++; - desc->keyAttr[key].attributeDescriptor = aRec->attributeDescriptor; - - Uint32 csNumber = (aRec->extPrecision >> 16); - if(csNumber) - { - desc->keyAttr[key].charsetInfo = all_charsets[csNumber]; - ndbrequire(all_charsets[csNumber]); - desc->hasCharAttr = 1; - } - else - { - desc->keyAttr[key].charsetInfo = 0; - } - if(AttributeDescriptor::getDKey(aRec->attributeDescriptor)) - { - desc->noOfDistrKeys ++; - } - key++; - } - tAttr = aRec->nextAttrInTable; - } - ndbrequire(key == tabPtr.p->noOfPrimkey); } void From 15fbd07a2215c0a93a47826e66b6c98199c125ea Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Mon, 17 Oct 2005 12:32:22 +0500 Subject: [PATCH 143/322] Fix for bug #13820 (No warning on log(NEGATIVE)) --- mysql-test/r/func_math.result | 27 +++++++++++++++++++++++++ mysql-test/t/func_math.test | 12 +++++++++++ sql/item_func.cc | 38 +++++++++++++++++++++++++++++------ 3 files changed, 71 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 5b6c29f87fb..b7ba2273956 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -170,3 +170,30 @@ insert into t1 values (1); select rand(i) from t1; ERROR HY000: Incorrect arguments to RAND drop table t1; +set sql_mode='traditional'; +select ln(-1); +ln(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log10(-1); +log10(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log2(-1); +log2(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log(2,-1); +log(2,-1) +NULL +Warnings: +Error 1365 Division by 0 +select log(-2,1); +log(-2,1) +NULL +Warnings: +Error 1365 Division by 0 +set sql_mode=''; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 633e36f51ab..2935f24f2d7 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -117,3 +117,15 @@ select rand(i) from t1; drop table t1; # End of 4.1 tests + +# +# Bug #13820 (No warning on log(negative) +# +set sql_mode='traditional'; +select ln(-1); +select log10(-1); +select log2(-1); +select log(2,-1); +select log(-2,1); +set sql_mode=''; + diff --git a/sql/item_func.cc b/sql/item_func.cc index 491243e9de7..3d29b4c6b66 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1386,8 +1386,13 @@ double Item_func_ln::val_real() { DBUG_ASSERT(fixed == 1); double value= args[0]->val_real(); - if ((null_value=(args[0]->null_value || value <= 0.0))) + if ((null_value=args[0]->null_value)) return 0.0; + if ((null_value= value <=0.0)) + { + signal_divide_by_null(); + return 0.0; + } return log(value); } @@ -1400,13 +1405,23 @@ double Item_func_log::val_real() { DBUG_ASSERT(fixed == 1); double value= args[0]->val_real(); - if ((null_value=(args[0]->null_value || value <= 0.0))) + if ((null_value=args[0]->null_value)) return 0.0; + if ((null_value= value <=0.0)) + { + signal_divide_by_null(); + return 0.0; + } if (arg_count == 2) { double value2= args[1]->val_real(); - if ((null_value=(args[1]->null_value || value2 <= 0.0 || value == 1.0))) + if ((null_value=args[1]->null_value)) return 0.0; + if ((null_value= value2 <=0.0) || (value == 1.0)) + { + signal_divide_by_null(); + return 0.0; + } return log(value2) / log(value); } return log(value); @@ -1416,8 +1431,14 @@ double Item_func_log2::val_real() { DBUG_ASSERT(fixed == 1); double value= args[0]->val_real(); - if ((null_value=(args[0]->null_value || value <= 0.0))) + + if ((null_value=args[0]->null_value)) return 0.0; + if ((null_value= value <=0.0)) + { + signal_divide_by_null(); + return 0.0; + } return log(value) / M_LN2; } @@ -1425,8 +1446,13 @@ double Item_func_log10::val_real() { DBUG_ASSERT(fixed == 1); double value= args[0]->val_real(); - if ((null_value=(args[0]->null_value || value <= 0.0))) - return 0.0; /* purecov: inspected */ + if ((null_value=args[0]->null_value)) + return 0.0; + if ((null_value= value <=0.0)) + { + signal_divide_by_null(); + return 0.0; + } return log10(value); } From f3f7f07131c5dfc85ecd007ad082f74ea5be6537 Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Mon, 17 Oct 2005 09:51:16 +0200 Subject: [PATCH 144/322] ndb - hugo Disable tests of lock upgrade paths that are currently unsupported --- ndb/test/ndbapi/testOperations.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index 726f35b01fb..505b1620900 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -659,6 +659,9 @@ main(int argc, const char** argv){ for(Uint32 i = 0; i < 12; i++) { + if(i == 6 || i == 8 || i == 10) + continue; + BaseString name("bug_9749"); name.appfmt("_%d", i); NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts, From e58531570371b640e963d01e5714b636e7bad82b Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Mon, 17 Oct 2005 15:07:47 +0200 Subject: [PATCH 145/322] Additional fix for BUG#7049, after review. Make sure "select" aborts when finding a SP condition handler beyond the current scope. --- mysql-test/r/sp.result | 2 -- sql/mysqld.cc | 2 ++ sql/protocol.cc | 4 ++++ sql/sp_rcontext.h | 7 +++++++ sql/sql_error.cc | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1791cd385f4..19d5666dc5a 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3310,7 +3310,6 @@ select 1| 1 call bug12379_1()| bug12379() -NULL 42 42 select 2| @@ -3318,7 +3317,6 @@ select 2| 2 call bug12379_2()| bug12379() -NULL select 3| 3 3 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5befcd6d503..0e3ca6a8c89 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2342,6 +2342,8 @@ static int my_message_sql(uint error, const char *str, myf MyFlags) if (thd->spcont && thd->spcont->find_handler(error, MYSQL_ERROR::WARN_LEVEL_ERROR)) { + if (! thd->spcont->found_handler_here()) + thd->net.report_error= 1; /* Make "select" abort correctly */ DBUG_RETURN(0); } diff --git a/sql/protocol.cc b/sql/protocol.cc index ade94a483a8..8c3e5a62820 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -76,6 +76,8 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) if (thd->spcont && thd->spcont->find_handler(sql_errno, MYSQL_ERROR::WARN_LEVEL_ERROR)) { + if (! thd->spcont->found_handler_here()) + thd->net.report_error= 1; /* Make "select" abort correctly */ DBUG_VOID_RETURN; } thd->query_error= 1; // needed to catch query errors during replication @@ -181,6 +183,8 @@ net_printf_error(THD *thd, uint errcode, ...) if (thd->spcont && thd->spcont->find_handler(errcode, MYSQL_ERROR::WARN_LEVEL_ERROR)) { + if (! thd->spcont->found_handler_here()) + thd->net.report_error= 1; /* Make "select" abort correctly */ DBUG_VOID_RETURN; } thd->query_error= 1; // needed to catch query errors during replication diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index c7a298eccc0..cae5c5467c9 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -149,6 +149,13 @@ class sp_rcontext : public Sql_alloc return m_handler[m_hfound].type; } + // Returns true if we found a handler in this context + inline bool + found_handler_here() + { + return (m_hfound >= 0); + } + // Clears the handler find state inline void clear_handler() diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 2e262569386..191a6e0a1fd 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -144,6 +144,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, thd->really_abort_on_warning()) ? MYSQL_ERROR::WARN_LEVEL_ERROR : level)) { + if (! thd->spcont->found_handler_here()) + thd->net.report_error= 1; /* Make "select" abort correctly */ DBUG_RETURN(NULL); } query_cache_abort(&thd->net); From cf3625b90f531fc75454e38e3a546df526f4379c Mon Sep 17 00:00:00 2001 From: "SergeyV@selena." <> Date: Mon, 17 Oct 2005 18:58:43 +0400 Subject: [PATCH 146/322] Turn off EOLN_NATIVE for test files From 221a501120899f9bcaa4646564622c4f7a4e0a62 Mon Sep 17 00:00:00 2001 From: "SergeyV@selena." <> Date: Mon, 17 Oct 2005 19:03:54 +0400 Subject: [PATCH 147/322] Small update for #13377 patch --- sql/log.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index d5a5eecf36b..91320f40176 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2322,15 +2322,10 @@ void MYSQL_LOG::signal_update() void MYSQL_LOG::readers_addref() { /* - currently readers_addref and readers_release are necessary - only for __WIN__ build to wait untill readers will close - opened log files before reset. - There is no necessity for this on *nix, since it allows to + There is no necessity for reference counting on *nix, since it allows to delete opened files, however it is more clean way to wait untill all files will be closed on *nix as well. - If decided, the following #ifdef section is to be removed. */ -#ifdef __WIN__ DBUG_ENTER("MYSQL_LOG::reader_addref"); pthread_mutex_lock(&LOCK_log); pthread_mutex_lock(&LOCK_readers); @@ -2338,12 +2333,10 @@ void MYSQL_LOG::readers_addref() pthread_mutex_unlock(&LOCK_readers); pthread_mutex_unlock(&LOCK_log); DBUG_VOID_RETURN; -#endif } void MYSQL_LOG::readers_release() { -#ifdef __WIN__ DBUG_ENTER("MYSQL_LOG::reader_release"); pthread_mutex_lock(&LOCK_log); readers_count--; @@ -2351,7 +2344,6 @@ void MYSQL_LOG::readers_release() pthread_cond_broadcast(&reset_cond); pthread_mutex_unlock(&LOCK_log); DBUG_VOID_RETURN; -#endif } #ifdef __NT__ From b357caab3d560432fc5b2c1eec2afcb49d6d0f04 Mon Sep 17 00:00:00 2001 From: "SergeyV@selena." <> Date: Mon, 17 Oct 2005 19:36:20 +0400 Subject: [PATCH 148/322] Bug #13377. Small update, code formatting. --- sql/log.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 31f3e5737c5..a881602d510 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -965,7 +965,7 @@ bool MYSQL_LOG::reset_logs(THD* thd) goto err; } - reset_pending = true; + reset_pending= true; /* send update signal just in case so that all reader threads waiting for log update will leave wait condition @@ -996,7 +996,7 @@ bool MYSQL_LOG::reset_logs(THD* thd) my_free((gptr) save_name, MYF(0)); err: - reset_pending = false; + reset_pending= false; (void) pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_readers); From d7189ee8a17c19455da428c372ad34e2b1f0b8be Mon Sep 17 00:00:00 2001 From: "elliot@mysql.com" <> Date: Mon, 17 Oct 2005 14:11:37 -0400 Subject: [PATCH 149/322] BUG#13900 DATETIME data changes after inserting a new row in a InnoDB table Applying patch from Marko. All tests pass in pentium-debug-max build on Linux. --- innobase/include/rem0rec.h | 9 +++++++++ innobase/include/rem0rec.ic | 16 ++++++++++++++++ innobase/row/row0upd.c | 12 ++++++++++++ 3 files changed, 37 insertions(+) diff --git a/innobase/include/rem0rec.h b/innobase/include/rem0rec.h index 1d15b8d1c77..69b397c9682 100644 --- a/innobase/include/rem0rec.h +++ b/innobase/include/rem0rec.h @@ -312,6 +312,15 @@ rec_offs_nth_extern( const ulint* offsets,/* in: array returned by rec_get_offsets() */ ulint n); /* in: nth field */ /********************************************************** +Returns nonzero if the SQL NULL bit is set in nth field of rec. */ +UNIV_INLINE +ulint +rec_offs_nth_sql_null( +/*==================*/ + /* out: nonzero if SQL NULL */ + const ulint* offsets,/* in: array returned by rec_get_offsets() */ + ulint n); /* in: nth field */ +/********************************************************** Gets the physical size of a field. */ UNIV_INLINE ulint diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic index e2dceb6bae5..9c24f385f4f 100644 --- a/innobase/include/rem0rec.ic +++ b/innobase/include/rem0rec.ic @@ -954,6 +954,22 @@ rec_offs_nth_extern( & REC_OFFS_EXTERNAL)); } +/********************************************************** +Returns nonzero if the SQL NULL bit is set in nth field of rec. */ +UNIV_INLINE +ulint +rec_offs_nth_sql_null( +/*==================*/ + /* out: nonzero if SQL NULL */ + const ulint* offsets,/* in: array returned by rec_get_offsets() */ + ulint n) /* in: nth field */ +{ + ut_ad(rec_offs_validate(NULL, NULL, offsets)); + ut_ad(n < rec_offs_n_fields(offsets)); + return(UNIV_UNLIKELY(rec_offs_base(offsets)[1 + n] + & REC_OFFS_SQL_NULL)); +} + /********************************************************** Gets the physical size of a field. */ UNIV_INLINE diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index 4f44dbeae67..ff1ad1dfd05 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -395,6 +395,18 @@ row_upd_changes_field_size_or_external( old_len = rec_offs_nth_size(offsets, upd_field->field_no); + if (rec_offs_comp(offsets) + && rec_offs_nth_sql_null(offsets, upd_field->field_no)) { + /* Note that in the compact table format, for a + variable length field, an SQL NULL will use zero + bytes in the offset array at the start of the physical + record, but a zero-length value (empty string) will + use one byte! Thus, we cannot use update-in-place + if we update an SQL NULL varchar to an empty string! */ + + old_len = UNIV_SQL_NULL; + } + if (old_len != new_len) { return(TRUE); From ea0b89aeae83480ff68483e03a61aec3f50eebdf Mon Sep 17 00:00:00 2001 From: "dlenev@mysql.com" <> Date: Mon, 17 Oct 2005 22:37:24 +0400 Subject: [PATCH 150/322] Fix for bug #12739 "Deadlock in multithreaded environment during creating/ droping trigger on InnoDB table". Deadlock occured in cases when we were trying to create two triggers for the same InnoDB table concurrently and both threads were able to reach close_cached_table() simultaneously. Bugfix implements new approach to table locking and table cache invalidation during creation/dropping of trigger. No testcase is supplied since bug was repeatable only under high concurrency. --- sql/mysql_priv.h | 2 +- sql/sql_base.cc | 64 +++++++++++++++++++++++++------------ sql/sql_table.cc | 19 +++++++---- sql/sql_trigger.cc | 80 ++++++++++++++++++++++++---------------------- 4 files changed, 99 insertions(+), 66 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c80e457d2bb..ef62826809b 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -757,7 +757,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create); TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update); TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem, bool *refresh, uint flags); -TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table); +bool reopen_name_locked_table(THD* thd, TABLE_LIST* table); TABLE *find_locked_table(THD *thd, const char *db,const char *table_name); bool reopen_table(TABLE *table,bool locked); bool reopen_tables(THD *thd,bool get_locks,bool in_refresh); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 51b9fe43796..37af9975ae1 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -976,32 +976,57 @@ void wait_for_refresh(THD *thd) } -TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list) -{ - DBUG_ENTER("reopen_name_locked_table"); - if (thd->killed) - DBUG_RETURN(0); - TABLE *table; - TABLE_SHARE *share; - if (!(table = table_list->table)) - DBUG_RETURN(0); +/* + Open table which is already name-locked by this thread. - char* db = thd->db ? thd->db : table_list->db; - char* table_name = table_list->table_name; - char key[MAX_DBKEY_LENGTH]; - uint key_length; + SYNOPSIS + reopen_name_locked_table() + thd Thread handle + table_list TABLE_LIST object for table to be open, TABLE_LIST::table + member should point to TABLE object which was used for + name-locking. + + NOTE + This function assumes that its caller already acquired LOCK_open mutex. + + RETURN VALUE + FALSE - Success + TRUE - Error +*/ + +bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list) +{ + TABLE *table= table_list->table; + TABLE_SHARE *share; + char *db= table_list->db; + char *table_name= table_list->table_name; + char key[MAX_DBKEY_LENGTH]; + uint key_length; + TABLE orig_table; + DBUG_ENTER("reopen_name_locked_table"); + + safe_mutex_assert_owner(&LOCK_open); + + if (thd->killed || !table) + DBUG_RETURN(TRUE); + + orig_table= *table; key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1; - pthread_mutex_lock(&LOCK_open); if (open_unireg_entry(thd, table, db, table_name, table_name, 0, thd->mem_root) || !(table->s->table_cache_key= memdup_root(&table->mem_root, (char*) key, key_length))) { - delete table->triggers; - closefrm(table); - pthread_mutex_unlock(&LOCK_open); - DBUG_RETURN(0); + intern_close_table(table); + /* + If there was an error during opening of table (for example if it + does not exist) '*table' object can be wiped out. To be able + properly release name-lock in this case we should restore this + object to its original state. + */ + *table= orig_table; + DBUG_RETURN(TRUE); } share= table->s; @@ -1011,7 +1036,6 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list) share->flush_version=0; table->in_use = thd; check_unused(); - pthread_mutex_unlock(&LOCK_open); table->next = thd->open_tables; thd->open_tables = table; table->tablenr=thd->current_tablenr++; @@ -1021,7 +1045,7 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list) table->status=STATUS_NO_RECORD; table->keys_in_use_for_query= share->keys_in_use; table->used_keys= share->keys_for_keyread; - DBUG_RETURN(table); + DBUG_RETURN(FALSE); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0bc1537235b..1dc952ab2e9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1950,8 +1950,8 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table, { char* backup_dir= thd->lex->backup_dir; char src_path[FN_REFLEN], dst_path[FN_REFLEN]; - char* table_name = table->table_name; - char* db = thd->db ? thd->db : table->db; + char* table_name= table->table_name; + char* db= table->db; if (fn_format_relative_to_data_home(src_path, table_name, backup_dir, reg_ext)) @@ -1987,12 +1987,15 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table, Now we should be able to open the partially restored table to finish the restore in the handler later on */ - if (!(table->table = reopen_name_locked_table(thd, table))) + pthread_mutex_lock(&LOCK_open); + if (reopen_name_locked_table(thd, table)) { - pthread_mutex_lock(&LOCK_open); unlock_table_name(thd, table); pthread_mutex_unlock(&LOCK_open); + DBUG_RETURN(send_check_errmsg(thd, table, "restore", + "Failed to open partially restored table")); } + pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(0); } @@ -2089,12 +2092,16 @@ static int prepare_for_repair(THD* thd, TABLE_LIST *table_list, Now we should be able to open the partially repaired table to finish the repair in the handler later on. */ - if (!(table_list->table = reopen_name_locked_table(thd, table_list))) + pthread_mutex_lock(&LOCK_open); + if (reopen_name_locked_table(thd, table_list)) { - pthread_mutex_lock(&LOCK_open); unlock_table_name(thd, table_list); pthread_mutex_unlock(&LOCK_open); + error= send_check_errmsg(thd, table_list, "repair", + "Failed to open partially repaired table"); + goto end; } + pthread_mutex_unlock(&LOCK_open); end: if (table == &tmp_table) diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index df8de59508d..dbad8dcffb5 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -103,8 +103,7 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig); bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) { TABLE *table; - bool result= 0; - + bool result= TRUE; DBUG_ENTER("mysql_create_or_drop_trigger"); /* @@ -119,9 +118,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) /* We should have only one table in table list. */ DBUG_ASSERT(tables->next_global == 0); - if (!(table= open_ltable(thd, tables, tables->lock_type))) - DBUG_RETURN(TRUE); - /* TODO: We should check if user has TRIGGER privilege for table here. Now we just require SUPER privilege for creating/dropping because @@ -131,28 +127,24 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) DBUG_RETURN(TRUE); /* - We do not allow creation of triggers on temporary tables. We also don't - allow creation of triggers on views but fulfilment of this restriction - is guaranteed by open_ltable(). It is better to have this check here - than do it in Table_triggers_list::create_trigger() and mess with table - cache. + There is no DETERMINISTIC clause for triggers, so can't check it. + But a trigger can in theory be used to do nasty things (if it supported + DROP for example) so we do the check for privileges. For now there is + already a stronger test right above; but when this stronger test will + be removed, the test below will hold. */ - if (table->s->tmp_table != NO_TMP_TABLE) + if (!trust_routine_creators && mysql_bin_log.is_open() && + !(thd->security_ctx->master_access & SUPER_ACL)) { - my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias); + my_error(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, MYF(0)); DBUG_RETURN(TRUE); } - if (!table->triggers) + /* We do not allow creation of triggers on temporary tables. */ + if (create && find_temporary_table(thd, tables->db, tables->table_name)) { - if (!create) - { - my_message(ER_TRG_DOES_NOT_EXIST, ER(ER_TRG_DOES_NOT_EXIST), MYF(0)); - DBUG_RETURN(TRUE); - } - - if (!(table->triggers= new (&table->mem_root) Table_triggers_list(table))) - DBUG_RETURN(TRUE); + my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias); + DBUG_RETURN(TRUE); } /* @@ -161,31 +153,41 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) again until we are done. (Acquiring LOCK_open is not enough because global read lock is held without helding LOCK_open). */ - if (wait_if_global_read_lock(thd, 0, 0)) + if (wait_if_global_read_lock(thd, 0, 1)) DBUG_RETURN(TRUE); - /* - There is no DETERMINISTIC clause for triggers, so can't check it. - But a trigger can in theory be used to do nasty things (if it supported - DROP for example) so we do the check for privileges. For now there is - already a stronger test above (see start of the function); but when this - stronger test will be removed, the test below will hold. - */ - if (!trust_routine_creators && mysql_bin_log.is_open() && - !(thd->security_ctx->master_access & SUPER_ACL)) - { - my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, - ER(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0)); - DBUG_RETURN(TRUE); - } - VOID(pthread_mutex_lock(&LOCK_open)); + + if (lock_table_names(thd, tables)) + goto end; + + /* We also don't allow creation of triggers on views. */ + tables->required_type= FRMTYPE_TABLE; + + if (reopen_name_locked_table(thd, tables)) + { + unlock_table_name(thd, tables); + goto end; + } + table= tables->table; + + if (!table->triggers) + { + if (!create) + { + my_error(ER_TRG_DOES_NOT_EXIST, MYF(0)); + goto end; + } + + if (!(table->triggers= new (&table->mem_root) Table_triggers_list(table))) + goto end; + } + result= (create ? table->triggers->create_trigger(thd, tables): table->triggers->drop_trigger(thd, tables)); - /* It is sensible to invalidate table in any case */ - close_cached_table(thd, table); +end: VOID(pthread_mutex_unlock(&LOCK_open)); start_waiting_global_read_lock(thd); From 1423db9f0c94328ad091e345994801672123ee8c Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Mon, 17 Oct 2005 12:30:01 -0700 Subject: [PATCH 151/322] BUG# 13052 Changed text in options to TIMESTAMP --- client/mysqldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 3768f967f5c..995be6bf6a5 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -386,7 +386,7 @@ static struct my_option my_long_options[] = (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"tz-utc", OPT_TZ_UTC, - "SET TIME_ZONE='UTC' at top of dump to allow dumping of date types between servers with different time zones.", + "SET TIME_ZONE='UTC' at top of dump to allow dumping of TIMESTAMP data between servers with different time zones.", (gptr*) &opt_tz_utc, (gptr*) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user.", From ee8e1637768f93bbb07ac6826e2496bd7d4c791a Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Tue, 18 Oct 2005 00:48:34 +0400 Subject: [PATCH 152/322] fix for im_life_cycle test: replace im instance port number with a constant string. The lack of this --replace resulted in the test failing on all build hosts --- mysql-test/r/im_life_cycle.result | 2 +- mysql-test/t/im_life_cycle.imtest | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result index 810953e0578..f8eaf0ccb46 100644 --- a/mysql-test/r/im_life_cycle.result +++ b/mysql-test/r/im_life_cycle.result @@ -21,7 +21,7 @@ instance_name status version mysqld2 online VERSION SHOW VARIABLES LIKE 'port'; Variable_name Value -port 9312 +port IM_MYSQLD1_PORT STOP INSTANCE mysqld2; SHOW INSTANCES; instance_name status diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest index fff57e16eab..c2b1c9a56ec 100644 --- a/mysql-test/t/im_life_cycle.imtest +++ b/mysql-test/t/im_life_cycle.imtest @@ -46,6 +46,7 @@ SHOW INSTANCE STATUS mysqld2; --connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) --connection mysql_con +--replace_result $IM_MYSQLD1_PORT IM_MYSQLD1_PORT SHOW VARIABLES LIKE 'port'; --connection default From 7a57b741cada3c7934e4115807ae6d23d98a1f7f Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Tue, 18 Oct 2005 01:35:08 +0400 Subject: [PATCH 153/322] Hastily fix VC++6 project files to include a new file. --- VC++Files/libmysqld/libmysqld.dsp | 4 ++++ VC++Files/sql/mysqld.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 137a361401f..87a88333a2a 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -552,6 +552,10 @@ SOURCE=..\sql\sql_trigger.cpp # End Source File # Begin Source File +SOURCE=..\sql\sql_cursor.cpp +# End Source File +# Begin Source File + SOURCE=..\sql\sql_udf.cpp # End Source File # Begin Source File diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index e682bb52f0d..7a9ad3e1c76 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -1859,6 +1859,10 @@ SOURCE=.\sql_trigger.cpp # End Source File # Begin Source File +SOURCE=.\sql_cursor.cpp +# End Source File +# Begin Source File + SOURCE=.\sql_udf.cpp # End Source File # Begin Source File From 31a79ee3d0fd8cde70bad857807c5053f06a938b Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 17 Oct 2005 17:00:42 -0700 Subject: [PATCH 154/322] Fix Item_func_abs::fix_length_and_dec() to set maybe_null properly. (Bug #14009) --- mysql-test/r/func_math.result | 6 ++++++ mysql-test/t/func_math.test | 10 ++++++++++ sql/item_func.cc | 1 + 3 files changed, 17 insertions(+) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index b36902d7872..11a3d14fb65 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -145,3 +145,9 @@ insert into t1 values (1); select rand(i) from t1; ERROR HY000: Incorrect arguments to RAND drop table t1; +create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; +insert into t1 values ('http://www.foo.com/', now()); +select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); +a +http://www.foo.com/ +drop table t1; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index c75454a96d4..a8f62e38e86 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -86,4 +86,14 @@ insert into t1 values (1); select rand(i) from t1; drop table t1; +# +# Bug #14009: use of abs() on null value causes problems with filesort +# +# InnoDB is required to reproduce the fault, but it is okay if we default to +# MyISAM when testing. +create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; +insert into t1 values ('http://www.foo.com/', now()); +select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); +drop table t1; + # End of 4.1 tests diff --git a/sql/item_func.cc b/sql/item_func.cc index 288859443ff..5a70e6ba89b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -766,6 +766,7 @@ void Item_func_abs::fix_length_and_dec() hybrid_type= REAL_RESULT; if (args[0]->result_type() == INT_RESULT) hybrid_type= INT_RESULT; + maybe_null= 1; } From 7ccf86124211e15ab62e9bc5e9637153a4d00ec5 Mon Sep 17 00:00:00 2001 From: "gluh@eagle.intranet.mysql.r18.ru" <> Date: Tue, 18 Oct 2005 14:25:03 +0500 Subject: [PATCH 155/322] Fix for bug#13783 mysqlcheck tries to optimize and analyze information_schema 'information_schema' is excluded from list of databases for mysqlcheck command --- client/mysqlcheck.c | 3 +++ mysql-test/mysql-test-run.pl | 13 +++++++++++++ mysql-test/mysql-test-run.sh | 14 ++++++++++++-- mysql-test/r/mysqlcheck.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/mysqlcheck.test | 11 +++++++++++ 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/mysqlcheck.result create mode 100644 mysql-test/t/mysqlcheck.test diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 35d57e0394e..2eb3e55c2e9 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -497,6 +497,9 @@ static int process_all_tables_in_db(char *database) static int use_db(char *database) { + if (mysql_get_server_version(sock) >= 50003 && + !my_strcasecmp(&my_charset_latin1, database, "information_schema")) + return 1; if (mysql_select_db(sock, database)) { DBerror(sock, "when selecting the database"); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 35f26199fc8..d9874bf629f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -171,6 +171,7 @@ our $exe_mysqladmin; our $exe_mysqlbinlog; our $exe_mysql_client_test; our $exe_mysqld; +our $exe_mysqlcheck; # Called from test case our $exe_mysqldump; # Called from test case our $exe_mysqlshow; # Called from test case our $exe_mysql_fix_system_tables; @@ -911,6 +912,7 @@ sub executable_setup () { mtr_exe_exists("$glob_basedir/tests/mysql_client_test", "/usr/bin/false"); } + $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); @@ -926,6 +928,7 @@ sub executable_setup () { else { $path_client_bindir= mtr_path_exists("$glob_basedir/bin"); + $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); @@ -2354,6 +2357,15 @@ sub im_stop($) { sub run_mysqltest ($) { my $tinfo= shift; + my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqlcheck .= + " --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; + } + my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . "--port=$master->[0]->{'path_myport'} " . "--socket=$master->[0]->{'path_mysock'} --password="; @@ -2413,6 +2425,7 @@ sub run_mysqltest ($) { # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; $ENV{'MYSQL'}= $cmdline_mysql; + $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck; $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow; $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index aadf9080348..bd0851fa8b9 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -222,6 +222,7 @@ FAILED_CASES= EXTRA_MASTER_OPT="" EXTRA_MYSQL_TEST_OPT="" +EXTRA_MYSQLCHECK_OPT="" EXTRA_MYSQLDUMP_OPT="" EXTRA_MYSQLSHOW_OPT="" EXTRA_MYSQLBINLOG_OPT="" @@ -455,6 +456,8 @@ while test $# -gt 0; do --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace" + EXTRA_MYSQLCHECK_OPT="$EXTRA_MYSQLCHECK_OPT \ + --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlcheck.trace" EXTRA_MYSQLDUMP_OPT="$EXTRA_MYSQLDUMP_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace" EXTRA_MYSQLSHOW_OPT="$EXTRA_MYSQLSHOW_OPT \ @@ -557,6 +560,11 @@ if [ x$SOURCE_DIST = x1 ] ; then fi MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test" fi + if [ -f "$BASEDIR/client/.libs/mysqlcheck" ] ; then + MYSQL_CHECK="$BASEDIR/client/.libs/mysqlcheck" + else + MYSQL_CHECK="$BASEDIR/client/mysqlcheck" + fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" else @@ -635,6 +643,7 @@ else TESTS_BINDIR="$BASEDIR/bin" fi MYSQL_TEST="$CLIENT_BINDIR/mysqltest" + MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_SHOW="$CLIENT_BINDIR/mysqlshow" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" @@ -720,12 +729,13 @@ fi # Save path and name of mysqldump MYSQL_DUMP_DIR="$MYSQL_DUMP" export MYSQL_DUMP_DIR +MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES +export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS export NDB_TOOLS_DIR export NDB_MGM @@ -757,7 +767,7 @@ if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then XTERM=`which xterm` fi -export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK +export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK #++ # Function Definitions diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result new file mode 100644 index 00000000000..8c98e18aa9b --- /dev/null +++ b/mysql-test/r/mysqlcheck.result @@ -0,0 +1,34 @@ +mysql.columns_priv OK +mysql.db OK +mysql.func OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.proc OK +mysql.procs_priv OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +mysql.columns_priv OK +mysql.db OK +mysql.func OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.proc OK +mysql.procs_priv OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test new file mode 100644 index 00000000000..bc88be001ab --- /dev/null +++ b/mysql-test/t/mysqlcheck.test @@ -0,0 +1,11 @@ +# Embedded server doesn't support external clients +--source include/not_embedded.inc + +# +# Bug #13783 mysqlcheck tries to optimize and analyze information_schema +# +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --all-databases --analyze --optimize +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql +--exec $MYSQL_CHECK --analyze --optimize information_schema schemata From b91173af11b92f61417f826e4980387219478047 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Tue, 18 Oct 2005 14:04:14 +0400 Subject: [PATCH 156/322] BUG#12915: post-review fixes --- sql/opt_range.cc | 12 +++++++----- sql/records.cc | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 29994c14d3e..71f937f90c6 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -584,8 +584,7 @@ SEL_ARG *SEL_ARG::clone_tree() /* - Find an index that allows to retrieve first #limit records in the given - order cheaper then one would retrieve them using full table scan. + Find the best index to retrieve first N records in given order SYNOPSIS get_index_for_order() @@ -594,10 +593,13 @@ SEL_ARG *SEL_ARG::clone_tree() limit Number of records that will be retrieved DESCRIPTION + Find the best index that allows to retrieve first #limit records in the + given order cheaper then one would retrieve them using full table scan. + + IMPLEMENTATION Run through all table indexes and find the shortest index that allows - records to be retrieved in given order. If there is such index and - reading first #limit records from it is cheaper then scanning the entire - table, return it. + records to be retrieved in given order. We look for the shortest index + as we will have fewer index pages to read with it. This function is used only by UPDATE/DELETE, so we take into account how the UPDATE/DELETE code will work: diff --git a/sql/records.cc b/sql/records.cc index 1bf585ae46a..9150024d4b8 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -235,13 +235,16 @@ static int rr_quick(READ_RECORD *info) /* - Read next index record. The calling convention of this function is - compatible with READ_RECORD::read_record. + A READ_RECORD::read_record implementation that reads index sequentially SYNOPSIS rr_index() info Scan info - + + DESCRIPTION + Read the next index record (in forward direction) and translate return + value. + RETURN 0 Ok -1 End of records @@ -271,13 +274,13 @@ static int rr_index(READ_RECORD *info) if (tmp != HA_ERR_RECORD_DELETED) { if (tmp == HA_ERR_END_OF_FILE) - tmp= -1; + tmp= -1; else { - if (info->print_error) - info->table->file->print_error(tmp,MYF(0)); - if (tmp < 0) // Fix negative BDB errno - tmp=1; + if (info->print_error) + info->table->file->print_error(tmp,MYF(0)); + if (tmp < 0) // Fix negative BDB errno + tmp=1; } break; } From a9d1a37477729d78ac679c469f06bbc38eae4560 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Tue, 18 Oct 2005 17:23:18 +0500 Subject: [PATCH 157/322] Fix for bug #14064: information_schema test fails on opnsrv6c. --- sql/sql_show.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a03eca54b9d..e1d3c7d6d33 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2561,9 +2561,9 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables, { longlong c_octet_len= is_blob ? (longlong) field->max_length() : (longlong) field->max_length()/field->charset()->mbmaxlen; - table->field[8]->store(c_octet_len, TRUE); + table->field[8]->store((longlong) field->max_length(), TRUE); table->field[8]->set_notnull(); - table->field[9]->store((longlong) field->max_length()); + table->field[9]->store(c_octet_len, TRUE); table->field[9]->set_notnull(); } @@ -2604,7 +2604,7 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables, if (field_length >= 0) { - table->field[10]->store((longlong) field_length); + table->field[10]->store((longlong) field_length, TRUE); table->field[10]->set_notnull(); } if (decimals >= 0) From 05e63b96b08491e0838ee6dfe4447589baec5ef5 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 18 Oct 2005 15:38:32 +0200 Subject: [PATCH 158/322] Add file mysql-test/include/common-tests.inc --- mysql-test/include/common-tests.inc | 1832 +++++++++++++++++++++++++++ 1 file changed, 1832 insertions(+) create mode 100644 mysql-test/include/common-tests.inc diff --git a/mysql-test/include/common-tests.inc b/mysql-test/include/common-tests.inc new file mode 100644 index 00000000000..46d0182d17f --- /dev/null +++ b/mysql-test/include/common-tests.inc @@ -0,0 +1,1832 @@ +# +# This file contains a generic set of test that is run from +# different test scripts to test for example ssl encrypted +# and compressed connection +# +# + +# +# Simple select test +# + +--disable_warnings +drop table if exists t1,t2,t3,t4; +--enable_warnings + +CREATE TABLE t1 ( + Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, + Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); + +INSERT INTO t1 VALUES (9410,9412); + +select period from t1; +select * from t1; +select t1.* from t1; + +# +# Create test table +# + +CREATE TABLE t2 ( + auto int not null auto_increment, + fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, + companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, + fld3 char(30) DEFAULT '' NOT NULL, + fld4 char(35) DEFAULT '' NOT NULL, + fld5 char(35) DEFAULT '' NOT NULL, + fld6 char(4) DEFAULT '' NOT NULL, + UNIQUE fld1 (fld1), + KEY fld3 (fld3), + PRIMARY KEY (auto) +); + +# +# Populate table +# + +--disable_query_log +INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat',''); +INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); +INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); +INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); +INSERT INTO t2 VALUES (5,011501,37,'bewilderingly','wallet','balled',''); +INSERT INTO t2 VALUES (6,011701,37,'astound','parters','persist','W'); +INSERT INTO t2 VALUES (7,011702,37,'admonishing','eschew','attainments',''); +INSERT INTO t2 VALUES (8,011703,37,'sumac','quitter','fanatic',''); +INSERT INTO t2 VALUES (9,012001,37,'flanking','neat','measures','FAS'); +INSERT INTO t2 VALUES (10,012003,37,'combed','Steinberg','rightfulness',''); +INSERT INTO t2 VALUES (11,012004,37,'subjective','jarring','capably',''); +INSERT INTO t2 VALUES (12,012005,37,'scatterbrain','tinily','impulsive',''); +INSERT INTO t2 VALUES (13,012301,37,'Eulerian','balled','starlet',''); +INSERT INTO t2 VALUES (14,012302,36,'dubbed','persist','terminators',''); +INSERT INTO t2 VALUES (15,012303,37,'Kane','attainments','untying',''); +INSERT INTO t2 VALUES (16,012304,37,'overlay','fanatic','announces','FAS'); +INSERT INTO t2 VALUES (17,012305,37,'perturb','measures','featherweight','FAS'); +INSERT INTO t2 VALUES (18,012306,37,'goblins','rightfulness','pessimist','FAS'); +INSERT INTO t2 VALUES (19,012501,37,'annihilates','capably','daughter',''); +INSERT INTO t2 VALUES (20,012602,37,'Wotan','impulsive','decliner','FAS'); +INSERT INTO t2 VALUES (21,012603,37,'snatching','starlet','lawgiver',''); +INSERT INTO t2 VALUES (22,012604,37,'concludes','terminators','stated',''); +INSERT INTO t2 VALUES (23,012605,37,'laterally','untying','readable',''); +INSERT INTO t2 VALUES (24,012606,37,'yelped','announces','attrition',''); +INSERT INTO t2 VALUES (25,012701,37,'grazing','featherweight','cascade','FAS'); +INSERT INTO t2 VALUES (26,012702,37,'Baird','pessimist','motors','FAS'); +INSERT INTO t2 VALUES (27,012703,37,'celery','daughter','interrogate',''); +INSERT INTO t2 VALUES (28,012704,37,'misunderstander','decliner','pests','W'); +INSERT INTO t2 VALUES (29,013601,37,'handgun','lawgiver','stairway',''); +INSERT INTO t2 VALUES (30,013602,37,'foldout','stated','dopers','FAS'); +INSERT INTO t2 VALUES (31,013603,37,'mystic','readable','testicle','W'); +INSERT INTO t2 VALUES (32,013604,37,'succumbed','attrition','Parsifal','W'); +INSERT INTO t2 VALUES (33,013605,37,'Nabisco','cascade','leavings',''); +INSERT INTO t2 VALUES (34,013606,37,'fingerings','motors','postulation','W'); +INSERT INTO t2 VALUES (35,013607,37,'aging','interrogate','squeaking',''); +INSERT INTO t2 VALUES (36,013608,37,'afield','pests','contrasted',''); +INSERT INTO t2 VALUES (37,013609,37,'ammonium','stairway','leftover',''); +INSERT INTO t2 VALUES (38,013610,37,'boat','dopers','whiteners',''); +INSERT INTO t2 VALUES (39,013801,37,'intelligibility','testicle','erases','W'); +INSERT INTO t2 VALUES (40,013802,37,'Augustine','Parsifal','Punjab','W'); +INSERT INTO t2 VALUES (41,013803,37,'teethe','leavings','Merritt',''); +INSERT INTO t2 VALUES (42,013804,37,'dreaded','postulation','Quixotism',''); +INSERT INTO t2 VALUES (43,013901,37,'scholastics','squeaking','sweetish','FAS'); +INSERT INTO t2 VALUES (44,016001,37,'audiology','contrasted','dogging','FAS'); +INSERT INTO t2 VALUES (45,016201,37,'wallet','leftover','scornfully','FAS'); +INSERT INTO t2 VALUES (46,016202,37,'parters','whiteners','bellow',''); +INSERT INTO t2 VALUES (47,016301,37,'eschew','erases','bills',''); +INSERT INTO t2 VALUES (48,016302,37,'quitter','Punjab','cupboard','FAS'); +INSERT INTO t2 VALUES (49,016303,37,'neat','Merritt','sureties','FAS'); +INSERT INTO t2 VALUES (50,016304,37,'Steinberg','Quixotism','puddings',''); +INSERT INTO t2 VALUES (51,018001,37,'jarring','sweetish','tapestry',''); +INSERT INTO t2 VALUES (52,018002,37,'tinily','dogging','fetters',''); +INSERT INTO t2 VALUES (53,018003,37,'balled','scornfully','bivalves',''); +INSERT INTO t2 VALUES (54,018004,37,'persist','bellow','incurring',''); +INSERT INTO t2 VALUES (55,018005,37,'attainments','bills','Adolph',''); +INSERT INTO t2 VALUES (56,018007,37,'fanatic','cupboard','pithed',''); +INSERT INTO t2 VALUES (57,018008,37,'measures','sureties','emergency',''); +INSERT INTO t2 VALUES (58,018009,37,'rightfulness','puddings','Miles',''); +INSERT INTO t2 VALUES (59,018010,37,'capably','tapestry','trimmings',''); +INSERT INTO t2 VALUES (60,018012,37,'impulsive','fetters','tragedies','W'); +INSERT INTO t2 VALUES (61,018013,37,'starlet','bivalves','skulking','W'); +INSERT INTO t2 VALUES (62,018014,37,'terminators','incurring','flint',''); +INSERT INTO t2 VALUES (63,018015,37,'untying','Adolph','flopping','W'); +INSERT INTO t2 VALUES (64,018016,37,'announces','pithed','relaxing','FAS'); +INSERT INTO t2 VALUES (65,018017,37,'featherweight','emergency','offload','FAS'); +INSERT INTO t2 VALUES (66,018018,37,'pessimist','Miles','suites','W'); +INSERT INTO t2 VALUES (67,018019,37,'daughter','trimmings','lists','FAS'); +INSERT INTO t2 VALUES (68,018020,37,'decliner','tragedies','animized','FAS'); +INSERT INTO t2 VALUES (69,018021,37,'lawgiver','skulking','multilayer','W'); +INSERT INTO t2 VALUES (70,018022,37,'stated','flint','standardizes','FAS'); +INSERT INTO t2 VALUES (71,018023,37,'readable','flopping','Judas',''); +INSERT INTO t2 VALUES (72,018024,37,'attrition','relaxing','vacuuming','W'); +INSERT INTO t2 VALUES (73,018025,37,'cascade','offload','dentally','W'); +INSERT INTO t2 VALUES (74,018026,37,'motors','suites','humanness','W'); +INSERT INTO t2 VALUES (75,018027,37,'interrogate','lists','inch','W'); +INSERT INTO t2 VALUES (76,018028,37,'pests','animized','Weissmuller','W'); +INSERT INTO t2 VALUES (77,018029,37,'stairway','multilayer','irresponsibly','W'); +INSERT INTO t2 VALUES (78,018030,37,'dopers','standardizes','luckily','FAS'); +INSERT INTO t2 VALUES (79,018032,37,'testicle','Judas','culled','W'); +INSERT INTO t2 VALUES (80,018033,37,'Parsifal','vacuuming','medical','FAS'); +INSERT INTO t2 VALUES (81,018034,37,'leavings','dentally','bloodbath','FAS'); +INSERT INTO t2 VALUES (82,018035,37,'postulation','humanness','subschema','W'); +INSERT INTO t2 VALUES (83,018036,37,'squeaking','inch','animals','W'); +INSERT INTO t2 VALUES (84,018037,37,'contrasted','Weissmuller','Micronesia',''); +INSERT INTO t2 VALUES (85,018038,37,'leftover','irresponsibly','repetitions',''); +INSERT INTO t2 VALUES (86,018039,37,'whiteners','luckily','Antares',''); +INSERT INTO t2 VALUES (87,018040,37,'erases','culled','ventilate','W'); +INSERT INTO t2 VALUES (88,018041,37,'Punjab','medical','pityingly',''); +INSERT INTO t2 VALUES (89,018042,37,'Merritt','bloodbath','interdependent',''); +INSERT INTO t2 VALUES (90,018043,37,'Quixotism','subschema','Graves','FAS'); +INSERT INTO t2 VALUES (91,018044,37,'sweetish','animals','neonatal',''); +INSERT INTO t2 VALUES (92,018045,37,'dogging','Micronesia','scribbled','FAS'); +INSERT INTO t2 VALUES (93,018046,37,'scornfully','repetitions','chafe','W'); +INSERT INTO t2 VALUES (94,018048,37,'bellow','Antares','honoring',''); +INSERT INTO t2 VALUES (95,018049,37,'bills','ventilate','realtor',''); +INSERT INTO t2 VALUES (96,018050,37,'cupboard','pityingly','elite',''); +INSERT INTO t2 VALUES (97,018051,37,'sureties','interdependent','funereal',''); +INSERT INTO t2 VALUES (98,018052,37,'puddings','Graves','abrogating',''); +INSERT INTO t2 VALUES (99,018053,50,'tapestry','neonatal','sorters',''); +INSERT INTO t2 VALUES (100,018054,37,'fetters','scribbled','Conley',''); +INSERT INTO t2 VALUES (101,018055,37,'bivalves','chafe','lectured',''); +INSERT INTO t2 VALUES (102,018056,37,'incurring','honoring','Abraham',''); +INSERT INTO t2 VALUES (103,018057,37,'Adolph','realtor','Hawaii','W'); +INSERT INTO t2 VALUES (104,018058,37,'pithed','elite','cage',''); +INSERT INTO t2 VALUES (105,018059,36,'emergency','funereal','hushes',''); +INSERT INTO t2 VALUES (106,018060,37,'Miles','abrogating','Simla',''); +INSERT INTO t2 VALUES (107,018061,37,'trimmings','sorters','reporters',''); +INSERT INTO t2 VALUES (108,018101,37,'tragedies','Conley','Dutchman','FAS'); +INSERT INTO t2 VALUES (109,018102,37,'skulking','lectured','descendants','FAS'); +INSERT INTO t2 VALUES (110,018103,37,'flint','Abraham','groupings','FAS'); +INSERT INTO t2 VALUES (111,018104,37,'flopping','Hawaii','dissociate',''); +INSERT INTO t2 VALUES (112,018201,37,'relaxing','cage','coexist','W'); +INSERT INTO t2 VALUES (113,018202,37,'offload','hushes','Beebe',''); +INSERT INTO t2 VALUES (114,018402,37,'suites','Simla','Taoism',''); +INSERT INTO t2 VALUES (115,018403,37,'lists','reporters','Connally',''); +INSERT INTO t2 VALUES (116,018404,37,'animized','Dutchman','fetched','FAS'); +INSERT INTO t2 VALUES (117,018405,37,'multilayer','descendants','checkpoints','FAS'); +INSERT INTO t2 VALUES (118,018406,37,'standardizes','groupings','rusting',''); +INSERT INTO t2 VALUES (119,018409,37,'Judas','dissociate','galling',''); +INSERT INTO t2 VALUES (120,018601,37,'vacuuming','coexist','obliterates',''); +INSERT INTO t2 VALUES (121,018602,37,'dentally','Beebe','traitor',''); +INSERT INTO t2 VALUES (122,018603,37,'humanness','Taoism','resumes','FAS'); +INSERT INTO t2 VALUES (123,018801,37,'inch','Connally','analyzable','FAS'); +INSERT INTO t2 VALUES (124,018802,37,'Weissmuller','fetched','terminator','FAS'); +INSERT INTO t2 VALUES (125,018803,37,'irresponsibly','checkpoints','gritty','FAS'); +INSERT INTO t2 VALUES (126,018804,37,'luckily','rusting','firearm','W'); +INSERT INTO t2 VALUES (127,018805,37,'culled','galling','minima',''); +INSERT INTO t2 VALUES (128,018806,37,'medical','obliterates','Selfridge',''); +INSERT INTO t2 VALUES (129,018807,37,'bloodbath','traitor','disable',''); +INSERT INTO t2 VALUES (130,018808,37,'subschema','resumes','witchcraft','W'); +INSERT INTO t2 VALUES (131,018809,37,'animals','analyzable','betroth','W'); +INSERT INTO t2 VALUES (132,018810,37,'Micronesia','terminator','Manhattanize',''); +INSERT INTO t2 VALUES (133,018811,37,'repetitions','gritty','imprint',''); +INSERT INTO t2 VALUES (134,018812,37,'Antares','firearm','peeked',''); +INSERT INTO t2 VALUES (135,019101,37,'ventilate','minima','swelling',''); +INSERT INTO t2 VALUES (136,019102,37,'pityingly','Selfridge','interrelationships','W'); +INSERT INTO t2 VALUES (137,019103,37,'interdependent','disable','riser',''); +INSERT INTO t2 VALUES (138,019201,37,'Graves','witchcraft','Gandhian','W'); +INSERT INTO t2 VALUES (139,030501,37,'neonatal','betroth','peacock','A'); +INSERT INTO t2 VALUES (140,030502,50,'scribbled','Manhattanize','bee','A'); +INSERT INTO t2 VALUES (141,030503,37,'chafe','imprint','kanji',''); +INSERT INTO t2 VALUES (142,030504,37,'honoring','peeked','dental',''); +INSERT INTO t2 VALUES (143,031901,37,'realtor','swelling','scarf','FAS'); +INSERT INTO t2 VALUES (144,036001,37,'elite','interrelationships','chasm','A'); +INSERT INTO t2 VALUES (145,036002,37,'funereal','riser','insolence','A'); +INSERT INTO t2 VALUES (146,036004,37,'abrogating','Gandhian','syndicate',''); +INSERT INTO t2 VALUES (147,036005,37,'sorters','peacock','alike',''); +INSERT INTO t2 VALUES (148,038001,37,'Conley','bee','imperial','A'); +INSERT INTO t2 VALUES (149,038002,37,'lectured','kanji','convulsion','A'); +INSERT INTO t2 VALUES (150,038003,37,'Abraham','dental','railway','A'); +INSERT INTO t2 VALUES (151,038004,37,'Hawaii','scarf','validate','A'); +INSERT INTO t2 VALUES (152,038005,37,'cage','chasm','normalizes','A'); +INSERT INTO t2 VALUES (153,038006,37,'hushes','insolence','comprehensive',''); +INSERT INTO t2 VALUES (154,038007,37,'Simla','syndicate','chewing',''); +INSERT INTO t2 VALUES (155,038008,37,'reporters','alike','denizen',''); +INSERT INTO t2 VALUES (156,038009,37,'Dutchman','imperial','schemer',''); +INSERT INTO t2 VALUES (157,038010,37,'descendants','convulsion','chronicle',''); +INSERT INTO t2 VALUES (158,038011,37,'groupings','railway','Kline',''); +INSERT INTO t2 VALUES (159,038012,37,'dissociate','validate','Anatole',''); +INSERT INTO t2 VALUES (160,038013,37,'coexist','normalizes','partridges',''); +INSERT INTO t2 VALUES (161,038014,37,'Beebe','comprehensive','brunch',''); +INSERT INTO t2 VALUES (162,038015,37,'Taoism','chewing','recruited',''); +INSERT INTO t2 VALUES (163,038016,37,'Connally','denizen','dimensions','W'); +INSERT INTO t2 VALUES (164,038017,37,'fetched','schemer','Chicana','W'); +INSERT INTO t2 VALUES (165,038018,37,'checkpoints','chronicle','announced',''); +INSERT INTO t2 VALUES (166,038101,37,'rusting','Kline','praised','FAS'); +INSERT INTO t2 VALUES (167,038102,37,'galling','Anatole','employing',''); +INSERT INTO t2 VALUES (168,038103,37,'obliterates','partridges','linear',''); +INSERT INTO t2 VALUES (169,038104,37,'traitor','brunch','quagmire',''); +INSERT INTO t2 VALUES (170,038201,37,'resumes','recruited','western','A'); +INSERT INTO t2 VALUES (171,038202,37,'analyzable','dimensions','relishing',''); +INSERT INTO t2 VALUES (172,038203,37,'terminator','Chicana','serving','A'); +INSERT INTO t2 VALUES (173,038204,37,'gritty','announced','scheduling',''); +INSERT INTO t2 VALUES (174,038205,37,'firearm','praised','lore',''); +INSERT INTO t2 VALUES (175,038206,37,'minima','employing','eventful',''); +INSERT INTO t2 VALUES (176,038208,37,'Selfridge','linear','arteriole','A'); +INSERT INTO t2 VALUES (177,042801,37,'disable','quagmire','disentangle',''); +INSERT INTO t2 VALUES (178,042802,37,'witchcraft','western','cured','A'); +INSERT INTO t2 VALUES (179,046101,37,'betroth','relishing','Fenton','W'); +INSERT INTO t2 VALUES (180,048001,37,'Manhattanize','serving','avoidable','A'); +INSERT INTO t2 VALUES (181,048002,37,'imprint','scheduling','drains','A'); +INSERT INTO t2 VALUES (182,048003,37,'peeked','lore','detectably','FAS'); +INSERT INTO t2 VALUES (183,048004,37,'swelling','eventful','husky',''); +INSERT INTO t2 VALUES (184,048005,37,'interrelationships','arteriole','impelling',''); +INSERT INTO t2 VALUES (185,048006,37,'riser','disentangle','undoes',''); +INSERT INTO t2 VALUES (186,048007,37,'Gandhian','cured','evened',''); +INSERT INTO t2 VALUES (187,048008,37,'peacock','Fenton','squeezes',''); +INSERT INTO t2 VALUES (188,048101,37,'bee','avoidable','destroyer','FAS'); +INSERT INTO t2 VALUES (189,048102,37,'kanji','drains','rudeness',''); +INSERT INTO t2 VALUES (190,048201,37,'dental','detectably','beaner','FAS'); +INSERT INTO t2 VALUES (191,048202,37,'scarf','husky','boorish',''); +INSERT INTO t2 VALUES (192,048203,37,'chasm','impelling','Everhart',''); +INSERT INTO t2 VALUES (193,048204,37,'insolence','undoes','encompass','A'); +INSERT INTO t2 VALUES (194,048205,37,'syndicate','evened','mushrooms',''); +INSERT INTO t2 VALUES (195,048301,37,'alike','squeezes','Alison','A'); +INSERT INTO t2 VALUES (196,048302,37,'imperial','destroyer','externally','FAS'); +INSERT INTO t2 VALUES (197,048303,37,'convulsion','rudeness','pellagra',''); +INSERT INTO t2 VALUES (198,048304,37,'railway','beaner','cult',''); +INSERT INTO t2 VALUES (199,048305,37,'validate','boorish','creek','A'); +INSERT INTO t2 VALUES (200,048401,37,'normalizes','Everhart','Huffman',''); +INSERT INTO t2 VALUES (201,048402,37,'comprehensive','encompass','Majorca','FAS'); +INSERT INTO t2 VALUES (202,048403,37,'chewing','mushrooms','governing','A'); +INSERT INTO t2 VALUES (203,048404,37,'denizen','Alison','gadfly','FAS'); +INSERT INTO t2 VALUES (204,048405,37,'schemer','externally','reassigned','FAS'); +INSERT INTO t2 VALUES (205,048406,37,'chronicle','pellagra','intentness','W'); +INSERT INTO t2 VALUES (206,048407,37,'Kline','cult','craziness',''); +INSERT INTO t2 VALUES (207,048408,37,'Anatole','creek','psychic',''); +INSERT INTO t2 VALUES (208,048409,37,'partridges','Huffman','squabbled',''); +INSERT INTO t2 VALUES (209,048410,37,'brunch','Majorca','burlesque',''); +INSERT INTO t2 VALUES (210,048411,37,'recruited','governing','capped',''); +INSERT INTO t2 VALUES (211,048412,37,'dimensions','gadfly','extracted','A'); +INSERT INTO t2 VALUES (212,048413,37,'Chicana','reassigned','DiMaggio',''); +INSERT INTO t2 VALUES (213,048601,37,'announced','intentness','exclamation','FAS'); +INSERT INTO t2 VALUES (214,048602,37,'praised','craziness','subdirectory',''); +INSERT INTO t2 VALUES (215,048603,37,'employing','psychic','fangs',''); +INSERT INTO t2 VALUES (216,048604,37,'linear','squabbled','buyer','A'); +INSERT INTO t2 VALUES (217,048801,37,'quagmire','burlesque','pithing','A'); +INSERT INTO t2 VALUES (218,050901,37,'western','capped','transistorizing','A'); +INSERT INTO t2 VALUES (219,051201,37,'relishing','extracted','nonbiodegradable',''); +INSERT INTO t2 VALUES (220,056002,37,'serving','DiMaggio','dislocate',''); +INSERT INTO t2 VALUES (221,056003,37,'scheduling','exclamation','monochromatic','FAS'); +INSERT INTO t2 VALUES (222,056004,37,'lore','subdirectory','batting',''); +INSERT INTO t2 VALUES (223,056102,37,'eventful','fangs','postcondition','A'); +INSERT INTO t2 VALUES (224,056203,37,'arteriole','buyer','catalog','FAS'); +INSERT INTO t2 VALUES (225,056204,37,'disentangle','pithing','Remus',''); +INSERT INTO t2 VALUES (226,058003,37,'cured','transistorizing','devices','A'); +INSERT INTO t2 VALUES (227,058004,37,'Fenton','nonbiodegradable','bike','A'); +INSERT INTO t2 VALUES (228,058005,37,'avoidable','dislocate','qualify',''); +INSERT INTO t2 VALUES (229,058006,37,'drains','monochromatic','detained',''); +INSERT INTO t2 VALUES (230,058007,37,'detectably','batting','commended',''); +INSERT INTO t2 VALUES (231,058101,37,'husky','postcondition','civilize',''); +INSERT INTO t2 VALUES (232,058102,37,'impelling','catalog','Elmhurst',''); +INSERT INTO t2 VALUES (233,058103,37,'undoes','Remus','anesthetizing',''); +INSERT INTO t2 VALUES (234,058105,37,'evened','devices','deaf',''); +INSERT INTO t2 VALUES (235,058111,37,'squeezes','bike','Brigham',''); +INSERT INTO t2 VALUES (236,058112,37,'destroyer','qualify','title',''); +INSERT INTO t2 VALUES (237,058113,37,'rudeness','detained','coarse',''); +INSERT INTO t2 VALUES (238,058114,37,'beaner','commended','combinations',''); +INSERT INTO t2 VALUES (239,058115,37,'boorish','civilize','grayness',''); +INSERT INTO t2 VALUES (240,058116,37,'Everhart','Elmhurst','innumerable','FAS'); +INSERT INTO t2 VALUES (241,058117,37,'encompass','anesthetizing','Caroline','A'); +INSERT INTO t2 VALUES (242,058118,37,'mushrooms','deaf','fatty','FAS'); +INSERT INTO t2 VALUES (243,058119,37,'Alison','Brigham','eastbound',''); +INSERT INTO t2 VALUES (244,058120,37,'externally','title','inexperienced',''); +INSERT INTO t2 VALUES (245,058121,37,'pellagra','coarse','hoarder','A'); +INSERT INTO t2 VALUES (246,058122,37,'cult','combinations','scotch','W'); +INSERT INTO t2 VALUES (247,058123,37,'creek','grayness','passport','A'); +INSERT INTO t2 VALUES (248,058124,37,'Huffman','innumerable','strategic','FAS'); +INSERT INTO t2 VALUES (249,058125,37,'Majorca','Caroline','gated',''); +INSERT INTO t2 VALUES (250,058126,37,'governing','fatty','flog',''); +INSERT INTO t2 VALUES (251,058127,37,'gadfly','eastbound','Pipestone',''); +INSERT INTO t2 VALUES (252,058128,37,'reassigned','inexperienced','Dar',''); +INSERT INTO t2 VALUES (253,058201,37,'intentness','hoarder','Corcoran',''); +INSERT INTO t2 VALUES (254,058202,37,'craziness','scotch','flyers','A'); +INSERT INTO t2 VALUES (255,058303,37,'psychic','passport','competitions','W'); +INSERT INTO t2 VALUES (256,058304,37,'squabbled','strategic','suppliers','FAS'); +INSERT INTO t2 VALUES (257,058602,37,'burlesque','gated','skips',''); +INSERT INTO t2 VALUES (258,058603,37,'capped','flog','institutes',''); +INSERT INTO t2 VALUES (259,058604,37,'extracted','Pipestone','troop','A'); +INSERT INTO t2 VALUES (260,058605,37,'DiMaggio','Dar','connective','W'); +INSERT INTO t2 VALUES (261,058606,37,'exclamation','Corcoran','denies',''); +INSERT INTO t2 VALUES (262,058607,37,'subdirectory','flyers','polka',''); +INSERT INTO t2 VALUES (263,060401,36,'fangs','competitions','observations','FAS'); +INSERT INTO t2 VALUES (264,061701,36,'buyer','suppliers','askers',''); +INSERT INTO t2 VALUES (265,066201,36,'pithing','skips','homeless','FAS'); +INSERT INTO t2 VALUES (266,066501,36,'transistorizing','institutes','Anna',''); +INSERT INTO t2 VALUES (267,068001,36,'nonbiodegradable','troop','subdirectories','W'); +INSERT INTO t2 VALUES (268,068002,36,'dislocate','connective','decaying','FAS'); +INSERT INTO t2 VALUES (269,068005,36,'monochromatic','denies','outwitting','W'); +INSERT INTO t2 VALUES (270,068006,36,'batting','polka','Harpy','W'); +INSERT INTO t2 VALUES (271,068007,36,'postcondition','observations','crazed',''); +INSERT INTO t2 VALUES (272,068008,36,'catalog','askers','suffocate',''); +INSERT INTO t2 VALUES (273,068009,36,'Remus','homeless','provers','FAS'); +INSERT INTO t2 VALUES (274,068010,36,'devices','Anna','technically',''); +INSERT INTO t2 VALUES (275,068011,36,'bike','subdirectories','Franklinizations',''); +INSERT INTO t2 VALUES (276,068202,36,'qualify','decaying','considered',''); +INSERT INTO t2 VALUES (277,068302,36,'detained','outwitting','tinnily',''); +INSERT INTO t2 VALUES (278,068303,36,'commended','Harpy','uninterruptedly',''); +INSERT INTO t2 VALUES (279,068401,36,'civilize','crazed','whistled','A'); +INSERT INTO t2 VALUES (280,068501,36,'Elmhurst','suffocate','automate',''); +INSERT INTO t2 VALUES (281,068502,36,'anesthetizing','provers','gutting','W'); +INSERT INTO t2 VALUES (282,068503,36,'deaf','technically','surreptitious',''); +INSERT INTO t2 VALUES (283,068602,36,'Brigham','Franklinizations','Choctaw',''); +INSERT INTO t2 VALUES (284,068603,36,'title','considered','cooks',''); +INSERT INTO t2 VALUES (285,068701,36,'coarse','tinnily','millivolt','FAS'); +INSERT INTO t2 VALUES (286,068702,36,'combinations','uninterruptedly','counterpoise',''); +INSERT INTO t2 VALUES (287,068703,36,'grayness','whistled','Gothicism',''); +INSERT INTO t2 VALUES (288,076001,36,'innumerable','automate','feminine',''); +INSERT INTO t2 VALUES (289,076002,36,'Caroline','gutting','metaphysically','W'); +INSERT INTO t2 VALUES (290,076101,36,'fatty','surreptitious','sanding','A'); +INSERT INTO t2 VALUES (291,076102,36,'eastbound','Choctaw','contributorily',''); +INSERT INTO t2 VALUES (292,076103,36,'inexperienced','cooks','receivers','FAS'); +INSERT INTO t2 VALUES (293,076302,36,'hoarder','millivolt','adjourn',''); +INSERT INTO t2 VALUES (294,076303,36,'scotch','counterpoise','straggled','A'); +INSERT INTO t2 VALUES (295,076304,36,'passport','Gothicism','druggists',''); +INSERT INTO t2 VALUES (296,076305,36,'strategic','feminine','thanking','FAS'); +INSERT INTO t2 VALUES (297,076306,36,'gated','metaphysically','ostrich',''); +INSERT INTO t2 VALUES (298,076307,36,'flog','sanding','hopelessness','FAS'); +INSERT INTO t2 VALUES (299,076402,36,'Pipestone','contributorily','Eurydice',''); +INSERT INTO t2 VALUES (300,076501,36,'Dar','receivers','excitation','W'); +INSERT INTO t2 VALUES (301,076502,36,'Corcoran','adjourn','presumes','FAS'); +INSERT INTO t2 VALUES (302,076701,36,'flyers','straggled','imaginable','FAS'); +INSERT INTO t2 VALUES (303,078001,36,'competitions','druggists','concoct','W'); +INSERT INTO t2 VALUES (304,078002,36,'suppliers','thanking','peering','W'); +INSERT INTO t2 VALUES (305,078003,36,'skips','ostrich','Phelps','FAS'); +INSERT INTO t2 VALUES (306,078004,36,'institutes','hopelessness','ferociousness','FAS'); +INSERT INTO t2 VALUES (307,078005,36,'troop','Eurydice','sentences',''); +INSERT INTO t2 VALUES (308,078006,36,'connective','excitation','unlocks',''); +INSERT INTO t2 VALUES (309,078007,36,'denies','presumes','engrossing','W'); +INSERT INTO t2 VALUES (310,078008,36,'polka','imaginable','Ruth',''); +INSERT INTO t2 VALUES (311,078101,36,'observations','concoct','tying',''); +INSERT INTO t2 VALUES (312,078103,36,'askers','peering','exclaimers',''); +INSERT INTO t2 VALUES (313,078104,36,'homeless','Phelps','synergy',''); +INSERT INTO t2 VALUES (314,078105,36,'Anna','ferociousness','Huey','W'); +INSERT INTO t2 VALUES (315,082101,36,'subdirectories','sentences','merging',''); +INSERT INTO t2 VALUES (316,083401,36,'decaying','unlocks','judges','A'); +INSERT INTO t2 VALUES (317,084001,36,'outwitting','engrossing','Shylock','W'); +INSERT INTO t2 VALUES (318,084002,36,'Harpy','Ruth','Miltonism',''); +INSERT INTO t2 VALUES (319,086001,36,'crazed','tying','hen','W'); +INSERT INTO t2 VALUES (320,086102,36,'suffocate','exclaimers','honeybee','FAS'); +INSERT INTO t2 VALUES (321,086201,36,'provers','synergy','towers',''); +INSERT INTO t2 VALUES (322,088001,36,'technically','Huey','dilutes','W'); +INSERT INTO t2 VALUES (323,088002,36,'Franklinizations','merging','numerals','FAS'); +INSERT INTO t2 VALUES (324,088003,36,'considered','judges','democracy','FAS'); +INSERT INTO t2 VALUES (325,088004,36,'tinnily','Shylock','Ibero-',''); +INSERT INTO t2 VALUES (326,088101,36,'uninterruptedly','Miltonism','invalids',''); +INSERT INTO t2 VALUES (327,088102,36,'whistled','hen','behavior',''); +INSERT INTO t2 VALUES (328,088103,36,'automate','honeybee','accruing',''); +INSERT INTO t2 VALUES (329,088104,36,'gutting','towers','relics','A'); +INSERT INTO t2 VALUES (330,088105,36,'surreptitious','dilutes','rackets',''); +INSERT INTO t2 VALUES (331,088106,36,'Choctaw','numerals','Fischbein','W'); +INSERT INTO t2 VALUES (332,088201,36,'cooks','democracy','phony','W'); +INSERT INTO t2 VALUES (333,088203,36,'millivolt','Ibero-','cross','FAS'); +INSERT INTO t2 VALUES (334,088204,36,'counterpoise','invalids','cleanup',''); +INSERT INTO t2 VALUES (335,088302,37,'Gothicism','behavior','conspirator',''); +INSERT INTO t2 VALUES (336,088303,37,'feminine','accruing','label','FAS'); +INSERT INTO t2 VALUES (337,088305,37,'metaphysically','relics','university',''); +INSERT INTO t2 VALUES (338,088402,37,'sanding','rackets','cleansed','FAS'); +INSERT INTO t2 VALUES (339,088501,36,'contributorily','Fischbein','ballgown',''); +INSERT INTO t2 VALUES (340,088502,36,'receivers','phony','starlet',''); +INSERT INTO t2 VALUES (341,088503,36,'adjourn','cross','aqueous',''); +INSERT INTO t2 VALUES (342,098001,58,'straggled','cleanup','portrayal','A'); +INSERT INTO t2 VALUES (343,098002,58,'druggists','conspirator','despising','W'); +INSERT INTO t2 VALUES (344,098003,58,'thanking','label','distort','W'); +INSERT INTO t2 VALUES (345,098004,58,'ostrich','university','palmed',''); +INSERT INTO t2 VALUES (346,098005,58,'hopelessness','cleansed','faced',''); +INSERT INTO t2 VALUES (347,098006,58,'Eurydice','ballgown','silverware',''); +INSERT INTO t2 VALUES (348,141903,29,'excitation','starlet','assessor',''); +INSERT INTO t2 VALUES (349,098008,58,'presumes','aqueous','spiders',''); +INSERT INTO t2 VALUES (350,098009,58,'imaginable','portrayal','artificially',''); +INSERT INTO t2 VALUES (351,098010,58,'concoct','despising','reminiscence',''); +INSERT INTO t2 VALUES (352,098011,58,'peering','distort','Mexican',''); +INSERT INTO t2 VALUES (353,098012,58,'Phelps','palmed','obnoxious',''); +INSERT INTO t2 VALUES (354,098013,58,'ferociousness','faced','fragile',''); +INSERT INTO t2 VALUES (355,098014,58,'sentences','silverware','apprehensible',''); +INSERT INTO t2 VALUES (356,098015,58,'unlocks','assessor','births',''); +INSERT INTO t2 VALUES (357,098016,58,'engrossing','spiders','garages',''); +INSERT INTO t2 VALUES (358,098017,58,'Ruth','artificially','panty',''); +INSERT INTO t2 VALUES (359,098018,58,'tying','reminiscence','anteater',''); +INSERT INTO t2 VALUES (360,098019,58,'exclaimers','Mexican','displacement','A'); +INSERT INTO t2 VALUES (361,098020,58,'synergy','obnoxious','drovers','A'); +INSERT INTO t2 VALUES (362,098021,58,'Huey','fragile','patenting','A'); +INSERT INTO t2 VALUES (363,098022,58,'merging','apprehensible','far','A'); +INSERT INTO t2 VALUES (364,098023,58,'judges','births','shrieks',''); +INSERT INTO t2 VALUES (365,098024,58,'Shylock','garages','aligning','W'); +INSERT INTO t2 VALUES (366,098025,37,'Miltonism','panty','pragmatism',''); +INSERT INTO t2 VALUES (367,106001,36,'hen','anteater','fevers','W'); +INSERT INTO t2 VALUES (368,108001,36,'honeybee','displacement','reexamines','A'); +INSERT INTO t2 VALUES (369,108002,36,'towers','drovers','occupancies',''); +INSERT INTO t2 VALUES (370,108003,36,'dilutes','patenting','sweats','FAS'); +INSERT INTO t2 VALUES (371,108004,36,'numerals','far','modulators',''); +INSERT INTO t2 VALUES (372,108005,36,'democracy','shrieks','demand','W'); +INSERT INTO t2 VALUES (373,108007,36,'Ibero-','aligning','Madeira',''); +INSERT INTO t2 VALUES (374,108008,36,'invalids','pragmatism','Viennese','W'); +INSERT INTO t2 VALUES (375,108009,36,'behavior','fevers','chillier','W'); +INSERT INTO t2 VALUES (376,108010,36,'accruing','reexamines','wildcats','FAS'); +INSERT INTO t2 VALUES (377,108011,36,'relics','occupancies','gentle',''); +INSERT INTO t2 VALUES (378,108012,36,'rackets','sweats','Angles','W'); +INSERT INTO t2 VALUES (379,108101,36,'Fischbein','modulators','accuracies',''); +INSERT INTO t2 VALUES (380,108102,36,'phony','demand','toggle',''); +INSERT INTO t2 VALUES (381,108103,36,'cross','Madeira','Mendelssohn','W'); +INSERT INTO t2 VALUES (382,108111,50,'cleanup','Viennese','behaviorally',''); +INSERT INTO t2 VALUES (383,108105,36,'conspirator','chillier','Rochford',''); +INSERT INTO t2 VALUES (384,108106,36,'label','wildcats','mirror','W'); +INSERT INTO t2 VALUES (385,108107,36,'university','gentle','Modula',''); +INSERT INTO t2 VALUES (386,108108,50,'cleansed','Angles','clobbering',''); +INSERT INTO t2 VALUES (387,108109,36,'ballgown','accuracies','chronography',''); +INSERT INTO t2 VALUES (388,108110,36,'starlet','toggle','Eskimoizeds',''); +INSERT INTO t2 VALUES (389,108201,36,'aqueous','Mendelssohn','British','W'); +INSERT INTO t2 VALUES (390,108202,36,'portrayal','behaviorally','pitfalls',''); +INSERT INTO t2 VALUES (391,108203,36,'despising','Rochford','verify','W'); +INSERT INTO t2 VALUES (392,108204,36,'distort','mirror','scatter','FAS'); +INSERT INTO t2 VALUES (393,108205,36,'palmed','Modula','Aztecan',''); +INSERT INTO t2 VALUES (394,108301,36,'faced','clobbering','acuity','W'); +INSERT INTO t2 VALUES (395,108302,36,'silverware','chronography','sinking','W'); +INSERT INTO t2 VALUES (396,112101,36,'assessor','Eskimoizeds','beasts','FAS'); +INSERT INTO t2 VALUES (397,112102,36,'spiders','British','Witt','W'); +INSERT INTO t2 VALUES (398,113701,36,'artificially','pitfalls','physicists','FAS'); +INSERT INTO t2 VALUES (399,116001,36,'reminiscence','verify','folksong','A'); +INSERT INTO t2 VALUES (400,116201,36,'Mexican','scatter','strokes','FAS'); +INSERT INTO t2 VALUES (401,116301,36,'obnoxious','Aztecan','crowder',''); +INSERT INTO t2 VALUES (402,116302,36,'fragile','acuity','merry',''); +INSERT INTO t2 VALUES (403,116601,36,'apprehensible','sinking','cadenced',''); +INSERT INTO t2 VALUES (404,116602,36,'births','beasts','alimony','A'); +INSERT INTO t2 VALUES (405,116603,36,'garages','Witt','principled','A'); +INSERT INTO t2 VALUES (406,116701,36,'panty','physicists','golfing',''); +INSERT INTO t2 VALUES (407,116702,36,'anteater','folksong','undiscovered',''); +INSERT INTO t2 VALUES (408,118001,36,'displacement','strokes','irritates',''); +INSERT INTO t2 VALUES (409,118002,36,'drovers','crowder','patriots','A'); +INSERT INTO t2 VALUES (410,118003,36,'patenting','merry','rooms','FAS'); +INSERT INTO t2 VALUES (411,118004,36,'far','cadenced','towering','W'); +INSERT INTO t2 VALUES (412,118005,36,'shrieks','alimony','displease',''); +INSERT INTO t2 VALUES (413,118006,36,'aligning','principled','photosensitive',''); +INSERT INTO t2 VALUES (414,118007,36,'pragmatism','golfing','inking',''); +INSERT INTO t2 VALUES (415,118008,36,'fevers','undiscovered','gainers',''); +INSERT INTO t2 VALUES (416,118101,36,'reexamines','irritates','leaning','A'); +INSERT INTO t2 VALUES (417,118102,36,'occupancies','patriots','hydrant','A'); +INSERT INTO t2 VALUES (418,118103,36,'sweats','rooms','preserve',''); +INSERT INTO t2 VALUES (419,118202,36,'modulators','towering','blinded','A'); +INSERT INTO t2 VALUES (420,118203,36,'demand','displease','interactions','A'); +INSERT INTO t2 VALUES (421,118204,36,'Madeira','photosensitive','Barry',''); +INSERT INTO t2 VALUES (422,118302,36,'Viennese','inking','whiteness','A'); +INSERT INTO t2 VALUES (423,118304,36,'chillier','gainers','pastimes','W'); +INSERT INTO t2 VALUES (424,118305,36,'wildcats','leaning','Edenization',''); +INSERT INTO t2 VALUES (425,118306,36,'gentle','hydrant','Muscat',''); +INSERT INTO t2 VALUES (426,118307,36,'Angles','preserve','assassinated',''); +INSERT INTO t2 VALUES (427,123101,36,'accuracies','blinded','labeled',''); +INSERT INTO t2 VALUES (428,123102,36,'toggle','interactions','glacial','A'); +INSERT INTO t2 VALUES (429,123301,36,'Mendelssohn','Barry','implied','W'); +INSERT INTO t2 VALUES (430,126001,36,'behaviorally','whiteness','bibliographies','W'); +INSERT INTO t2 VALUES (431,126002,36,'Rochford','pastimes','Buchanan',''); +INSERT INTO t2 VALUES (432,126003,36,'mirror','Edenization','forgivably','FAS'); +INSERT INTO t2 VALUES (433,126101,36,'Modula','Muscat','innuendo','A'); +INSERT INTO t2 VALUES (434,126301,36,'clobbering','assassinated','den','FAS'); +INSERT INTO t2 VALUES (435,126302,36,'chronography','labeled','submarines','W'); +INSERT INTO t2 VALUES (436,126402,36,'Eskimoizeds','glacial','mouthful','A'); +INSERT INTO t2 VALUES (437,126601,36,'British','implied','expiring',''); +INSERT INTO t2 VALUES (438,126602,36,'pitfalls','bibliographies','unfulfilled','FAS'); +INSERT INTO t2 VALUES (439,126702,36,'verify','Buchanan','precession',''); +INSERT INTO t2 VALUES (440,128001,36,'scatter','forgivably','nullified',''); +INSERT INTO t2 VALUES (441,128002,36,'Aztecan','innuendo','affects',''); +INSERT INTO t2 VALUES (442,128003,36,'acuity','den','Cynthia',''); +INSERT INTO t2 VALUES (443,128004,36,'sinking','submarines','Chablis','A'); +INSERT INTO t2 VALUES (444,128005,36,'beasts','mouthful','betterments','FAS'); +INSERT INTO t2 VALUES (445,128007,36,'Witt','expiring','advertising',''); +INSERT INTO t2 VALUES (446,128008,36,'physicists','unfulfilled','rubies','A'); +INSERT INTO t2 VALUES (447,128009,36,'folksong','precession','southwest','FAS'); +INSERT INTO t2 VALUES (448,128010,36,'strokes','nullified','superstitious','A'); +INSERT INTO t2 VALUES (449,128011,36,'crowder','affects','tabernacle','W'); +INSERT INTO t2 VALUES (450,128012,36,'merry','Cynthia','silk','A'); +INSERT INTO t2 VALUES (451,128013,36,'cadenced','Chablis','handsomest','A'); +INSERT INTO t2 VALUES (452,128014,36,'alimony','betterments','Persian','A'); +INSERT INTO t2 VALUES (453,128015,36,'principled','advertising','analog','W'); +INSERT INTO t2 VALUES (454,128016,36,'golfing','rubies','complex','W'); +INSERT INTO t2 VALUES (455,128017,36,'undiscovered','southwest','Taoist',''); +INSERT INTO t2 VALUES (456,128018,36,'irritates','superstitious','suspend',''); +INSERT INTO t2 VALUES (457,128019,36,'patriots','tabernacle','relegated',''); +INSERT INTO t2 VALUES (458,128020,36,'rooms','silk','awesome','W'); +INSERT INTO t2 VALUES (459,128021,36,'towering','handsomest','Bruxelles',''); +INSERT INTO t2 VALUES (460,128022,36,'displease','Persian','imprecisely','A'); +INSERT INTO t2 VALUES (461,128023,36,'photosensitive','analog','televise',''); +INSERT INTO t2 VALUES (462,128101,36,'inking','complex','braking',''); +INSERT INTO t2 VALUES (463,128102,36,'gainers','Taoist','true','FAS'); +INSERT INTO t2 VALUES (464,128103,36,'leaning','suspend','disappointing','FAS'); +INSERT INTO t2 VALUES (465,128104,36,'hydrant','relegated','navally','W'); +INSERT INTO t2 VALUES (466,128106,36,'preserve','awesome','circus',''); +INSERT INTO t2 VALUES (467,128107,36,'blinded','Bruxelles','beetles',''); +INSERT INTO t2 VALUES (468,128108,36,'interactions','imprecisely','trumps',''); +INSERT INTO t2 VALUES (469,128202,36,'Barry','televise','fourscore','W'); +INSERT INTO t2 VALUES (470,128203,36,'whiteness','braking','Blackfoots',''); +INSERT INTO t2 VALUES (471,128301,36,'pastimes','true','Grady',''); +INSERT INTO t2 VALUES (472,128302,36,'Edenization','disappointing','quiets','FAS'); +INSERT INTO t2 VALUES (473,128303,36,'Muscat','navally','floundered','FAS'); +INSERT INTO t2 VALUES (474,128304,36,'assassinated','circus','profundity','W'); +INSERT INTO t2 VALUES (475,128305,36,'labeled','beetles','Garrisonian','W'); +INSERT INTO t2 VALUES (476,128307,36,'glacial','trumps','Strauss',''); +INSERT INTO t2 VALUES (477,128401,36,'implied','fourscore','cemented','FAS'); +INSERT INTO t2 VALUES (478,128502,36,'bibliographies','Blackfoots','contrition','A'); +INSERT INTO t2 VALUES (479,128503,36,'Buchanan','Grady','mutations',''); +INSERT INTO t2 VALUES (480,128504,36,'forgivably','quiets','exhibits','W'); +INSERT INTO t2 VALUES (481,128505,36,'innuendo','floundered','tits',''); +INSERT INTO t2 VALUES (482,128601,36,'den','profundity','mate','A'); +INSERT INTO t2 VALUES (483,128603,36,'submarines','Garrisonian','arches',''); +INSERT INTO t2 VALUES (484,128604,36,'mouthful','Strauss','Moll',''); +INSERT INTO t2 VALUES (485,128702,36,'expiring','cemented','ropers',''); +INSERT INTO t2 VALUES (486,128703,36,'unfulfilled','contrition','bombast',''); +INSERT INTO t2 VALUES (487,128704,36,'precession','mutations','difficultly','A'); +INSERT INTO t2 VALUES (488,138001,36,'nullified','exhibits','adsorption',''); +INSERT INTO t2 VALUES (489,138002,36,'affects','tits','definiteness','FAS'); +INSERT INTO t2 VALUES (490,138003,36,'Cynthia','mate','cultivation','A'); +INSERT INTO t2 VALUES (491,138004,36,'Chablis','arches','heals','A'); +INSERT INTO t2 VALUES (492,138005,36,'betterments','Moll','Heusen','W'); +INSERT INTO t2 VALUES (493,138006,36,'advertising','ropers','target','FAS'); +INSERT INTO t2 VALUES (494,138007,36,'rubies','bombast','cited','A'); +INSERT INTO t2 VALUES (495,138008,36,'southwest','difficultly','congresswoman','W'); +INSERT INTO t2 VALUES (496,138009,36,'superstitious','adsorption','Katherine',''); +INSERT INTO t2 VALUES (497,138102,36,'tabernacle','definiteness','titter','A'); +INSERT INTO t2 VALUES (498,138103,36,'silk','cultivation','aspire','A'); +INSERT INTO t2 VALUES (499,138104,36,'handsomest','heals','Mardis',''); +INSERT INTO t2 VALUES (500,138105,36,'Persian','Heusen','Nadia','W'); +INSERT INTO t2 VALUES (501,138201,36,'analog','target','estimating','FAS'); +INSERT INTO t2 VALUES (502,138302,36,'complex','cited','stuck','A'); +INSERT INTO t2 VALUES (503,138303,36,'Taoist','congresswoman','fifteenth','A'); +INSERT INTO t2 VALUES (504,138304,36,'suspend','Katherine','Colombo',''); +INSERT INTO t2 VALUES (505,138401,29,'relegated','titter','survey','A'); +INSERT INTO t2 VALUES (506,140102,29,'awesome','aspire','staffing',''); +INSERT INTO t2 VALUES (507,140103,29,'Bruxelles','Mardis','obtain',''); +INSERT INTO t2 VALUES (508,140104,29,'imprecisely','Nadia','loaded',''); +INSERT INTO t2 VALUES (509,140105,29,'televise','estimating','slaughtered',''); +INSERT INTO t2 VALUES (510,140201,29,'braking','stuck','lights','A'); +INSERT INTO t2 VALUES (511,140701,29,'true','fifteenth','circumference',''); +INSERT INTO t2 VALUES (512,141501,29,'disappointing','Colombo','dull','A'); +INSERT INTO t2 VALUES (513,141502,29,'navally','survey','weekly','A'); +INSERT INTO t2 VALUES (514,141901,29,'circus','staffing','wetness',''); +INSERT INTO t2 VALUES (515,141902,29,'beetles','obtain','visualized',''); +INSERT INTO t2 VALUES (516,142101,29,'trumps','loaded','Tannenbaum',''); +INSERT INTO t2 VALUES (517,142102,29,'fourscore','slaughtered','moribund',''); +INSERT INTO t2 VALUES (518,142103,29,'Blackfoots','lights','demultiplex',''); +INSERT INTO t2 VALUES (519,142701,29,'Grady','circumference','lockings',''); +INSERT INTO t2 VALUES (520,143001,29,'quiets','dull','thugs','FAS'); +INSERT INTO t2 VALUES (521,143501,29,'floundered','weekly','unnerves',''); +INSERT INTO t2 VALUES (522,143502,29,'profundity','wetness','abut',''); +INSERT INTO t2 VALUES (523,148001,29,'Garrisonian','visualized','Chippewa','A'); +INSERT INTO t2 VALUES (524,148002,29,'Strauss','Tannenbaum','stratifications','A'); +INSERT INTO t2 VALUES (525,148003,29,'cemented','moribund','signaled',''); +INSERT INTO t2 VALUES (526,148004,29,'contrition','demultiplex','Italianizes','A'); +INSERT INTO t2 VALUES (527,148005,29,'mutations','lockings','algorithmic','A'); +INSERT INTO t2 VALUES (528,148006,29,'exhibits','thugs','paranoid','FAS'); +INSERT INTO t2 VALUES (529,148007,29,'tits','unnerves','camping','A'); +INSERT INTO t2 VALUES (530,148009,29,'mate','abut','signifying','A'); +INSERT INTO t2 VALUES (531,148010,29,'arches','Chippewa','Patrice','W'); +INSERT INTO t2 VALUES (532,148011,29,'Moll','stratifications','search','A'); +INSERT INTO t2 VALUES (533,148012,29,'ropers','signaled','Angeles','A'); +INSERT INTO t2 VALUES (534,148013,29,'bombast','Italianizes','semblance',''); +INSERT INTO t2 VALUES (535,148023,36,'difficultly','algorithmic','taxed',''); +INSERT INTO t2 VALUES (536,148015,29,'adsorption','paranoid','Beatrice',''); +INSERT INTO t2 VALUES (537,148016,29,'definiteness','camping','retrace',''); +INSERT INTO t2 VALUES (538,148017,29,'cultivation','signifying','lockout',''); +INSERT INTO t2 VALUES (539,148018,29,'heals','Patrice','grammatic',''); +INSERT INTO t2 VALUES (540,148019,29,'Heusen','search','helmsman',''); +INSERT INTO t2 VALUES (541,148020,29,'target','Angeles','uniform','W'); +INSERT INTO t2 VALUES (542,148021,29,'cited','semblance','hamming',''); +INSERT INTO t2 VALUES (543,148022,29,'congresswoman','taxed','disobedience',''); +INSERT INTO t2 VALUES (544,148101,29,'Katherine','Beatrice','captivated','A'); +INSERT INTO t2 VALUES (545,148102,29,'titter','retrace','transferals','A'); +INSERT INTO t2 VALUES (546,148201,29,'aspire','lockout','cartographer','A'); +INSERT INTO t2 VALUES (547,148401,29,'Mardis','grammatic','aims','FAS'); +INSERT INTO t2 VALUES (548,148402,29,'Nadia','helmsman','Pakistani',''); +INSERT INTO t2 VALUES (549,148501,29,'estimating','uniform','burglarized','FAS'); +INSERT INTO t2 VALUES (550,148502,29,'stuck','hamming','saucepans','A'); +INSERT INTO t2 VALUES (551,148503,29,'fifteenth','disobedience','lacerating','A'); +INSERT INTO t2 VALUES (552,148504,29,'Colombo','captivated','corny',''); +INSERT INTO t2 VALUES (553,148601,29,'survey','transferals','megabytes','FAS'); +INSERT INTO t2 VALUES (554,148602,29,'staffing','cartographer','chancellor',''); +INSERT INTO t2 VALUES (555,150701,29,'obtain','aims','bulk','A'); +INSERT INTO t2 VALUES (556,152101,29,'loaded','Pakistani','commits','A'); +INSERT INTO t2 VALUES (557,152102,29,'slaughtered','burglarized','meson','W'); +INSERT INTO t2 VALUES (558,155202,36,'lights','saucepans','deputies',''); +INSERT INTO t2 VALUES (559,155203,29,'circumference','lacerating','northeaster','A'); +INSERT INTO t2 VALUES (560,155204,29,'dull','corny','dipole',''); +INSERT INTO t2 VALUES (561,155205,29,'weekly','megabytes','machining','0'); +INSERT INTO t2 VALUES (562,156001,29,'wetness','chancellor','therefore',''); +INSERT INTO t2 VALUES (563,156002,29,'visualized','bulk','Telefunken',''); +INSERT INTO t2 VALUES (564,156102,29,'Tannenbaum','commits','salvaging',''); +INSERT INTO t2 VALUES (565,156301,29,'moribund','meson','Corinthianizes','A'); +INSERT INTO t2 VALUES (566,156302,29,'demultiplex','deputies','restlessly','A'); +INSERT INTO t2 VALUES (567,156303,29,'lockings','northeaster','bromides',''); +INSERT INTO t2 VALUES (568,156304,29,'thugs','dipole','generalized','A'); +INSERT INTO t2 VALUES (569,156305,29,'unnerves','machining','mishaps',''); +INSERT INTO t2 VALUES (570,156306,29,'abut','therefore','quelling',''); +INSERT INTO t2 VALUES (571,156501,29,'Chippewa','Telefunken','spiritual','A'); +INSERT INTO t2 VALUES (572,158001,29,'stratifications','salvaging','beguiles','FAS'); +INSERT INTO t2 VALUES (573,158002,29,'signaled','Corinthianizes','Trobriand','FAS'); +INSERT INTO t2 VALUES (574,158101,29,'Italianizes','restlessly','fleeing','A'); +INSERT INTO t2 VALUES (575,158102,29,'algorithmic','bromides','Armour','A'); +INSERT INTO t2 VALUES (576,158103,29,'paranoid','generalized','chin','A'); +INSERT INTO t2 VALUES (577,158201,29,'camping','mishaps','provers','A'); +INSERT INTO t2 VALUES (578,158202,29,'signifying','quelling','aeronautic','A'); +INSERT INTO t2 VALUES (579,158203,29,'Patrice','spiritual','voltage','W'); +INSERT INTO t2 VALUES (580,158204,29,'search','beguiles','sash',''); +INSERT INTO t2 VALUES (581,158301,29,'Angeles','Trobriand','anaerobic','A'); +INSERT INTO t2 VALUES (582,158302,29,'semblance','fleeing','simultaneous','A'); +INSERT INTO t2 VALUES (583,158303,29,'taxed','Armour','accumulating','A'); +INSERT INTO t2 VALUES (584,158304,29,'Beatrice','chin','Medusan','A'); +INSERT INTO t2 VALUES (585,158305,29,'retrace','provers','shouted','A'); +INSERT INTO t2 VALUES (586,158306,29,'lockout','aeronautic','freakish',''); +INSERT INTO t2 VALUES (587,158501,29,'grammatic','voltage','index','FAS'); +INSERT INTO t2 VALUES (588,160301,29,'helmsman','sash','commercially',''); +INSERT INTO t2 VALUES (589,166101,50,'uniform','anaerobic','mistiness','A'); +INSERT INTO t2 VALUES (590,166102,50,'hamming','simultaneous','endpoint',''); +INSERT INTO t2 VALUES (591,168001,29,'disobedience','accumulating','straight','A'); +INSERT INTO t2 VALUES (592,168002,29,'captivated','Medusan','flurried',''); +INSERT INTO t2 VALUES (593,168003,29,'transferals','shouted','denotative','A'); +INSERT INTO t2 VALUES (594,168101,29,'cartographer','freakish','coming','FAS'); +INSERT INTO t2 VALUES (595,168102,29,'aims','index','commencements','FAS'); +INSERT INTO t2 VALUES (596,168103,29,'Pakistani','commercially','gentleman',''); +INSERT INTO t2 VALUES (597,168104,29,'burglarized','mistiness','gifted',''); +INSERT INTO t2 VALUES (598,168202,29,'saucepans','endpoint','Shanghais',''); +INSERT INTO t2 VALUES (599,168301,29,'lacerating','straight','sportswriting','A'); +INSERT INTO t2 VALUES (600,168502,29,'corny','flurried','sloping','A'); +INSERT INTO t2 VALUES (601,168503,29,'megabytes','denotative','navies',''); +INSERT INTO t2 VALUES (602,168601,29,'chancellor','coming','leaflet','A'); +INSERT INTO t2 VALUES (603,173001,40,'bulk','commencements','shooter',''); +INSERT INTO t2 VALUES (604,173701,40,'commits','gentleman','Joplin','FAS'); +INSERT INTO t2 VALUES (605,173702,40,'meson','gifted','babies',''); +INSERT INTO t2 VALUES (606,176001,40,'deputies','Shanghais','subdivision','FAS'); +INSERT INTO t2 VALUES (607,176101,40,'northeaster','sportswriting','burstiness','W'); +INSERT INTO t2 VALUES (608,176201,40,'dipole','sloping','belted','FAS'); +INSERT INTO t2 VALUES (609,176401,40,'machining','navies','assails','FAS'); +INSERT INTO t2 VALUES (610,176501,40,'therefore','leaflet','admiring','W'); +INSERT INTO t2 VALUES (611,176601,40,'Telefunken','shooter','swaying','0'); +INSERT INTO t2 VALUES (612,176602,40,'salvaging','Joplin','Goldstine','FAS'); +INSERT INTO t2 VALUES (613,176603,40,'Corinthianizes','babies','fitting',''); +INSERT INTO t2 VALUES (614,178001,40,'restlessly','subdivision','Norwalk','W'); +INSERT INTO t2 VALUES (615,178002,40,'bromides','burstiness','weakening','W'); +INSERT INTO t2 VALUES (616,178003,40,'generalized','belted','analogy','FAS'); +INSERT INTO t2 VALUES (617,178004,40,'mishaps','assails','deludes',''); +INSERT INTO t2 VALUES (618,178005,40,'quelling','admiring','cokes',''); +INSERT INTO t2 VALUES (619,178006,40,'spiritual','swaying','Clayton',''); +INSERT INTO t2 VALUES (620,178007,40,'beguiles','Goldstine','exhausts',''); +INSERT INTO t2 VALUES (621,178008,40,'Trobriand','fitting','causality',''); +INSERT INTO t2 VALUES (622,178101,40,'fleeing','Norwalk','sating','FAS'); +INSERT INTO t2 VALUES (623,178102,40,'Armour','weakening','icon',''); +INSERT INTO t2 VALUES (624,178103,40,'chin','analogy','throttles',''); +INSERT INTO t2 VALUES (625,178201,40,'provers','deludes','communicants','FAS'); +INSERT INTO t2 VALUES (626,178202,40,'aeronautic','cokes','dehydrate','FAS'); +INSERT INTO t2 VALUES (627,178301,40,'voltage','Clayton','priceless','FAS'); +INSERT INTO t2 VALUES (628,178302,40,'sash','exhausts','publicly',''); +INSERT INTO t2 VALUES (629,178401,40,'anaerobic','causality','incidentals','FAS'); +INSERT INTO t2 VALUES (630,178402,40,'simultaneous','sating','commonplace',''); +INSERT INTO t2 VALUES (631,178403,40,'accumulating','icon','mumbles',''); +INSERT INTO t2 VALUES (632,178404,40,'Medusan','throttles','furthermore','W'); +INSERT INTO t2 VALUES (633,178501,40,'shouted','communicants','cautioned','W'); +INSERT INTO t2 VALUES (634,186002,37,'freakish','dehydrate','parametrized','A'); +INSERT INTO t2 VALUES (635,186102,37,'index','priceless','registration','A'); +INSERT INTO t2 VALUES (636,186201,40,'commercially','publicly','sadly','FAS'); +INSERT INTO t2 VALUES (637,186202,40,'mistiness','incidentals','positioning',''); +INSERT INTO t2 VALUES (638,186203,40,'endpoint','commonplace','babysitting',''); +INSERT INTO t2 VALUES (639,186302,37,'straight','mumbles','eternal','A'); +INSERT INTO t2 VALUES (640,188007,37,'flurried','furthermore','hoarder',''); +INSERT INTO t2 VALUES (641,188008,37,'denotative','cautioned','congregates',''); +INSERT INTO t2 VALUES (642,188009,37,'coming','parametrized','rains',''); +INSERT INTO t2 VALUES (643,188010,37,'commencements','registration','workers','W'); +INSERT INTO t2 VALUES (644,188011,37,'gentleman','sadly','sags','A'); +INSERT INTO t2 VALUES (645,188012,37,'gifted','positioning','unplug','W'); +INSERT INTO t2 VALUES (646,188013,37,'Shanghais','babysitting','garage','A'); +INSERT INTO t2 VALUES (647,188014,37,'sportswriting','eternal','boulder','A'); +INSERT INTO t2 VALUES (648,188015,37,'sloping','hoarder','hollowly','A'); +INSERT INTO t2 VALUES (649,188016,37,'navies','congregates','specifics',''); +INSERT INTO t2 VALUES (650,188017,37,'leaflet','rains','Teresa',''); +INSERT INTO t2 VALUES (651,188102,37,'shooter','workers','Winsett',''); +INSERT INTO t2 VALUES (652,188103,37,'Joplin','sags','convenient','A'); +INSERT INTO t2 VALUES (653,188202,37,'babies','unplug','buckboards','FAS'); +INSERT INTO t2 VALUES (654,188301,40,'subdivision','garage','amenities',''); +INSERT INTO t2 VALUES (655,188302,40,'burstiness','boulder','resplendent','FAS'); +INSERT INTO t2 VALUES (656,188303,40,'belted','hollowly','priding','FAS'); +INSERT INTO t2 VALUES (657,188401,37,'assails','specifics','configurations',''); +INSERT INTO t2 VALUES (658,188402,37,'admiring','Teresa','untidiness','A'); +INSERT INTO t2 VALUES (659,188503,37,'swaying','Winsett','Brice','W'); +INSERT INTO t2 VALUES (660,188504,37,'Goldstine','convenient','sews','FAS'); +INSERT INTO t2 VALUES (661,188505,37,'fitting','buckboards','participated',''); +INSERT INTO t2 VALUES (662,190701,37,'Norwalk','amenities','Simon','FAS'); +INSERT INTO t2 VALUES (663,190703,50,'weakening','resplendent','certificates',''); +INSERT INTO t2 VALUES (664,191701,37,'analogy','priding','Fitzpatrick',''); +INSERT INTO t2 VALUES (665,191702,37,'deludes','configurations','Evanston','A'); +INSERT INTO t2 VALUES (666,191703,37,'cokes','untidiness','misted',''); +INSERT INTO t2 VALUES (667,196001,37,'Clayton','Brice','textures','A'); +INSERT INTO t2 VALUES (668,196002,37,'exhausts','sews','save',''); +INSERT INTO t2 VALUES (669,196003,37,'causality','participated','count',''); +INSERT INTO t2 VALUES (670,196101,37,'sating','Simon','rightful','A'); +INSERT INTO t2 VALUES (671,196103,37,'icon','certificates','chaperone',''); +INSERT INTO t2 VALUES (672,196104,37,'throttles','Fitzpatrick','Lizzy','A'); +INSERT INTO t2 VALUES (673,196201,37,'communicants','Evanston','clenched','A'); +INSERT INTO t2 VALUES (674,196202,37,'dehydrate','misted','effortlessly',''); +INSERT INTO t2 VALUES (675,196203,37,'priceless','textures','accessed',''); +INSERT INTO t2 VALUES (676,198001,37,'publicly','save','beaters','A'); +INSERT INTO t2 VALUES (677,198003,37,'incidentals','count','Hornblower','FAS'); +INSERT INTO t2 VALUES (678,198004,37,'commonplace','rightful','vests','A'); +INSERT INTO t2 VALUES (679,198005,37,'mumbles','chaperone','indulgences','FAS'); +INSERT INTO t2 VALUES (680,198006,37,'furthermore','Lizzy','infallibly','A'); +INSERT INTO t2 VALUES (681,198007,37,'cautioned','clenched','unwilling','FAS'); +INSERT INTO t2 VALUES (682,198008,37,'parametrized','effortlessly','excrete','FAS'); +INSERT INTO t2 VALUES (683,198009,37,'registration','accessed','spools','A'); +INSERT INTO t2 VALUES (684,198010,37,'sadly','beaters','crunches','FAS'); +INSERT INTO t2 VALUES (685,198011,37,'positioning','Hornblower','overestimating','FAS'); +INSERT INTO t2 VALUES (686,198012,37,'babysitting','vests','ineffective',''); +INSERT INTO t2 VALUES (687,198013,37,'eternal','indulgences','humiliation','A'); +INSERT INTO t2 VALUES (688,198014,37,'hoarder','infallibly','sophomore',''); +INSERT INTO t2 VALUES (689,198015,37,'congregates','unwilling','star',''); +INSERT INTO t2 VALUES (690,198017,37,'rains','excrete','rifles',''); +INSERT INTO t2 VALUES (691,198018,37,'workers','spools','dialysis',''); +INSERT INTO t2 VALUES (692,198019,37,'sags','crunches','arriving',''); +INSERT INTO t2 VALUES (693,198020,37,'unplug','overestimating','indulge',''); +INSERT INTO t2 VALUES (694,198021,37,'garage','ineffective','clockers',''); +INSERT INTO t2 VALUES (695,198022,37,'boulder','humiliation','languages',''); +INSERT INTO t2 VALUES (696,198023,50,'hollowly','sophomore','Antarctica','A'); +INSERT INTO t2 VALUES (697,198024,37,'specifics','star','percentage',''); +INSERT INTO t2 VALUES (698,198101,37,'Teresa','rifles','ceiling','A'); +INSERT INTO t2 VALUES (699,198103,37,'Winsett','dialysis','specification',''); +INSERT INTO t2 VALUES (700,198105,37,'convenient','arriving','regimented','A'); +INSERT INTO t2 VALUES (701,198106,37,'buckboards','indulge','ciphers',''); +INSERT INTO t2 VALUES (702,198201,37,'amenities','clockers','pictures','A'); +INSERT INTO t2 VALUES (703,198204,37,'resplendent','languages','serpents','A'); +INSERT INTO t2 VALUES (704,198301,53,'priding','Antarctica','allot','A'); +INSERT INTO t2 VALUES (705,198302,53,'configurations','percentage','realized','A'); +INSERT INTO t2 VALUES (706,198303,53,'untidiness','ceiling','mayoral','A'); +INSERT INTO t2 VALUES (707,198304,53,'Brice','specification','opaquely','A'); +INSERT INTO t2 VALUES (708,198401,37,'sews','regimented','hostess','FAS'); +INSERT INTO t2 VALUES (709,198402,37,'participated','ciphers','fiftieth',''); +INSERT INTO t2 VALUES (710,198403,37,'Simon','pictures','incorrectly',''); +INSERT INTO t2 VALUES (711,202101,37,'certificates','serpents','decomposition','FAS'); +INSERT INTO t2 VALUES (712,202301,37,'Fitzpatrick','allot','stranglings',''); +INSERT INTO t2 VALUES (713,202302,37,'Evanston','realized','mixture','FAS'); +INSERT INTO t2 VALUES (714,202303,37,'misted','mayoral','electroencephalography','FAS'); +INSERT INTO t2 VALUES (715,202304,37,'textures','opaquely','similarities','FAS'); +INSERT INTO t2 VALUES (716,202305,37,'save','hostess','charges','W'); +INSERT INTO t2 VALUES (717,202601,37,'count','fiftieth','freest','FAS'); +INSERT INTO t2 VALUES (718,202602,37,'rightful','incorrectly','Greenberg','FAS'); +INSERT INTO t2 VALUES (719,202605,37,'chaperone','decomposition','tinting',''); +INSERT INTO t2 VALUES (720,202606,37,'Lizzy','stranglings','expelled','W'); +INSERT INTO t2 VALUES (721,202607,37,'clenched','mixture','warm',''); +INSERT INTO t2 VALUES (722,202901,37,'effortlessly','electroencephalography','smoothed',''); +INSERT INTO t2 VALUES (723,202902,37,'accessed','similarities','deductions','FAS'); +INSERT INTO t2 VALUES (724,202903,37,'beaters','charges','Romano','W'); +INSERT INTO t2 VALUES (725,202904,37,'Hornblower','freest','bitterroot',''); +INSERT INTO t2 VALUES (726,202907,37,'vests','Greenberg','corset',''); +INSERT INTO t2 VALUES (727,202908,37,'indulgences','tinting','securing',''); +INSERT INTO t2 VALUES (728,203101,37,'infallibly','expelled','environing','FAS'); +INSERT INTO t2 VALUES (729,203103,37,'unwilling','warm','cute',''); +INSERT INTO t2 VALUES (730,203104,37,'excrete','smoothed','Crays',''); +INSERT INTO t2 VALUES (731,203105,37,'spools','deductions','heiress','FAS'); +INSERT INTO t2 VALUES (732,203401,37,'crunches','Romano','inform','FAS'); +INSERT INTO t2 VALUES (733,203402,37,'overestimating','bitterroot','avenge',''); +INSERT INTO t2 VALUES (734,203404,37,'ineffective','corset','universals',''); +INSERT INTO t2 VALUES (735,203901,37,'humiliation','securing','Kinsey','W'); +INSERT INTO t2 VALUES (736,203902,37,'sophomore','environing','ravines','FAS'); +INSERT INTO t2 VALUES (737,203903,37,'star','cute','bestseller',''); +INSERT INTO t2 VALUES (738,203906,37,'rifles','Crays','equilibrium',''); +INSERT INTO t2 VALUES (739,203907,37,'dialysis','heiress','extents','0'); +INSERT INTO t2 VALUES (740,203908,37,'arriving','inform','relatively',''); +INSERT INTO t2 VALUES (741,203909,37,'indulge','avenge','pressure','FAS'); +INSERT INTO t2 VALUES (742,206101,37,'clockers','universals','critiques','FAS'); +INSERT INTO t2 VALUES (743,206201,37,'languages','Kinsey','befouled',''); +INSERT INTO t2 VALUES (744,206202,37,'Antarctica','ravines','rightfully','FAS'); +INSERT INTO t2 VALUES (745,206203,37,'percentage','bestseller','mechanizing','FAS'); +INSERT INTO t2 VALUES (746,206206,37,'ceiling','equilibrium','Latinizes',''); +INSERT INTO t2 VALUES (747,206207,37,'specification','extents','timesharing',''); +INSERT INTO t2 VALUES (748,206208,37,'regimented','relatively','Aden',''); +INSERT INTO t2 VALUES (749,208001,37,'ciphers','pressure','embassies',''); +INSERT INTO t2 VALUES (750,208002,37,'pictures','critiques','males','FAS'); +INSERT INTO t2 VALUES (751,208003,37,'serpents','befouled','shapelessly','FAS'); +INSERT INTO t2 VALUES (752,208004,37,'allot','rightfully','genres','FAS'); +INSERT INTO t2 VALUES (753,208008,37,'realized','mechanizing','mastering',''); +INSERT INTO t2 VALUES (754,208009,37,'mayoral','Latinizes','Newtonian',''); +INSERT INTO t2 VALUES (755,208010,37,'opaquely','timesharing','finishers','FAS'); +INSERT INTO t2 VALUES (756,208011,37,'hostess','Aden','abates',''); +INSERT INTO t2 VALUES (757,208101,37,'fiftieth','embassies','teem',''); +INSERT INTO t2 VALUES (758,208102,37,'incorrectly','males','kiting','FAS'); +INSERT INTO t2 VALUES (759,208103,37,'decomposition','shapelessly','stodgy','FAS'); +INSERT INTO t2 VALUES (760,208104,37,'stranglings','genres','scalps','FAS'); +INSERT INTO t2 VALUES (761,208105,37,'mixture','mastering','feed','FAS'); +INSERT INTO t2 VALUES (762,208110,37,'electroencephalography','Newtonian','guitars',''); +INSERT INTO t2 VALUES (763,208111,37,'similarities','finishers','airships',''); +INSERT INTO t2 VALUES (764,208112,37,'charges','abates','store',''); +INSERT INTO t2 VALUES (765,208113,37,'freest','teem','denounces',''); +INSERT INTO t2 VALUES (766,208201,37,'Greenberg','kiting','Pyle','FAS'); +INSERT INTO t2 VALUES (767,208203,37,'tinting','stodgy','Saxony',''); +INSERT INTO t2 VALUES (768,208301,37,'expelled','scalps','serializations','FAS'); +INSERT INTO t2 VALUES (769,208302,37,'warm','feed','Peruvian','FAS'); +INSERT INTO t2 VALUES (770,208305,37,'smoothed','guitars','taxonomically','FAS'); +INSERT INTO t2 VALUES (771,208401,37,'deductions','airships','kingdom','A'); +INSERT INTO t2 VALUES (772,208402,37,'Romano','store','stint','A'); +INSERT INTO t2 VALUES (773,208403,37,'bitterroot','denounces','Sault','A'); +INSERT INTO t2 VALUES (774,208404,37,'corset','Pyle','faithful',''); +INSERT INTO t2 VALUES (775,208501,37,'securing','Saxony','Ganymede','FAS'); +INSERT INTO t2 VALUES (776,208502,37,'environing','serializations','tidiness','FAS'); +INSERT INTO t2 VALUES (777,208503,37,'cute','Peruvian','gainful','FAS'); +INSERT INTO t2 VALUES (778,208504,37,'Crays','taxonomically','contrary','FAS'); +INSERT INTO t2 VALUES (779,208505,37,'heiress','kingdom','Tipperary','FAS'); +INSERT INTO t2 VALUES (780,210101,37,'inform','stint','tropics','W'); +INSERT INTO t2 VALUES (781,210102,37,'avenge','Sault','theorizers',''); +INSERT INTO t2 VALUES (782,210103,37,'universals','faithful','renew','0'); +INSERT INTO t2 VALUES (783,210104,37,'Kinsey','Ganymede','already',''); +INSERT INTO t2 VALUES (784,210105,37,'ravines','tidiness','terminal',''); +INSERT INTO t2 VALUES (785,210106,37,'bestseller','gainful','Hegelian',''); +INSERT INTO t2 VALUES (786,210107,37,'equilibrium','contrary','hypothesizer',''); +INSERT INTO t2 VALUES (787,210401,37,'extents','Tipperary','warningly','FAS'); +INSERT INTO t2 VALUES (788,213201,37,'relatively','tropics','journalizing','FAS'); +INSERT INTO t2 VALUES (789,213203,37,'pressure','theorizers','nested',''); +INSERT INTO t2 VALUES (790,213204,37,'critiques','renew','Lars',''); +INSERT INTO t2 VALUES (791,213205,37,'befouled','already','saplings',''); +INSERT INTO t2 VALUES (792,213206,37,'rightfully','terminal','foothill',''); +INSERT INTO t2 VALUES (793,213207,37,'mechanizing','Hegelian','labeled',''); +INSERT INTO t2 VALUES (794,216101,37,'Latinizes','hypothesizer','imperiously','FAS'); +INSERT INTO t2 VALUES (795,216103,37,'timesharing','warningly','reporters','FAS'); +INSERT INTO t2 VALUES (796,218001,37,'Aden','journalizing','furnishings','FAS'); +INSERT INTO t2 VALUES (797,218002,37,'embassies','nested','precipitable','FAS'); +INSERT INTO t2 VALUES (798,218003,37,'males','Lars','discounts','FAS'); +INSERT INTO t2 VALUES (799,218004,37,'shapelessly','saplings','excises','FAS'); +INSERT INTO t2 VALUES (800,143503,50,'genres','foothill','Stalin',''); +INSERT INTO t2 VALUES (801,218006,37,'mastering','labeled','despot','FAS'); +INSERT INTO t2 VALUES (802,218007,37,'Newtonian','imperiously','ripeness','FAS'); +INSERT INTO t2 VALUES (803,218008,37,'finishers','reporters','Arabia',''); +INSERT INTO t2 VALUES (804,218009,37,'abates','furnishings','unruly',''); +INSERT INTO t2 VALUES (805,218010,37,'teem','precipitable','mournfulness',''); +INSERT INTO t2 VALUES (806,218011,37,'kiting','discounts','boom','FAS'); +INSERT INTO t2 VALUES (807,218020,37,'stodgy','excises','slaughter','A'); +INSERT INTO t2 VALUES (808,218021,50,'scalps','Stalin','Sabine',''); +INSERT INTO t2 VALUES (809,218022,37,'feed','despot','handy','FAS'); +INSERT INTO t2 VALUES (810,218023,37,'guitars','ripeness','rural',''); +INSERT INTO t2 VALUES (811,218024,37,'airships','Arabia','organizer',''); +INSERT INTO t2 VALUES (812,218101,37,'store','unruly','shipyard','FAS'); +INSERT INTO t2 VALUES (813,218102,37,'denounces','mournfulness','civics','FAS'); +INSERT INTO t2 VALUES (814,218103,37,'Pyle','boom','inaccuracy','FAS'); +INSERT INTO t2 VALUES (815,218201,37,'Saxony','slaughter','rules','FAS'); +INSERT INTO t2 VALUES (816,218202,37,'serializations','Sabine','juveniles','FAS'); +INSERT INTO t2 VALUES (817,218203,37,'Peruvian','handy','comprised','W'); +INSERT INTO t2 VALUES (818,218204,37,'taxonomically','rural','investigations',''); +INSERT INTO t2 VALUES (819,218205,37,'kingdom','organizer','stabilizes','A'); +INSERT INTO t2 VALUES (820,218301,37,'stint','shipyard','seminaries','FAS'); +INSERT INTO t2 VALUES (821,218302,37,'Sault','civics','Hunter','A'); +INSERT INTO t2 VALUES (822,218401,37,'faithful','inaccuracy','sporty','FAS'); +INSERT INTO t2 VALUES (823,218402,37,'Ganymede','rules','test','FAS'); +INSERT INTO t2 VALUES (824,218403,37,'tidiness','juveniles','weasels',''); +INSERT INTO t2 VALUES (825,218404,37,'gainful','comprised','CERN',''); +INSERT INTO t2 VALUES (826,218407,37,'contrary','investigations','tempering',''); +INSERT INTO t2 VALUES (827,218408,37,'Tipperary','stabilizes','afore','FAS'); +INSERT INTO t2 VALUES (828,218409,37,'tropics','seminaries','Galatean',''); +INSERT INTO t2 VALUES (829,218410,37,'theorizers','Hunter','techniques','W'); +INSERT INTO t2 VALUES (830,226001,37,'renew','sporty','error',''); +INSERT INTO t2 VALUES (831,226002,37,'already','test','veranda',''); +INSERT INTO t2 VALUES (832,226003,37,'terminal','weasels','severely',''); +INSERT INTO t2 VALUES (833,226004,37,'Hegelian','CERN','Cassites','FAS'); +INSERT INTO t2 VALUES (834,226005,37,'hypothesizer','tempering','forthcoming',''); +INSERT INTO t2 VALUES (835,226006,37,'warningly','afore','guides',''); +INSERT INTO t2 VALUES (836,226007,37,'journalizing','Galatean','vanish','FAS'); +INSERT INTO t2 VALUES (837,226008,37,'nested','techniques','lied','A'); +INSERT INTO t2 VALUES (838,226203,37,'Lars','error','sawtooth','FAS'); +INSERT INTO t2 VALUES (839,226204,37,'saplings','veranda','fated','FAS'); +INSERT INTO t2 VALUES (840,226205,37,'foothill','severely','gradually',''); +INSERT INTO t2 VALUES (841,226206,37,'labeled','Cassites','widens',''); +INSERT INTO t2 VALUES (842,226207,37,'imperiously','forthcoming','preclude',''); +INSERT INTO t2 VALUES (843,226208,37,'reporters','guides','Jobrel',''); +INSERT INTO t2 VALUES (844,226209,37,'furnishings','vanish','hooker',''); +INSERT INTO t2 VALUES (845,226210,37,'precipitable','lied','rainstorm',''); +INSERT INTO t2 VALUES (846,226211,37,'discounts','sawtooth','disconnects',''); +INSERT INTO t2 VALUES (847,228001,37,'excises','fated','cruelty',''); +INSERT INTO t2 VALUES (848,228004,37,'Stalin','gradually','exponentials','A'); +INSERT INTO t2 VALUES (849,228005,37,'despot','widens','affective','A'); +INSERT INTO t2 VALUES (850,228006,37,'ripeness','preclude','arteries',''); +INSERT INTO t2 VALUES (851,228007,37,'Arabia','Jobrel','Crosby','FAS'); +INSERT INTO t2 VALUES (852,228008,37,'unruly','hooker','acquaint',''); +INSERT INTO t2 VALUES (853,228009,37,'mournfulness','rainstorm','evenhandedly',''); +INSERT INTO t2 VALUES (854,228101,37,'boom','disconnects','percentage',''); +INSERT INTO t2 VALUES (855,228108,37,'slaughter','cruelty','disobedience',''); +INSERT INTO t2 VALUES (856,228109,37,'Sabine','exponentials','humility',''); +INSERT INTO t2 VALUES (857,228110,37,'handy','affective','gleaning','A'); +INSERT INTO t2 VALUES (858,228111,37,'rural','arteries','petted','A'); +INSERT INTO t2 VALUES (859,228112,37,'organizer','Crosby','bloater','A'); +INSERT INTO t2 VALUES (860,228113,37,'shipyard','acquaint','minion','A'); +INSERT INTO t2 VALUES (861,228114,37,'civics','evenhandedly','marginal','A'); +INSERT INTO t2 VALUES (862,228115,37,'inaccuracy','percentage','apiary','A'); +INSERT INTO t2 VALUES (863,228116,37,'rules','disobedience','measures',''); +INSERT INTO t2 VALUES (864,228117,37,'juveniles','humility','precaution',''); +INSERT INTO t2 VALUES (865,228118,37,'comprised','gleaning','repelled',''); +INSERT INTO t2 VALUES (866,228119,37,'investigations','petted','primary','FAS'); +INSERT INTO t2 VALUES (867,228120,37,'stabilizes','bloater','coverings',''); +INSERT INTO t2 VALUES (868,228121,37,'seminaries','minion','Artemia','A'); +INSERT INTO t2 VALUES (869,228122,37,'Hunter','marginal','navigate',''); +INSERT INTO t2 VALUES (870,228201,37,'sporty','apiary','spatial',''); +INSERT INTO t2 VALUES (871,228206,37,'test','measures','Gurkha',''); +INSERT INTO t2 VALUES (872,228207,37,'weasels','precaution','meanwhile','A'); +INSERT INTO t2 VALUES (873,228208,37,'CERN','repelled','Melinda','A'); +INSERT INTO t2 VALUES (874,228209,37,'tempering','primary','Butterfield',''); +INSERT INTO t2 VALUES (875,228210,37,'afore','coverings','Aldrich','A'); +INSERT INTO t2 VALUES (876,228211,37,'Galatean','Artemia','previewing','A'); +INSERT INTO t2 VALUES (877,228212,37,'techniques','navigate','glut','A'); +INSERT INTO t2 VALUES (878,228213,37,'error','spatial','unaffected',''); +INSERT INTO t2 VALUES (879,228214,37,'veranda','Gurkha','inmate',''); +INSERT INTO t2 VALUES (880,228301,37,'severely','meanwhile','mineral',''); +INSERT INTO t2 VALUES (881,228305,37,'Cassites','Melinda','impending','A'); +INSERT INTO t2 VALUES (882,228306,37,'forthcoming','Butterfield','meditation','A'); +INSERT INTO t2 VALUES (883,228307,37,'guides','Aldrich','ideas',''); +INSERT INTO t2 VALUES (884,228308,37,'vanish','previewing','miniaturizes','W'); +INSERT INTO t2 VALUES (885,228309,37,'lied','glut','lewdly',''); +INSERT INTO t2 VALUES (886,228310,37,'sawtooth','unaffected','title',''); +INSERT INTO t2 VALUES (887,228311,37,'fated','inmate','youthfulness',''); +INSERT INTO t2 VALUES (888,228312,37,'gradually','mineral','creak','FAS'); +INSERT INTO t2 VALUES (889,228313,37,'widens','impending','Chippewa',''); +INSERT INTO t2 VALUES (890,228314,37,'preclude','meditation','clamored',''); +INSERT INTO t2 VALUES (891,228401,65,'Jobrel','ideas','freezes',''); +INSERT INTO t2 VALUES (892,228402,65,'hooker','miniaturizes','forgivably','FAS'); +INSERT INTO t2 VALUES (893,228403,65,'rainstorm','lewdly','reduce','FAS'); +INSERT INTO t2 VALUES (894,228404,65,'disconnects','title','McGovern','W'); +INSERT INTO t2 VALUES (895,228405,65,'cruelty','youthfulness','Nazis','W'); +INSERT INTO t2 VALUES (896,228406,65,'exponentials','creak','epistle','W'); +INSERT INTO t2 VALUES (897,228407,65,'affective','Chippewa','socializes','W'); +INSERT INTO t2 VALUES (898,228408,65,'arteries','clamored','conceptions',''); +INSERT INTO t2 VALUES (899,228409,65,'Crosby','freezes','Kevin',''); +INSERT INTO t2 VALUES (900,228410,65,'acquaint','forgivably','uncovering',''); +INSERT INTO t2 VALUES (901,230301,37,'evenhandedly','reduce','chews','FAS'); +INSERT INTO t2 VALUES (902,230302,37,'percentage','McGovern','appendixes','FAS'); +INSERT INTO t2 VALUES (903,230303,37,'disobedience','Nazis','raining',''); +INSERT INTO t2 VALUES (904,018062,37,'humility','epistle','infest',''); +INSERT INTO t2 VALUES (905,230501,37,'gleaning','socializes','compartment',''); +INSERT INTO t2 VALUES (906,230502,37,'petted','conceptions','minting',''); +INSERT INTO t2 VALUES (907,230503,37,'bloater','Kevin','ducks',''); +INSERT INTO t2 VALUES (908,230504,37,'minion','uncovering','roped','A'); +INSERT INTO t2 VALUES (909,230505,37,'marginal','chews','waltz',''); +INSERT INTO t2 VALUES (910,230506,37,'apiary','appendixes','Lillian',''); +INSERT INTO t2 VALUES (911,230507,37,'measures','raining','repressions','A'); +INSERT INTO t2 VALUES (912,230508,37,'precaution','infest','chillingly',''); +INSERT INTO t2 VALUES (913,230509,37,'repelled','compartment','noncritical',''); +INSERT INTO t2 VALUES (914,230901,37,'primary','minting','lithograph',''); +INSERT INTO t2 VALUES (915,230902,37,'coverings','ducks','spongers',''); +INSERT INTO t2 VALUES (916,230903,37,'Artemia','roped','parenthood',''); +INSERT INTO t2 VALUES (917,230904,37,'navigate','waltz','posed',''); +INSERT INTO t2 VALUES (918,230905,37,'spatial','Lillian','instruments',''); +INSERT INTO t2 VALUES (919,230906,37,'Gurkha','repressions','filial',''); +INSERT INTO t2 VALUES (920,230907,37,'meanwhile','chillingly','fixedly',''); +INSERT INTO t2 VALUES (921,230908,37,'Melinda','noncritical','relives',''); +INSERT INTO t2 VALUES (922,230909,37,'Butterfield','lithograph','Pandora',''); +INSERT INTO t2 VALUES (923,230910,37,'Aldrich','spongers','watering','A'); +INSERT INTO t2 VALUES (924,230911,37,'previewing','parenthood','ungrateful',''); +INSERT INTO t2 VALUES (925,230912,37,'glut','posed','secures',''); +INSERT INTO t2 VALUES (926,230913,37,'unaffected','instruments','chastisers',''); +INSERT INTO t2 VALUES (927,230914,37,'inmate','filial','icon',''); +INSERT INTO t2 VALUES (928,231304,37,'mineral','fixedly','reuniting','A'); +INSERT INTO t2 VALUES (929,231305,37,'impending','relives','imagining','A'); +INSERT INTO t2 VALUES (930,231306,37,'meditation','Pandora','abiding','A'); +INSERT INTO t2 VALUES (931,231307,37,'ideas','watering','omnisciently',''); +INSERT INTO t2 VALUES (932,231308,37,'miniaturizes','ungrateful','Britannic',''); +INSERT INTO t2 VALUES (933,231309,37,'lewdly','secures','scholastics','A'); +INSERT INTO t2 VALUES (934,231310,37,'title','chastisers','mechanics','A'); +INSERT INTO t2 VALUES (935,231311,37,'youthfulness','icon','humidly','A'); +INSERT INTO t2 VALUES (936,231312,37,'creak','reuniting','masterpiece',''); +INSERT INTO t2 VALUES (937,231313,37,'Chippewa','imagining','however',''); +INSERT INTO t2 VALUES (938,231314,37,'clamored','abiding','Mendelian',''); +INSERT INTO t2 VALUES (939,231315,37,'freezes','omnisciently','jarred',''); +INSERT INTO t2 VALUES (940,232102,37,'forgivably','Britannic','scolds',''); +INSERT INTO t2 VALUES (941,232103,37,'reduce','scholastics','infatuate',''); +INSERT INTO t2 VALUES (942,232104,37,'McGovern','mechanics','willed','A'); +INSERT INTO t2 VALUES (943,232105,37,'Nazis','humidly','joyfully',''); +INSERT INTO t2 VALUES (944,232106,37,'epistle','masterpiece','Microsoft',''); +INSERT INTO t2 VALUES (945,232107,37,'socializes','however','fibrosities',''); +INSERT INTO t2 VALUES (946,232108,37,'conceptions','Mendelian','Baltimorean',''); +INSERT INTO t2 VALUES (947,232601,37,'Kevin','jarred','equestrian',''); +INSERT INTO t2 VALUES (948,232602,37,'uncovering','scolds','Goodrich',''); +INSERT INTO t2 VALUES (949,232603,37,'chews','infatuate','apish','A'); +INSERT INTO t2 VALUES (950,232605,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5950,1232605,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5951,1232606,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5952,1232607,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5953,1232608,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5954,1232609,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (951,232606,37,'raining','joyfully','Tropez',''); +INSERT INTO t2 VALUES (952,232607,37,'infest','Microsoft','nouns',''); +INSERT INTO t2 VALUES (953,232608,37,'compartment','fibrosities','distracting',''); +INSERT INTO t2 VALUES (954,232609,37,'minting','Baltimorean','mutton',''); +INSERT INTO t2 VALUES (955,236104,37,'ducks','equestrian','bridgeable','A'); +INSERT INTO t2 VALUES (956,236105,37,'roped','Goodrich','stickers','A'); +INSERT INTO t2 VALUES (957,236106,37,'waltz','apish','transcontinental','A'); +INSERT INTO t2 VALUES (958,236107,37,'Lillian','Adlerian','amateurish',''); +INSERT INTO t2 VALUES (959,236108,37,'repressions','Tropez','Gandhian',''); +INSERT INTO t2 VALUES (960,236109,37,'chillingly','nouns','stratified',''); +INSERT INTO t2 VALUES (961,236110,37,'noncritical','distracting','chamberlains',''); +INSERT INTO t2 VALUES (962,236111,37,'lithograph','mutton','creditably',''); +INSERT INTO t2 VALUES (963,236112,37,'spongers','bridgeable','philosophic',''); +INSERT INTO t2 VALUES (964,236113,37,'parenthood','stickers','ores',''); +INSERT INTO t2 VALUES (965,238005,37,'posed','transcontinental','Carleton',''); +INSERT INTO t2 VALUES (966,238006,37,'instruments','amateurish','tape','A'); +INSERT INTO t2 VALUES (967,238007,37,'filial','Gandhian','afloat','A'); +INSERT INTO t2 VALUES (968,238008,37,'fixedly','stratified','goodness','A'); +INSERT INTO t2 VALUES (969,238009,37,'relives','chamberlains','welcoming',''); +INSERT INTO t2 VALUES (970,238010,37,'Pandora','creditably','Pinsky','FAS'); +INSERT INTO t2 VALUES (971,238011,37,'watering','philosophic','halting',''); +INSERT INTO t2 VALUES (972,238012,37,'ungrateful','ores','bibliography',''); +INSERT INTO t2 VALUES (973,238013,37,'secures','Carleton','decoding',''); +INSERT INTO t2 VALUES (974,240401,41,'chastisers','tape','variance','A'); +INSERT INTO t2 VALUES (975,240402,41,'icon','afloat','allowed','A'); +INSERT INTO t2 VALUES (976,240901,41,'reuniting','goodness','dire','A'); +INSERT INTO t2 VALUES (977,240902,41,'imagining','welcoming','dub','A'); +INSERT INTO t2 VALUES (978,241801,41,'abiding','Pinsky','poisoning',''); +INSERT INTO t2 VALUES (979,242101,41,'omnisciently','halting','Iraqis','A'); +INSERT INTO t2 VALUES (980,242102,41,'Britannic','bibliography','heaving',''); +INSERT INTO t2 VALUES (981,242201,41,'scholastics','decoding','population','A'); +INSERT INTO t2 VALUES (982,242202,41,'mechanics','variance','bomb','A'); +INSERT INTO t2 VALUES (983,242501,41,'humidly','allowed','Majorca','A'); +INSERT INTO t2 VALUES (984,242502,41,'masterpiece','dire','Gershwins',''); +INSERT INTO t2 VALUES (985,246201,41,'however','dub','explorers',''); +INSERT INTO t2 VALUES (986,246202,41,'Mendelian','poisoning','libretto','A'); +INSERT INTO t2 VALUES (987,246203,41,'jarred','Iraqis','occurred',''); +INSERT INTO t2 VALUES (988,246204,41,'scolds','heaving','Lagos',''); +INSERT INTO t2 VALUES (989,246205,41,'infatuate','population','rats',''); +INSERT INTO t2 VALUES (990,246301,41,'willed','bomb','bankruptcies','A'); +INSERT INTO t2 VALUES (991,246302,41,'joyfully','Majorca','crying',''); +INSERT INTO t2 VALUES (992,248001,41,'Microsoft','Gershwins','unexpected',''); +INSERT INTO t2 VALUES (993,248002,41,'fibrosities','explorers','accessed','A'); +INSERT INTO t2 VALUES (994,248003,41,'Baltimorean','libretto','colorful','A'); +INSERT INTO t2 VALUES (995,248004,41,'equestrian','occurred','versatility','A'); +INSERT INTO t2 VALUES (996,248005,41,'Goodrich','Lagos','cosy',''); +INSERT INTO t2 VALUES (997,248006,41,'apish','rats','Darius','A'); +INSERT INTO t2 VALUES (998,248007,41,'Adlerian','bankruptcies','mastering','A'); +INSERT INTO t2 VALUES (999,248008,41,'Tropez','crying','Asiaticizations','A'); +INSERT INTO t2 VALUES (1000,248009,41,'nouns','unexpected','offerers','A'); +INSERT INTO t2 VALUES (1001,248010,41,'distracting','accessed','uncles','A'); +INSERT INTO t2 VALUES (1002,248011,41,'mutton','colorful','sleepwalk',''); +INSERT INTO t2 VALUES (1003,248012,41,'bridgeable','versatility','Ernestine',''); +INSERT INTO t2 VALUES (1004,248013,41,'stickers','cosy','checksumming',''); +INSERT INTO t2 VALUES (1005,248014,41,'transcontinental','Darius','stopped',''); +INSERT INTO t2 VALUES (1006,248015,41,'amateurish','mastering','sicker',''); +INSERT INTO t2 VALUES (1007,248016,41,'Gandhian','Asiaticizations','Italianization',''); +INSERT INTO t2 VALUES (1008,248017,41,'stratified','offerers','alphabetic',''); +INSERT INTO t2 VALUES (1009,248018,41,'chamberlains','uncles','pharmaceutic',''); +INSERT INTO t2 VALUES (1010,248019,41,'creditably','sleepwalk','creator',''); +INSERT INTO t2 VALUES (1011,248020,41,'philosophic','Ernestine','chess',''); +INSERT INTO t2 VALUES (1012,248021,41,'ores','checksumming','charcoal',''); +INSERT INTO t2 VALUES (1013,248101,41,'Carleton','stopped','Epiphany','A'); +INSERT INTO t2 VALUES (1014,248102,41,'tape','sicker','bulldozes','A'); +INSERT INTO t2 VALUES (1015,248201,41,'afloat','Italianization','Pygmalion','A'); +INSERT INTO t2 VALUES (1016,248202,41,'goodness','alphabetic','caressing','A'); +INSERT INTO t2 VALUES (1017,248203,41,'welcoming','pharmaceutic','Palestine','A'); +INSERT INTO t2 VALUES (1018,248204,41,'Pinsky','creator','regimented','A'); +INSERT INTO t2 VALUES (1019,248205,41,'halting','chess','scars','A'); +INSERT INTO t2 VALUES (1020,248206,41,'bibliography','charcoal','realest','A'); +INSERT INTO t2 VALUES (1021,248207,41,'decoding','Epiphany','diffusing','A'); +INSERT INTO t2 VALUES (1022,248208,41,'variance','bulldozes','clubroom','A'); +INSERT INTO t2 VALUES (1023,248209,41,'allowed','Pygmalion','Blythe','A'); +INSERT INTO t2 VALUES (1024,248210,41,'dire','caressing','ahead',''); +INSERT INTO t2 VALUES (1025,248211,50,'dub','Palestine','reviver',''); +INSERT INTO t2 VALUES (1026,250501,34,'poisoning','regimented','retransmitting','A'); +INSERT INTO t2 VALUES (1027,250502,34,'Iraqis','scars','landslide',''); +INSERT INTO t2 VALUES (1028,250503,34,'heaving','realest','Eiffel',''); +INSERT INTO t2 VALUES (1029,250504,34,'population','diffusing','absentee',''); +INSERT INTO t2 VALUES (1030,250505,34,'bomb','clubroom','aye',''); +INSERT INTO t2 VALUES (1031,250601,34,'Majorca','Blythe','forked','A'); +INSERT INTO t2 VALUES (1032,250602,34,'Gershwins','ahead','Peruvianizes',''); +INSERT INTO t2 VALUES (1033,250603,34,'explorers','reviver','clerked',''); +INSERT INTO t2 VALUES (1034,250604,34,'libretto','retransmitting','tutor',''); +INSERT INTO t2 VALUES (1035,250605,34,'occurred','landslide','boulevard',''); +INSERT INTO t2 VALUES (1036,251001,34,'Lagos','Eiffel','shuttered',''); +INSERT INTO t2 VALUES (1037,251002,34,'rats','absentee','quotes','A'); +INSERT INTO t2 VALUES (1038,251003,34,'bankruptcies','aye','Caltech',''); +INSERT INTO t2 VALUES (1039,251004,34,'crying','forked','Mossberg',''); +INSERT INTO t2 VALUES (1040,251005,34,'unexpected','Peruvianizes','kept',''); +INSERT INTO t2 VALUES (1041,251301,34,'accessed','clerked','roundly',''); +INSERT INTO t2 VALUES (1042,251302,34,'colorful','tutor','features','A'); +INSERT INTO t2 VALUES (1043,251303,34,'versatility','boulevard','imaginable','A'); +INSERT INTO t2 VALUES (1044,251304,34,'cosy','shuttered','controller',''); +INSERT INTO t2 VALUES (1045,251305,34,'Darius','quotes','racial',''); +INSERT INTO t2 VALUES (1046,251401,34,'mastering','Caltech','uprisings','A'); +INSERT INTO t2 VALUES (1047,251402,34,'Asiaticizations','Mossberg','narrowed','A'); +INSERT INTO t2 VALUES (1048,251403,34,'offerers','kept','cannot','A'); +INSERT INTO t2 VALUES (1049,251404,34,'uncles','roundly','vest',''); +INSERT INTO t2 VALUES (1050,251405,34,'sleepwalk','features','famine',''); +INSERT INTO t2 VALUES (1051,251406,34,'Ernestine','imaginable','sugars',''); +INSERT INTO t2 VALUES (1052,251801,34,'checksumming','controller','exterminated','A'); +INSERT INTO t2 VALUES (1053,251802,34,'stopped','racial','belays',''); +INSERT INTO t2 VALUES (1054,252101,34,'sicker','uprisings','Hodges','A'); +INSERT INTO t2 VALUES (1055,252102,34,'Italianization','narrowed','translatable',''); +INSERT INTO t2 VALUES (1056,252301,34,'alphabetic','cannot','duality','A'); +INSERT INTO t2 VALUES (1057,252302,34,'pharmaceutic','vest','recording','A'); +INSERT INTO t2 VALUES (1058,252303,34,'creator','famine','rouses','A'); +INSERT INTO t2 VALUES (1059,252304,34,'chess','sugars','poison',''); +INSERT INTO t2 VALUES (1060,252305,34,'charcoal','exterminated','attitude',''); +INSERT INTO t2 VALUES (1061,252306,34,'Epiphany','belays','dusted',''); +INSERT INTO t2 VALUES (1062,252307,34,'bulldozes','Hodges','encompasses',''); +INSERT INTO t2 VALUES (1063,252308,34,'Pygmalion','translatable','presentation',''); +INSERT INTO t2 VALUES (1064,252309,34,'caressing','duality','Kantian',''); +INSERT INTO t2 VALUES (1065,256001,34,'Palestine','recording','imprecision','A'); +INSERT INTO t2 VALUES (1066,256002,34,'regimented','rouses','saving',''); +INSERT INTO t2 VALUES (1067,256003,34,'scars','poison','maternal',''); +INSERT INTO t2 VALUES (1068,256004,34,'realest','attitude','hewed',''); +INSERT INTO t2 VALUES (1069,256005,34,'diffusing','dusted','kerosene',''); +INSERT INTO t2 VALUES (1070,258001,34,'clubroom','encompasses','Cubans',''); +INSERT INTO t2 VALUES (1071,258002,34,'Blythe','presentation','photographers',''); +INSERT INTO t2 VALUES (1072,258003,34,'ahead','Kantian','nymph','A'); +INSERT INTO t2 VALUES (1073,258004,34,'reviver','imprecision','bedlam','A'); +INSERT INTO t2 VALUES (1074,258005,34,'retransmitting','saving','north','A'); +INSERT INTO t2 VALUES (1075,258006,34,'landslide','maternal','Schoenberg','A'); +INSERT INTO t2 VALUES (1076,258007,34,'Eiffel','hewed','botany','A'); +INSERT INTO t2 VALUES (1077,258008,34,'absentee','kerosene','curs',''); +INSERT INTO t2 VALUES (1078,258009,34,'aye','Cubans','solidification',''); +INSERT INTO t2 VALUES (1079,258010,34,'forked','photographers','inheritresses',''); +INSERT INTO t2 VALUES (1080,258011,34,'Peruvianizes','nymph','stiller',''); +INSERT INTO t2 VALUES (1081,258101,68,'clerked','bedlam','t1','A'); +INSERT INTO t2 VALUES (1082,258102,68,'tutor','north','suite','A'); +INSERT INTO t2 VALUES (1083,258103,34,'boulevard','Schoenberg','ransomer',''); +INSERT INTO t2 VALUES (1084,258104,68,'shuttered','botany','Willy',''); +INSERT INTO t2 VALUES (1085,258105,68,'quotes','curs','Rena','A'); +INSERT INTO t2 VALUES (1086,258106,68,'Caltech','solidification','Seattle','A'); +INSERT INTO t2 VALUES (1087,258107,68,'Mossberg','inheritresses','relaxes','A'); +INSERT INTO t2 VALUES (1088,258108,68,'kept','stiller','exclaim',''); +INSERT INTO t2 VALUES (1089,258109,68,'roundly','t1','implicated','A'); +INSERT INTO t2 VALUES (1090,258110,68,'features','suite','distinguish',''); +INSERT INTO t2 VALUES (1091,258111,68,'imaginable','ransomer','assayed',''); +INSERT INTO t2 VALUES (1092,258112,68,'controller','Willy','homeowner',''); +INSERT INTO t2 VALUES (1093,258113,68,'racial','Rena','and',''); +INSERT INTO t2 VALUES (1094,258201,34,'uprisings','Seattle','stealth',''); +INSERT INTO t2 VALUES (1095,258202,34,'narrowed','relaxes','coinciding','A'); +INSERT INTO t2 VALUES (1096,258203,34,'cannot','exclaim','founder','A'); +INSERT INTO t2 VALUES (1097,258204,34,'vest','implicated','environing',''); +INSERT INTO t2 VALUES (1098,258205,34,'famine','distinguish','jewelry',''); +INSERT INTO t2 VALUES (1099,258301,34,'sugars','assayed','lemons','A'); +INSERT INTO t2 VALUES (1100,258401,34,'exterminated','homeowner','brokenness','A'); +INSERT INTO t2 VALUES (1101,258402,34,'belays','and','bedpost','A'); +INSERT INTO t2 VALUES (1102,258403,34,'Hodges','stealth','assurers','A'); +INSERT INTO t2 VALUES (1103,258404,34,'translatable','coinciding','annoyers',''); +INSERT INTO t2 VALUES (1104,258405,34,'duality','founder','affixed',''); +INSERT INTO t2 VALUES (1105,258406,34,'recording','environing','warbling',''); +INSERT INTO t2 VALUES (1106,258407,34,'rouses','jewelry','seriously',''); +INSERT INTO t2 VALUES (1107,228123,37,'poison','lemons','boasted',''); +INSERT INTO t2 VALUES (1108,250606,34,'attitude','brokenness','Chantilly',''); +INSERT INTO t2 VALUES (1109,208405,37,'dusted','bedpost','Iranizes',''); +INSERT INTO t2 VALUES (1110,212101,37,'encompasses','assurers','violinist',''); +INSERT INTO t2 VALUES (1111,218206,37,'presentation','annoyers','extramarital',''); +INSERT INTO t2 VALUES (1112,150401,37,'Kantian','affixed','spates',''); +INSERT INTO t2 VALUES (1113,248212,41,'imprecision','warbling','cloakroom',''); +INSERT INTO t2 VALUES (1114,128026,00,'saving','seriously','gazer',''); +INSERT INTO t2 VALUES (1115,128024,00,'maternal','boasted','hand',''); +INSERT INTO t2 VALUES (1116,128027,00,'hewed','Chantilly','tucked',''); +INSERT INTO t2 VALUES (1117,128025,00,'kerosene','Iranizes','gems',''); +INSERT INTO t2 VALUES (1118,128109,00,'Cubans','violinist','clinker',''); +INSERT INTO t2 VALUES (1119,128705,00,'photographers','extramarital','refiner',''); +INSERT INTO t2 VALUES (1120,126303,00,'nymph','spates','callus',''); +INSERT INTO t2 VALUES (1121,128308,00,'bedlam','cloakroom','leopards',''); +INSERT INTO t2 VALUES (1122,128204,00,'north','gazer','comfortingly',''); +INSERT INTO t2 VALUES (1123,128205,00,'Schoenberg','hand','generically',''); +INSERT INTO t2 VALUES (1124,128206,00,'botany','tucked','getters',''); +INSERT INTO t2 VALUES (1125,128207,00,'curs','gems','sexually',''); +INSERT INTO t2 VALUES (1126,118205,00,'solidification','clinker','spear',''); +INSERT INTO t2 VALUES (1127,116801,00,'inheritresses','refiner','serums',''); +INSERT INTO t2 VALUES (1128,116803,00,'stiller','callus','Italianization',''); +INSERT INTO t2 VALUES (1129,116804,00,'t1','leopards','attendants',''); +INSERT INTO t2 VALUES (1130,116802,00,'suite','comfortingly','spies',''); +INSERT INTO t2 VALUES (1131,128605,00,'ransomer','generically','Anthony',''); +INSERT INTO t2 VALUES (1132,118308,00,'Willy','getters','planar',''); +INSERT INTO t2 VALUES (1133,113702,00,'Rena','sexually','cupped',''); +INSERT INTO t2 VALUES (1134,113703,00,'Seattle','spear','cleanser',''); +INSERT INTO t2 VALUES (1135,112103,00,'relaxes','serums','commuters',''); +INSERT INTO t2 VALUES (1136,118009,00,'exclaim','Italianization','honeysuckle',''); +INSERT INTO t2 VALUES (5136,1118009,00,'exclaim','Italianization','honeysuckle',''); +INSERT INTO t2 VALUES (1137,138011,00,'implicated','attendants','orphanage',''); +INSERT INTO t2 VALUES (1138,138010,00,'distinguish','spies','skies',''); +INSERT INTO t2 VALUES (1139,138012,00,'assayed','Anthony','crushers',''); +INSERT INTO t2 VALUES (1140,068304,00,'homeowner','planar','Puritan',''); +INSERT INTO t2 VALUES (1141,078009,00,'and','cupped','squeezer',''); +INSERT INTO t2 VALUES (1142,108013,00,'stealth','cleanser','bruises',''); +INSERT INTO t2 VALUES (1143,084004,00,'coinciding','commuters','bonfire',''); +INSERT INTO t2 VALUES (1144,083402,00,'founder','honeysuckle','Colombo',''); +INSERT INTO t2 VALUES (1145,084003,00,'environing','orphanage','nondecreasing',''); +INSERT INTO t2 VALUES (1146,088504,00,'jewelry','skies','innocents',''); +INSERT INTO t2 VALUES (1147,088005,00,'lemons','crushers','masked',''); +INSERT INTO t2 VALUES (1148,088007,00,'brokenness','Puritan','file',''); +INSERT INTO t2 VALUES (1149,088006,00,'bedpost','squeezer','brush',''); +INSERT INTO t2 VALUES (1150,148025,00,'assurers','bruises','mutilate',''); +INSERT INTO t2 VALUES (1151,148024,00,'annoyers','bonfire','mommy',''); +INSERT INTO t2 VALUES (1152,138305,00,'affixed','Colombo','bulkheads',''); +INSERT INTO t2 VALUES (1153,138306,00,'warbling','nondecreasing','undeclared',''); +INSERT INTO t2 VALUES (1154,152701,00,'seriously','innocents','displacements',''); +INSERT INTO t2 VALUES (1155,148505,00,'boasted','masked','nieces',''); +INSERT INTO t2 VALUES (1156,158003,00,'Chantilly','file','coeducation',''); +INSERT INTO t2 VALUES (1157,156201,00,'Iranizes','brush','brassy',''); +INSERT INTO t2 VALUES (1158,156202,00,'violinist','mutilate','authenticator',''); +INSERT INTO t2 VALUES (1159,158307,00,'extramarital','mommy','Washoe',''); +INSERT INTO t2 VALUES (1160,158402,00,'spates','bulkheads','penny',''); +INSERT INTO t2 VALUES (1161,158401,00,'cloakroom','undeclared','Flagler',''); +INSERT INTO t2 VALUES (1162,068013,00,'gazer','displacements','stoned',''); +INSERT INTO t2 VALUES (1163,068012,00,'hand','nieces','cranes',''); +INSERT INTO t2 VALUES (1164,068203,00,'tucked','coeducation','masterful',''); +INSERT INTO t2 VALUES (1165,088205,00,'gems','brassy','biracial',''); +INSERT INTO t2 VALUES (1166,068704,00,'clinker','authenticator','steamships',''); +INSERT INTO t2 VALUES (1167,068604,00,'refiner','Washoe','windmills',''); +INSERT INTO t2 VALUES (1168,158502,00,'callus','penny','exploit',''); +INSERT INTO t2 VALUES (1169,123103,00,'leopards','Flagler','riverfront',''); +INSERT INTO t2 VALUES (1170,148026,00,'comfortingly','stoned','sisterly',''); +INSERT INTO t2 VALUES (1171,123302,00,'generically','cranes','sharpshoot',''); +INSERT INTO t2 VALUES (1172,076503,00,'getters','masterful','mittens',''); +INSERT INTO t2 VALUES (1173,126304,00,'sexually','biracial','interdependency',''); +INSERT INTO t2 VALUES (1174,068306,00,'spear','steamships','policy',''); +INSERT INTO t2 VALUES (1175,143504,00,'serums','windmills','unleashing',''); +INSERT INTO t2 VALUES (1176,160201,00,'Italianization','exploit','pretenders',''); +INSERT INTO t2 VALUES (1177,148028,00,'attendants','riverfront','overstatements',''); +INSERT INTO t2 VALUES (1178,148027,00,'spies','sisterly','birthed',''); +INSERT INTO t2 VALUES (1179,143505,00,'Anthony','sharpshoot','opportunism',''); +INSERT INTO t2 VALUES (1180,108014,00,'planar','mittens','showroom',''); +INSERT INTO t2 VALUES (1181,076104,00,'cupped','interdependency','compromisingly',''); +INSERT INTO t2 VALUES (1182,078106,00,'cleanser','policy','Medicare',''); +INSERT INTO t2 VALUES (1183,126102,00,'commuters','unleashing','corresponds',''); +INSERT INTO t2 VALUES (1184,128029,00,'honeysuckle','pretenders','hardware',''); +INSERT INTO t2 VALUES (1185,128028,00,'orphanage','overstatements','implant',''); +INSERT INTO t2 VALUES (1186,018410,00,'skies','birthed','Alicia',''); +INSERT INTO t2 VALUES (1187,128110,00,'crushers','opportunism','requesting',''); +INSERT INTO t2 VALUES (1188,148506,00,'Puritan','showroom','produced',''); +INSERT INTO t2 VALUES (1189,123303,00,'squeezer','compromisingly','criticizes',''); +INSERT INTO t2 VALUES (1190,123304,00,'bruises','Medicare','backer',''); +INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively',''); +INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky',''); +INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly',''); +--enable_query_log + +# +# Search with a key +# + +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +select fld3 from t2 where fld3 like "%cultivation" ; + +# +# Search with a key using sorting and limit the same time +# + +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +select fld3,companynr from t2 where companynr = 58 order by fld3; + +select fld3 from t2 order by fld3 desc limit 10; +select fld3 from t2 order by fld3 desc limit 5; +select fld3 from t2 order by fld3 desc limit 5,5; + +# +# Search with a key having a constant with each unique key. +# The table is read directly with read-next on fld3 +# + +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +select t2.fld3 from t2 where fld3 LIKE 'h%le'; + +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; + +# +# Test using INDEX and IGNORE INDEX +# + +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; + +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; + +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; + +# +# NOTE NOTE NOTE +# The next should give an error +# + +-- error 1072 +explain select fld3 from t2 ignore index (fld3,not_used); +-- error 1072 +explain select fld3 from t2 use index (not_used); + +# +# Test sorting with a used key (there is no need for sorting) +# + +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; + +# +# Search with a key having a constant with many occurrences +# The table is read directly with read-next having fld3 to get the +# occurrences +# + +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; + +# +# Search with bunched 'or's. +# If one can limit the key to a certain interval only the possible +# alternatives will be gone through +# + +select fld1 from t2 where fld1=250501 or fld1="250502"; +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; + +# +# Search with a key with LIKE constant +# If the like starts with a certain letter key will be used. +# + +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +select fld1,fld3 from t2 where fld1 like "25050%"; +select fld1,fld3 from t2 where fld1 like "25050_"; + +# +# Search using distinct. An automatic grouping will be done over all the fields, +# if only distinct is used. In any other case a temporary table will always +# be created. If only the field used for sorting is from the main register, +# it will be sorted first before the distinct table is created. +# + +select distinct companynr from t2; +select distinct companynr from t2 order by companynr; +select distinct companynr from t2 order by companynr desc; +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; + +select distinct fld3 from t2 where companynr = 34 order by fld3; +select distinct fld3 from t2 limit 10; +select distinct fld3 from t2 having fld3 like "A%" limit 10; +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; + +# make a big table. + +create table t3 ( + period int not null, + name char(32) not null, + companynr int not null, + price double(11,0), + price2 double(11,0), + key (period), + key (name) +); + +--disable_query_log +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1001,"Iranizes",37,5987435,234724); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1002,"violinist",37,28357832,8723648); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1003,"extramarital",37,39654943,235872); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1004,"spates",78,726498,72987523); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1005,"cloakroom",78,98439034,823742); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1006,"gazer",101,834598,27348324); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1007,"hand",154,983543950,29837423); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1008,"tucked",311,234298,3275892); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1009,"gems",447,2374834,9872392); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1010,"clinker",512,786542,76234234); +--enable_query_log + +create temporary table tmp engine = myisam select * from t3; + +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +#insert into tmp select * from t3; +#insert into t3 select * from tmp; + +alter table t3 add t2nr int not null auto_increment primary key first; + +drop table tmp; + +# big table done + +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +select distinct fld5 from t2 limit 10; + +# +# Force use of remove_dupp +# + +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +SET SQL_BIG_TABLES=1; # Force use of MyISAM +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; + +# +# A big order by that should trigger a merge in filesort +# + +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; + +# +# Search with distinct and order by with many table. +# + +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; + +# +# Here the last fld3 is optimized away from the order by +# + +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; + +# +# Some test with ORDER BY and limit +# + +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; + +# +# Search with a constant table. +# + +select period from t1; +select period from t1 where period=1900; +select fld3,period from t1,t2 where fld1 = 011401 order by period; + +# +# Search with a constant table and several keyparts. (Rows are read only once +# in the beginning of the search) +# + +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; + +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; + +# +# Search with a constant table and several rows from another table +# + +select fld3,period from t2,t1 where companynr*10 = 37*10; + +# +# Search with a table reference and without a key. +# t3 will be the main table. +# + +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; + +# +# Search with an interval on a table with full key on reference table. +# Here t2 will be the main table and only records matching the +# t2nr will be checked. +# + +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; + +# +# We need another table for join stuff.. +# + +create table t4 ( + companynr tinyint(2) unsigned zerofill NOT NULL default '00', + companyname char(30) NOT NULL default '', + PRIMARY KEY (companynr), + UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; + +--disable_query_log +INSERT INTO t4 (companynr, companyname) VALUES (29,'company 1'); +INSERT INTO t4 (companynr, companyname) VALUES (34,'company 2'); +INSERT INTO t4 (companynr, companyname) VALUES (36,'company 3'); +INSERT INTO t4 (companynr, companyname) VALUES (37,'company 4'); +INSERT INTO t4 (companynr, companyname) VALUES (40,'company 5'); +INSERT INTO t4 (companynr, companyname) VALUES (41,'company 6'); +INSERT INTO t4 (companynr, companyname) VALUES (53,'company 7'); +INSERT INTO t4 (companynr, companyname) VALUES (58,'company 8'); +INSERT INTO t4 (companynr, companyname) VALUES (65,'company 9'); +INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10'); +INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11'); +INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown'); +--enable_query_log + +# +# Test of stright join to force a full join. +# + +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; + +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; + +# +# Full join (same alias) +# + +select * from t1,t1 t12; +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; + +# +# Test of left join. +# +insert into t2 (fld1, companynr) values (999999,99); + +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; + +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +delete from t2 where fld1=999999; + +# +# Test left join optimization + +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; + +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +# Following can't be optimized +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; + +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; + +# +# Joins with forms. +# + +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; + +# +# Search using 'or' with the same referens group. +# An interval search will be done first with the first table and after that +# the other table is referenced with a key with a 'test if key in use' for +# each record +# + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; + +# +# Test of many parenthesis levels +# + +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); + +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; + +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); + +select fld1 from t2 where fld1 between 250502 and 250504; + +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; + +# +# Group on one table. +# optimizer: sort table by group and send rows. +# + +select count(*) from t1; +select companynr,count(*),sum(fld1) from t2 group by companynr; +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +select distinct mod(companynr,10) from t4 group by companynr; +select distinct 1 from t4 group by companynr; +select count(distinct fld1) from t2; +select companynr,count(distinct fld1) from t2 group by companynr; +select companynr,count(*) from t2 group by companynr; +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; + +# +# group with where on a key field +# + +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +select name,count(*) from t3 where name='cloakroom' group by name; +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +select count(*) from t3 where name='cloakroom' and price2=823742; +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; + +# +# Group with extra not group fields. +# + +select companynr|0,companyname from t4 group by 1; +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; + +# +# Calculation with group functions +# + +select sum(Period)/count(*) from t1; +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; + +# +# Group with order on not first table +# optimizer: sort table by group and write group records to tmp table. +# sort tmp_table and send rows. +# + +select companynr,count(*) from t2 group by companynr order by 2 desc; +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; + +# +# group by with many tables +# optimizer: create tmp table with group-by uniq index. +# write with update to tmp table. +# sort tmp table according to order (or group if no order) +# send rows +# + +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; + +# +# group with many tables and long group on many tables. group on formula +# optimizer: create tmp table with neaded fields +# sort tmp table by group and calculate sums to new table +# if different order by than group, sort tmp table +# send rows +# + +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; + +# +# WHERE const folding +# optimize: If there is a "field = const" part in the where, change all +# instances of field in the and level to const. +# All instances of const = const are checked once and removed. +# + +# +# Where -> t3.t2nr = 98005 and t2.fld1 = 98005 +# + +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; + +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; + +explain select fld3 from t2 where 1>2 or 2>3; +explain select fld3 from t2 where fld1=fld1; + +# +# HAVING +# + +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; + +# +# MIN(), MAX() and COUNT() optimizing +# + +select count(*) from t2; +select count(*) from t2 where fld1 < 098024; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol +select min(fld1) from t2 where fld1>= 098024; +--enable_ps_protocol +select max(fld1) from t2 where fld1>= 098024; +select count(*) from t3 where price2=76234234; +select count(*) from t3 where companynr=512 and price2=76234234; +explain select min(fld1),max(fld1),count(*) from t2; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol +select min(fld1),max(fld1),count(*) from t2; +--enable_ps_protocol +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +select max(t2nr) from t3 where price=983543950; + +# +# Test of alias +# + +select t1.period from t3 = t1 limit 1; +select t1.period from t1 as t1 limit 1; +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +select period as ok_period from t1 limit 1; +select period as ok_period from t1 group by ok_period limit 1; +select 1+1 as summa from t1 group by summa limit 1; +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; + +# +# Some simple show commands +# + +show tables; +show tables from test like "s%"; +show tables from test like "t?"; +# We mask out the Privileges column because it differs with embedded server +--replace_column 8 # +show full columns from t2; +--replace_column 8 # +show full columns from t2 from test like 'f%'; +--replace_column 8 # +show full columns from t2 from test like 's%'; +show keys from t2; + +drop table t4, t3, t2, t1; + + +CREATE TABLE t1 ( + cont_nr int(11) NOT NULL auto_increment, + ver_nr int(11) NOT NULL default '0', + aufnr int(11) NOT NULL default '0', + username varchar(50) NOT NULL default '', + hdl_nr int(11) NOT NULL default '0', + eintrag date NOT NULL default '0000-00-00', + st_klasse varchar(40) NOT NULL default '', + st_wert varchar(40) NOT NULL default '', + st_zusatz varchar(40) NOT NULL default '', + st_bemerkung varchar(255) NOT NULL default '', + kunden_art varchar(40) NOT NULL default '', + mcbs_knr int(11) default NULL, + mcbs_aufnr int(11) NOT NULL default '0', + schufa_status char(1) default '?', + bemerkung text, + wirknetz text, + wf_igz int(11) NOT NULL default '0', + tarifcode varchar(80) default NULL, + recycle char(1) default NULL, + sim varchar(30) default NULL, + mcbs_tpl varchar(30) default NULL, + emp_nr int(11) NOT NULL default '0', + laufzeit int(11) default NULL, + hdl_name varchar(30) default NULL, + prov_hdl_nr int(11) NOT NULL default '0', + auto_wirknetz varchar(50) default NULL, + auto_billing varchar(50) default NULL, + touch timestamp NOT NULL, + kategorie varchar(50) default NULL, + kundentyp varchar(20) NOT NULL default '', + sammel_rech_msisdn varchar(30) NOT NULL default '', + p_nr varchar(9) NOT NULL default '', + suffix char(3) NOT NULL default '', + PRIMARY KEY (cont_nr), + KEY idx_aufnr(aufnr), + KEY idx_hdl_nr(hdl_nr), + KEY idx_st_klasse(st_klasse), + KEY ver_nr(ver_nr), + KEY eintrag_idx(eintrag), + KEY emp_nr_idx(emp_nr), + KEY wf_igz(wf_igz), + KEY touch(touch), + KEY hdl_tag(eintrag,hdl_nr), + KEY prov_hdl_nr(prov_hdl_nr), + KEY mcbs_aufnr(mcbs_aufnr), + KEY kundentyp(kundentyp), + KEY p_nr(p_nr,suffix) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); + +--disable_ps_protocol +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +--enable_ps_protocol +drop table t1; From 0684dc1342e0e0bbf20224e159fb4b457b598f0c Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 18 Oct 2005 15:43:59 +0200 Subject: [PATCH 159/322] Bug #12985 Do-mysqlclient-test: Can't find -lyassl when linking - Use yassl_includes and yassl_libs instead of openssl_includes and openssl_libs to avoid that mysql_config returns that libyassl and libtaocrypt are needed for linking. --- client/Makefile.am | 6 ++++-- config/ac-macros/yassl.m4 | 10 ++++------ configure.in | 4 ++-- libmysql/Makefile.am | 2 +- libmysql_r/Makefile.am | 4 ++-- libmysqld/Makefile.am | 2 +- server-tools/instance-manager/Makefile.am | 4 ++-- sql/Makefile.am | 6 ++++-- vio/Makefile.am | 10 +++++----- 9 files changed, 25 insertions(+), 23 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index d47e9f98f5e..cf9d2884ded 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -22,8 +22,10 @@ else yassl_dummy_link_fix= endif #AUTOMAKE_OPTIONS = nostdinc -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/regex $(openssl_includes) +INCLUDES = -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/regex \ + $(openssl_includes) $(yassl_includes) LIBS = @CLIENT_LIBS@ LDADD= @CLIENT_EXTRA_LDFLAGS@ \ $(top_builddir)/libmysql/libmysqlclient.la diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4 index 92133339343..548768fb717 100644 --- a/config/ac-macros/yassl.m4 +++ b/config/ac-macros/yassl.m4 @@ -15,17 +15,15 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [ fi AC_MSG_RESULT([using bundled yaSSL]) yassl_dir="extra/yassl" - openssl_libs="\ - -L\$(top_builddir)/extra/yassl/src -lyassl\ - -L\$(top_builddir)/extra/yassl/taocrypt/src -ltaocrypt" - openssl_includes="-I\$(top_srcdir)/extra/yassl/include" + yassl_libs="-L\$(top_srcdir)/extra/yassl/src -lyassl -L\$(top_srcdir)/extra/yassl/taocrypt/src -ltaocrypt" + yassl_includes="-I\$(top_srcdir)/extra/yassl/include" AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.]) else yassl_dir="" AC_MSG_RESULT(no) fi - AC_SUBST(openssl_libs) - AC_SUBST(openssl_includes) + AC_SUBST(yassl_libs) + AC_SUBST(yassl_includes) AC_SUBST(yassl_dir) AM_CONDITIONAL([HAVE_YASSL], [ test "with_yassl" = "yes" ]) ]) diff --git a/configure.in b/configure.in index 05aaaa73bfa..d06cd0e1af1 100644 --- a/configure.in +++ b/configure.in @@ -1139,7 +1139,7 @@ dnl Is this the right match for DEC OSF on alpha? sql/Makefile.in) # Use gen_lex_hash.linux instead of gen_lex_hash # Add library dependencies to mysqld_DEPENDENCIES - lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(ndbcluster_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)" + lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(ndbcluster_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs) \$(yassl_libs)" cat > $filesed << EOF s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1, s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux, @@ -2423,7 +2423,7 @@ then AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe]) fi -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $yassl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" AC_SUBST(CLIENT_LIBS) AC_SUBST(NON_THREADED_LIBS) diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 4bd9eddafb0..cb02e0f1235 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -24,7 +24,7 @@ target = libmysqlclient.la target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ LIBS = @CLIENT_LIBS@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) @ZLIB_INCLUDES@ + $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@ include $(srcdir)/Makefile.shared diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index 65255066d45..6ab09368cc5 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -22,10 +22,10 @@ target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ -LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ +LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ @yassl_libs@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) @ZLIB_INCLUDES@ + $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@ ## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include include $(top_srcdir)/libmysql/Makefile.shared diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 9aef03f20d2..ca8e48aa612 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -29,7 +29,7 @@ INCLUDES= @bdb_includes@ \ -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \ -I$(top_srcdir)/regex \ - $(openssl_includes) @ZLIB_INCLUDES@ + $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a pkglib_LIBRARIES = libmysqld.a diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am index b872adca09d..4fa2a0da405 100644 --- a/server-tools/instance-manager/Makefile.am +++ b/server-tools/instance-manager/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA INCLUDES= @ZLIB_INCLUDES@ -I$(top_srcdir)/include \ - $(openssl_includes) -I$(top_builddir)/include + @openssl_includes@ @yassl_includes@ -I$(top_builddir)/include DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER @@ -85,7 +85,7 @@ mysqlmanager_LDADD= liboptions.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a \ $(top_builddir)/dbug/libdbug.a \ - @openssl_libs@ @ZLIB_LIBS@ + @openssl_libs@ @yassl_libs@ @ZLIB_LIBS@ tags: diff --git a/sql/Makefile.am b/sql/Makefile.am index 4824a75d6fa..5074212e6c8 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -22,7 +22,8 @@ MYSQLBASEdir= $(prefix) INCLUDES = @ZLIB_INCLUDES@ \ @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \ -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes) + -I$(top_srcdir)/regex -I$(srcdir) $(yassl_includes) \ + $(openssl_includes) WRAPLIBS= @WRAPLIBS@ SUBDIRS = share libexec_PROGRAMS = mysqld @@ -42,7 +43,8 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \ @bdb_libs@ @innodb_libs@ @pstack_libs@ \ @innodb_system_libs@ \ @ndbcluster_libs@ @ndbcluster_system_libs@ \ - $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ @openssl_libs@ + $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \ + @yassl_libs@ @openssl_libs@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ item_strfunc.h item_timefunc.h item_uniq.h \ item_create.h item_subselect.h item_row.h \ diff --git a/vio/Makefile.am b/vio/Makefile.am index 0d4f052b30a..544639139de 100644 --- a/vio/Makefile.am +++ b/vio/Makefile.am @@ -20,23 +20,23 @@ else yassl_dummy_link_fix= endif INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) -LDADD= @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) + $(openssl_includes) $(yassl_includes) +LDADD= @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs) pkglib_LIBRARIES= libvio.a noinst_PROGRAMS = test-ssl test-sslserver test-sslclient noinst_HEADERS= vio_priv.h test_ssl_SOURCES= test-ssl.c $(yassl_dummy_link_fix) test_ssl_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \ ../mysys/libmysys.a ../strings/libmystrings.a \ - $(openssl_libs) + $(openssl_libs) $(yassl_libs) test_sslserver_SOURCES= test-sslserver.c $(yassl_dummy_link_fix) test_sslserver_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \ ../mysys/libmysys.a ../strings/libmystrings.a \ - $(openssl_libs) + $(openssl_libs) $(yassl_libs) test_sslclient_SOURCES= test-sslclient.c $(yassl_dummy_link_fix) test_sslclient_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \ ../mysys/libmysys.a ../strings/libmystrings.a \ - $(openssl_libs) + $(openssl_libs) $(yassl_libs) libvio_a_SOURCES= vio.c viosocket.c viossl.c viosslfactories.c # Don't update the files from bitkeeper From 5db97a8d9a9d93cf71e5e3311d505a25638608e2 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 18 Oct 2005 16:51:11 +0300 Subject: [PATCH 160/322] Fixed stack overflow problem and abnormal end on Netware. --- netware/mysql.def | 1 + 1 file changed, 1 insertion(+) diff --git a/netware/mysql.def b/netware/mysql.def index b79c94b1bb1..16acc7babe1 100644 --- a/netware/mysql.def +++ b/netware/mysql.def @@ -6,6 +6,7 @@ SCREENNAME "MySQL Monitor[scrollable]" COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Monitor" VERSION 4, 0 +STACKSIZE 32768 MULTIPLE XDCDATA ../netware/mysql.xdc #DEBUG From 588add26673f4135774f546772b616463f399ad6 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Tue, 18 Oct 2005 16:18:08 +0200 Subject: [PATCH 161/322] WL#2835: Base64 Fixes after Jonas review --- mysys/base64.c | 2 +- ndb/config/type_util.mk.am | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/mysys/base64.c b/mysys/base64.c index d4ddf333c84..7dcca6f14ac 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -102,7 +102,7 @@ pos(unsigned char c) #define SKIP_SPACE(src, i, size) \ { \ - while (i < size && my_isspace(default_charset_info, * src)) \ + while (i < size && my_isspace(&my_charset_latin1, * src)) \ { \ i++; \ src++; \ diff --git a/ndb/config/type_util.mk.am b/ndb/config/type_util.mk.am index 9e716d7cca6..4f2d605dc91 100644 --- a/ndb/config/type_util.mk.am +++ b/ndb/config/type_util.mk.am @@ -6,6 +6,3 @@ INCLUDES += -I$(srcdir) \ -I$(top_srcdir)/ndb/include/util \ -I$(top_srcdir)/ndb/include/portlib \ -I$(top_srcdir)/ndb/include/logger - -LDADD += \ - $(top_builddir)/mysys/libmysys.a From 8e1dac44b4636c7f8dd97fe9417c70c1894515c3 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 18 Oct 2005 18:03:26 +0300 Subject: [PATCH 162/322] Some fixes to avoid compiler warnings. --- mysql-test/my_manage.c | 5 ++++- mysql-test/mysql_test_run_new.c | 1 - sql/item_func.cc | 1 - strings/ctype-simple.c | 2 +- strings/ctype-ucs2.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 88e68dfc27e..919d3bd0529 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -230,7 +230,10 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)), char *user, char *password, int port,char *tmp_dir) { arg_list_t al; - int err= 0, i; + int err= 0; +#ifndef __WIN__ + int i; +#endif char trash[FN_REFLEN]; /* mysqladmin file */ diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 40e45a92851..8beebefd298 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1716,7 +1716,6 @@ int main(int argc, char **argv) int* handle; char test[FN_LEN]; char mask[FN_REFLEN]; - char *p; int position; /* single test */ diff --git a/sql/item_func.cc b/sql/item_func.cc index 288859443ff..df32672e12b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3252,7 +3252,6 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name, LEX_STRING component) { sys_var *var; - char buff[MAX_SYS_VAR_LENGTH*2+4+8], *pos; LEX_STRING *base_name, *component_name; if (component.str == 0 && diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index efddab621f2..095b2f3a4ac 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -867,7 +867,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), while (long_val != 0) { long quo= long_val/10; - *--p = '0' + (long_val - quo*10); + *--p = (char) ('0' + (long_val - quo*10)); long_val= quo; } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 56c05635300..ad07fd9903c 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1043,7 +1043,7 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), while (long_val != 0) { long quo= long_val/10; - *--p = '0' + (long_val - quo*10); + *--p = (char) ('0' + (long_val - quo*10)); long_val= quo; } From 366b7017e4ba3d35aaa8ddcc72f3054e8a5a6533 Mon Sep 17 00:00:00 2001 From: "ranger@regul.home.lan" <> Date: Tue, 18 Oct 2005 19:26:31 +0300 Subject: [PATCH 163/322] Added initial support of stress testing. Now it is possible to start stress test from mysql-test-run script. For details see README.stress --- mysql-test/README.stress | 116 ++++ mysql-test/mysql-stress-test.pl | 1148 +++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.sh | 187 ++++- 3 files changed, 1447 insertions(+), 4 deletions(-) create mode 100644 mysql-test/README.stress create mode 100755 mysql-test/mysql-stress-test.pl diff --git a/mysql-test/README.stress b/mysql-test/README.stress new file mode 100644 index 00000000000..001ecceef1b --- /dev/null +++ b/mysql-test/README.stress @@ -0,0 +1,116 @@ + +Overview +-------- + +Stress script is designed to perform testsing of mysql server in +multi-thread environment. + +Stress script allows: + + - to use for stress testing mysqltest binary as test engine + - to use for stress testing both regular test suite and any + additional test suites (e.g. mysql-test-extra-5.0) + - to specify files with lists of tests both for initialization of + stress db and for further testing itself + - to define number of threads that will be concurrently used in testing + - to define limitations for test run. e.g. number of tests or loops + for execution or duration of testing, delay between test executions, etc. + - to get readable log file which can be used for identification of + errors arose during testing + +All functionality regarding stress testing was implemeted in +mysql-stress-test.pl script and there are two ways to run stress test: + + - for most cases it is enough to use options below for starting of + stress test from mysql-test-run wrapper. In this case server will + be run automatically, all preparation steps will be performed + and after that stress test will be started. + + - in advanced case one can run mysql-stress-test.pl script directly. + But it requires to perform some preparation steps and to specify a + bunch of options as well so this way may look a bit complicate. + +Usage +----- + +Below is list of stress test specific options for mysql-test-run: + +--stress + Enable stress mode + +--stress-suite= + Test suite name that will be used in stress testing. + We assume that all suites are located in mysql-test/suite directory + There is one special suite name - that corresponds + to regular test suite located in mysql-test directory. + +--stress-threads= + Number of threads that will be used in stress testing + +--stress-tests-file= + Filename with list of tests(without .test suffix) that will be used in + stress testing. Default filename is stress_tests.txt and default + location of this file is suite//stress_tests.txt + +--stress-init-file= + Filename with list of tests(without .test suffix) that will be used in + stress testing for initialization of stress db. These tests will be + executed only once before starting of test itself. Default filename + is stress_init.txt and default location of this file is + suite//stress_init.txt + +--stress-mode= + Possible values are: random(default), seq + + There are two possible modes which affect order of selecting of tests + from the list: + - in random mode tests will be selected in random order + - in seq mode each thread will execute tests in the loop one by one as + they specified in the list file. + +--stress-test-count= + Total number of tests that will be executed concurrently by all threads + +--stress-loop-count= + Total number of loops in seq mode that will be executed concurrently + by all threads + +--stress-test-duration= + Duration of stress testing in seconds + +Examples +-------- + +1. Example of simple command line to start stress test: + + mysql-test-run --stress alias + +Runs stress test with default values for number of threads and number of tests, +with test 'alias' from suite 'main'. + +2. Using in stress testing tests from other suites: + + - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \ + --stress-suite=example --stress-tests-file=testslist.txt + + Will run stress test with 10 threads, will execute 1000 tests by all + threads, test will be used from suite 'example', list of test will be + taken from file 'testslist.txt' + + - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \ + --stress-suite=example sum_distinct + + Will run stress test with 10 threads, will execute 1000 tests by all + threads, test will be used from suite 'example', list of test contains + only one test 'sum_distinct' + +3. Debugging of issues found with stress test + + Right now stress test is not fully integrated in mysql-test-run + and does not support --gdb option so to debug issue found with stress + test you have to start separately mysql server under debuger and then + run stress test as: + + - mysql-test-run --extern --stress --stress-threads=10 \ + --stress-test-count=1000 --stress-suite=example \ + sum_distinct diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl new file mode 100755 index 00000000000..899dd06a746 --- /dev/null +++ b/mysql-test/mysql-stress-test.pl @@ -0,0 +1,1148 @@ +#!/usr/bin/perl +# ====================================================================== +# MySQL server stress test system +# ====================================================================== +# +########################################################################## +# +# SCENARIOS AND REQUIREMENTS +# +# The system should perform stress testing of MySQL server with +# following requirements and basic scenarios: +# +# Basic requirements: +# +# Design of stress script should allow one: +# +# - to use for stress testing mysqltest binary as test engine +# - to use for stress testing both regular test suite and any +# additional test suites (e.g. mysql-test-extra-5.0) +# - to specify files with lists of tests both for initialization of +# stress db and for further testing itself +# - to define number of threads that will be concurrently used in testing +# - to define limitations for test run. e.g. number of tests or loops +# for execution or duration of testing, delay between test executions, etc. +# - to get readable log file which can be used for identification of +# errors arose during testing +# +# Basic scenarios: +# +# * It should be possible to run stress script in standalone mode +# which will allow to create various scenarios of stress workloads: +# +# simple ones: +# +# box #1: +# - one instance of script with list of tests #1 +# +# and more advanced ones: +# +# box #1: +# - one instance of script with list of tests #1 +# - another instance of script with list of tests #2 +# box #2: +# - one instance of script with list of tests #3 +# - another instance of script with list of tests #4 +# that will recreate whole database to back it to clean +# state +# +# One kind of such complex scenarios maybe continued testing +# when we want to run stress tests from many boxes with various +# lists of tests that will last very long time. And in such case +# we need some wrapper for MySQL server that will restart it in +# case of crashes. +# +# * It should be possible to run stress script in ad-hoc mode from +# shell or perl versions of mysql-test-run. This allows developers +# to reproduce and debug errors that was found in continued stress +# testing +# +######################################################################## + +use Config; + +if (!defined($Config{useithreads})) +{ + die < {mtime => 0, data => []}, + initdb => {mtime => 0, data => []}); + +# Error codes and sub-strings with corresponding severity +# +# S1 - Critical errors - cause immediately abort of testing. These errors +# could be caused by server crash or impossibility +# of test execution +# +# S2 - Serious errors - these errors are bugs for sure as it knowns that +# they shouldn't appear during stress testing +# +# S3 - Non-seriuos errros - these errors could be caused by fact that +# we execute simultaneously statements that +# affect tests executed by other threads + +%error_strings = ( 'Failed in mysql_real_connect()' => S1, + 'not found (Errcode: 2)' => S1 ); + +%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2, + 1027 => S2, 1037 => S2, 1038 => S2, + 1039 => S2, 1040 => S2, 1046 => S2, + 1180 => S2, 1181 => S2, 1203 => S2, + 1205 => S2, 1206 => S2, 1207 => S2, + 1223 => S2, 2013 => S1); + +share(%test_counters); +%test_counters=( loop_count => 0, test_count=>0); + +share($exiting); +$exiting=0; + +share($test_counters_lock); +$test_counters_lock=0; +share($log_file_lock); +$log_file_lock=0; + +$SIG{INT}= \&sig_INT_handler; +$SIG{TERM}= \&sig_TERM_handler; + + +GetOptions("server-host=s", "server-logs-dir=s", "server-port=s", + "server-socket=s", "server-user=s", "server-password=s", + "server-database=s", + "stress-suite-basedir=s", "suite=s", "stress-init-file:s", + "stress-tests-file:s", "stress-basedir=s", "stress-mode=s", + "stress-datadir=s", + "threads=s", "sleep-time=s", "loop-count=i", "test-count=i", + "test-duration=i", "test-suffix=s", "check-tests-file", + "verbose", "log-error-details", "cleanup", "mysqltest=s", + "abort-on-error", "help") || usage(); + +usage() if ($opt_help); + +#$opt_abort_on_error=1; + +$test_dirname=get_timestamp(); +$test_dirname.="-$opt_test_suffix" if ($opt_test_suffix ne ''); + +print <rel2abs($opt_stress_basedir); +$opt_stress_suite_basedir=File::Spec->rel2abs($opt_stress_suite_basedir); +$opt_server_logs_dir=File::Spec->rel2abs($opt_server_logs_dir); + +if ($opt_stress_datadir ne '') +{ + $opt_stress_datadir=File::Spec->rel2abs($opt_stress_datadir); +} + +if (! -d "$opt_stress_basedir") +{ + die <catdir($opt_server_logs_dir, $test_dirname), 0, 0755); + #Define filename of global session log file + $stress_log_file=File::Spec->catfile($opt_server_logs_dir, $test_dirname, + "mysql-stress-test.log"); +} + +if ($opt_suite ne '' && $opt_suite ne 'main' && $opt_suite ne 'default') +{ + $test_suite_dir=File::Spec->catdir($opt_stress_suite_basedir, "suite", $opt_suite); +} +else +{ + $test_suite_dir= $opt_stress_suite_basedir; +} + +if (!-d $test_suite_dir) +{ + die <catdir($test_suite_dir,'t'); +$test_suite_r_path=File::Spec->catdir($test_suite_dir,'r'); + +foreach my $suite_dir ($test_suite_t_path, $test_suite_r_path) +{ + if (!-d $suite_dir) + { + die <catdir($opt_stress_basedir,'t'); +$test_r_path=File::Spec->catdir($opt_stress_basedir,'r'); + +foreach $test_dir ($test_t_path, $test_r_path) +{ + if (-d $test_dir) + { + if ($opt_cleanup) + { + #Delete existing 't', 'r', 'r/*' subfolders in $stress_basedir + rmtree("$test_dir", 0, 0); + print "Cleanup $test_dir\n"; + } + else + { + die <{filename}= File::Spec->catfile($opt_stress_suite_basedir, + "testslist_client.txt"); + } + else + { + $tests_files{client}->{filename}= $opt_stress_tests_file; + } + + if (!-f $tests_files{client}->{filename}) + { + die <{filename}' with list of tests not exists. +Please ensure that this file exists, readable or specify another one with +--stress-tests-file option. + +EOF + } +} + +if (defined($opt_stress_init_file)) +{ + if ($opt_stress_init_file eq '') + { + #Default location of file with set of tests for current test run + $tests_files{initdb}->{filename}= File::Spec->catfile($opt_stress_suite_basedir, + "testslist_initdb.txt"); + } + else + { + $tests_files{initdb}->{filename}= $opt_stress_init_file; + } + + if (!-f $tests_files{initdb}->{filename}) + { + die <{filename}' with list of tests for initialization of database +for stress test not exists. +Please ensure that this file exists, readable or specify another one with +--stress-init-file option. + +EOF + } +} + +if ($opt_stress_mode !~ /^(random|seq)$/) +{ + die <); + close(TEST); + print "FOUND MYSQLTEST BINARY: ", $mysqltest_version,"\n"; +} +else +{ + die <\©_test_files, bydepth=>1}, "$test_suite_t_path"); + print "Done\n"; + + #$test_r_path/r0 dir reserved for initdb + $count_start= defined($opt_stress_init_file) ? 0 : 1; + + our $r_folder=''; + print "\nCreating 'r' folder and copying Protocol files to each 'r#' sub-folder..."; + for($count=$count_start; $count <= $opt_threads; $count++) + { + $r_folder = File::Spec->catdir($test_r_path, "r".$count); + mkpath("$r_folder", 0, 0777); + + find(\©_result_files,"$test_suite_r_path"); + } + print "Done\n\n"; +} + +if (defined($opt_stress_init_file)) +{ + print < 1, test_count => undef); + + #Read list of tests from $opt_stress_init_file + read_tests_names($tests_files{initdb}); + test_loop($client_ip, 0, 'seq', $tests_files{initdb}); + #print Dumper($tests_files{initdb}),"\n"; + print <{filename} file. + +EOF +} + +if (defined($opt_stress_tests_file)) +{ + print < 0, test_count=>0); + %limits=(loop_count => $opt_loop_count, test_count => $opt_test_count); + + if (($opt_loop_count && $opt_threads > $opt_loop_count) || + ($opt_test_count && $opt_threads > $opt_test_count)) + { + warn <create("test_loop", $client_ip, $id, + $opt_stress_mode, $tests_files{client}); + + print "main: Thread ID $id TID ",$thrd[$id]->tid," started\n"; + select(undef, undef, undef, 0.5); + } + + if ($opt_test_duration) + { + sleep($opt_test_duration); + kill INT, $$; #Interrupt child threads + } + + #Let other threads to process INT signal + sleep(1); + + for ($id=1; $id<=$opt_threads;$id++) + { + if (defined($thrd[$id])) + { + $thrd[$id]->join(); + } + } + print "EXIT\n"; +} + +sub test_init +{ + my ($env)=@_; + + $env->{session_id}=$env->{ip}."_".$env->{thread_id}; + $env->{r_folder}='r'.$env->{thread_id}; + $env->{screen_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname, + "screen_logs", $env->{session_id}); + $env->{reject_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname, + "reject_logs", $env->{session_id}); + + mkpath($env->{screen_logs}, 0, 0755) unless (-d $env->{screen_logs}); + mkpath($env->{reject_logs}, 0, 0755) unless (-d $env->{reject_logs}); + + $env->{session_log}= File::Spec->catfile($env->{screen_logs}, $env->{session_id}.".log"); +} + +sub test_execute +{ + my $env= shift; + my $test_name= shift; + + my $g_start= ""; + my $g_end= ""; + my $mysqltest_cmd= ""; + my @mysqltest_test_args=(); + my @stderr=(); + + #Get time stamp + $g_start = get_timestamp(); + $env->{errors}={}; + @{$env->{test_status}}=(); + + my $test_file= $test_name.".test"; + my $result_file= $test_name.".result"; + my $reject_file = $test_name.'.reject'; + my $output_file = $env->{session_id}.'_'.$test_name.'_'.$g_start."_".$env->{test_count}.'.txt'; + + my $test_filename = File::Spec->catfile($test_t_path, $test_file); + my $result_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $result_file); + my $reject_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $reject_file); + my $output_filename = File::Spec->catfile($env->{screen_logs}, $output_file); + + + push @mysqltest_test_args, "--basedir=$opt_stress_suite_basedir/", + "--tmpdir=$opt_stress_basedir", + "-x $test_filename", + "-R $result_filename", + "2>$output_filename"; + + $cmd= "$opt_mysqltest --no-defaults ".join(" ", @mysqltest_args)." ". + join(" ", @mysqltest_test_args); + + system($cmd); + + $exit_value = $? >> 8; + $signal_num = $? & 127; + $dumped_core = $? & 128; + + my $tid= threads->self->tid; + + if (-s $output_filename > 0) + { + #Read stderr for further analysis + open (STDERR_LOG, $output_filename) or + warn "Can't open file $output_filename"; + @stderr=; + close(STDERR_LOG); + + if ($opt_verbose) + { + $session_debug_file="$opt_stress_basedir/error$tid.txt"; + + stress_log($session_debug_file, + "Something wrong happened during execution of this command line:"); + stress_log($session_debug_file, "MYSQLTEST CMD - $cmd"); + stress_log($session_debug_file, "STDERR:".join("",@stderr)); + + stress_log($session_debug_file, "EXIT STATUS:\n1. EXIT: $exit_value \n". + "2. SIGNAL: $signal_num\n". + "3. CORE: $dumped_core\n"); + } + } + + #If something wrong trying to analyse stderr + if ($exit_value || $signal_num) + { + if (@stderr) + { + foreach my $line (@stderr) + { + #FIXME: we should handle case when for one sub-string/code + # we have several different error messages + # Now for both codes/substrings we assume that + # first found message will represent error + + #Check line for error codes + if (($err_msg, $err_code)= $line=~/failed: ((\d+):.+?$)/) + { + if (!exists($error_codes{$err_code})) + { + $severity="S3"; + $err_code=0; + } + else + { + $severity=$error_codes{$err_code}; + } + + if (!exists($env->{errors}->{$severity}->{$err_code})) + { + $env->{errors}->{$severity}->{$err_code}=[0, $err_msg]; + } + $env->{errors}->{$severity}->{$err_code}->[0]++; + $env->{errors}->{$severity}->{total}++; + } + + #Check line for error patterns + foreach $err_string (keys %error_strings) + { + $pattern= quotemeta $err_string; + if ($line =~ /$pattern/i) + { + my $severity= $error_strings{$err_string}; + if (!exists($env->{errors}->{$severity}->{$err_string})) + { + $env->{errors}->{$severity}->{$err_string}=[0, $line]; + } + $env->{errors}->{$severity}->{$err_string}->[0]++; + $env->{errors}->{$severity}->{total}++; + } + } + } + } + else + { + $env->{errors}->{S3}->{'Unknown error'}= + [1,"Unknown error. Nothing was output to STDERR"]; + $env->{errors}->{S3}->{total}=1; + } + } + + # + #FIXME: Here we can perform further analysis of recognized + # error codes + # + + foreach my $severity (sort {$a cmp $b} keys %{$env->{errors}}) + { + my $total=$env->{errors}->{$severity}->{total}; + if ($total) + { + push @{$env->{test_status}}, "Severity $severity: $total"; + $env->{errors}->{total}=+$total; + } + } + + #FIXME: Should we take into account $exit_value here? + # Now we assume that all stringified errors(i.e. errors without + # error codes) which are not exist in %error_string structure + # are OK + if (!$env->{errors}->{total}) + { + push @{$env->{test_status}},"No Errors. Test Passed OK"; + } + + log_session_errors($env, $test_file); + + if (!$exiting && ($signal_num == 2 || $signal_num == 15 || + ($opt_abort_on_error && $env->{errors}->{S1} > 0))) + { + #mysqltest was interrupted with INT or TERM signals or test was + #ran with --abort-on-error option and we got errors with severity S1 + #so we assume that we should cancel testing and exit + $exiting=1; + print STDERR<{reject_logs}, $reject_filename, $reject_file); + } + + if (-e $output_filename) + { + move_to_logs($env->{screen_logs}, $output_filename, $output_file); + } + +} + +sub test_loop +{ + my %client_env=(); + my $test_name=""; + + # KEY for session identification: IP-THREAD_ID + $client_env{ip} = shift; + $client_env{thread_id} = shift; + + $client_env{mode} = shift; + $client_env{tests_file}=shift; + + $client_env{test_seq_idx}=0; + + #Initialize session variables + test_init(\%client_env); + +LOOP: + + while(!$exiting) + { + if ($opt_check_tests_file) + { + #Check if tests_file was modified and reread it in this case + read_tests_names($client_env{tests_file}, 0); + } + + { + lock($test_counters_lock); + + if (($limits{loop_count} && $limits{loop_count} <= $test_counters{loop_count}*1) || + ($limits{test_count} && $limits{test_count} <= $test_counters{test_count}*1) ) + { + $exiting=1; + next LOOP; + } + } + + #Get random file name + if (($test_name = get_test(\%client_env)) ne '') + { + { + lock($test_counters_lock); + + #Save current counters values + $client_env{loop_count}=$test_counters{loop_count}; + $client_env{test_count}=$test_counters{test_count}; + } + #Run test and analyze results + test_execute(\%client_env, $test_name); + + print "test_loop[".$limits{loop_count}.":". + $limits{test_count}." ". + $client_env{loop_count}.":". + $client_env{test_count}."]:". + " TID ".$client_env{thread_id}. + " test: '$test_name' ". + " Errors: ".join(" ",@{$client_env{test_status}}),"\n"; + print "\n"; + } + + sleep($opt_sleep_time) if($opt_sleep_time); + + } +} + +sub move_to_logs ($$$) +{ + my $path_to_logs = shift; + my $src_file = shift; + my $random_filename = shift; + + my $dst_file = File::Spec->catfile($path_to_logs, $random_filename); + + move ($src_file, $dst_file) or warn<catfile($test_t_path, $test_filename); + + copy($src_file, $dst_file) or die "ERROR: copy_test_files: File cannot be copied. $!"; + } + } +} + +sub copy_result_files () +{ + if (/\.result$/) + { + $src_file = $File::Find::name; + + if ($File::Find::topdir eq $File::Find::dir && $src_file !~ /SCCS/) + { + $result_filename = basename($src_file) ; + $dst_file = File::Spec->catfile($r_folder, $result_filename); + + copy($src_file, $dst_file) or die "ERROR: copy_result_files: File cannot be copied. $!"; + } + } +} + +sub get_timestamp +{ + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst) = localtime(); + + return sprintf("%04d%02d%02d%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec); +} + +sub read_tests_names +{ + my $tests_file = shift; + my $force_load = shift; + + if ($force_load || ( (stat($tests_file->{filename}))[9] != $tests_file->{mtime}) ) + { + open (TEST, $tests_file->{filename}) || die ("Could not open file <". + $tests_file->{filename}."> $!"); + @{$tests_file->{data}}= grep {!/^[#\r\n]|^$/} map { s/[\r\n]//g; $_ } ; + + close (TEST); + $tests_file->{mtime}=(stat(_))[9]; + } +} + +sub get_random_test +{ + my $envt=shift; + my $tests= $envt->{tests_file}->{data}; + + my $random = int(rand(@{$tests})); + my $test = $tests->[$random]; + + return $test; +} + +sub get_next_test +{ + my $envt=shift; + my $test; + + if (@{$envt->{tests_file}->{data}}) + { + $test=${$envt->{tests_file}->{data}}[$envt->{test_seq_idx}]; + $envt->{test_seq_idx}++; + } + + #If we reach bound of array, reset seq index and increment loop counter + if ($envt->{test_seq_idx} == scalar(@{$envt->{tests_file}->{data}})) + { + $envt->{test_seq_idx}=0; + { + lock($test_counters_lock); + $test_counters{loop_count}++; + } + } + + return $test; +} + +sub get_test +{ + my $envt=shift; + + { + lock($test_counters_lock); + $test_counters{test_count}++; + } + + if ($envt->{mode} eq 'seq') + { + return get_next_test($envt); + } + elsif ($envt->{mode} eq 'random') + { + return get_random_test($envt); + } +} + +sub stress_log +{ + my ($log_file, $line)=@_; + + { + open(SLOG,">>$log_file") or warn "Error during opening log file $log_file"; + print SLOG $line,"\n"; + close(SLOG); + } +} + +sub log_session_errors +{ + my ($env, $test_name) = @_; + my $line=''; + + { + lock ($log_file_lock); + + #header in the begining of log file + if (!-e $stress_log_file) + { + stress_log($stress_log_file, + "TestID TID Suite TestFileName Found Errors"); + stress_log($stress_log_file, + "======================================================="); + } + + $line=sprintf('%6d %3d %10s %20s %s', $env->{test_count}, threads->self->tid, + $opt_suite, $test_name, + join(",", @{$env->{test_status}})); + + stress_log($stress_log_file, $line); + #stress_log_with_lock($stress_log_file, "\n"); + + if ($opt_log_error_details) + { + foreach $severity (sort {$a cmp $b} keys %{$env->{errors}}) + { + stress_log($stress_log_file, ""); + foreach $error (keys %{$env->{errors}->{$severity}}) + { + if ($error ne 'total') + { + stress_log($stress_log_file, "$severity: Count:". + $env->{errors}->{$severity}->{$error}->[0]. + " Error:". $env->{errors}->{$severity}->{$error}->[1]); + } + } + } + } + } +} + +sub sig_INT_handler +{ + $SIG{INT}= \&sig_INT_handler; + $exiting=1; + print STDERR "$$: Got INT signal-------------------------------------------\n"; + +} + +sub sig_TERM_handler +{ + $SIG{TERM}= \&sig_TERM_handler; + $exiting=1; + print STDERR "$$: Got TERM signal\n"; +} + +sub usage +{ + print < --stress-suite-basedir= --server-logs-dir= + +--server-host +--server-port +--server-socket +--server-user +--server-password +--server-logs-dir + Directory where all clients session logs will be stored. Usually + this is shared directory associated with server that used + in testing + + Required option. + +--stress-suite-basedir= + Directory that has r/ t/ subfolders with test/result files + which will be used for testing. Also by default we are looking + in this directory for 'stress-tests.txt' file which contains + list of tests. It is possible to specify other location of this + file with --stress-tests-file option. + + Required option. + +--stress-basedir= + Working directory for this test run. This directory will be used + as temporary location for results tracking during testing + + Required option. + +--stress-datadir= + Location of data files used which will be used in testing. + By default we search for these files in /data where dir + is value of --stress-suite-basedir option. + +--stress-init-file[=/path/to/file with tests for initialization of stress db] + Using of this option allows to perform initialization of database + by execution of test files. List of tests will be taken either from + specified file or if it omited from default file 'stress-init.txt' + located in <--stress-suite-basedir/--suite> dir + +--stress-tests-file[=/path/to/file with tests] + Using of this option allows to run stress test itself. Tests for testing + will be taken either from specified file or if it omited from default + file 'stress-tests.txt' located in <--stress-suite-basedir/--suite> dir + +--stress-mode= [random|seq] + There are two possible modes which affect order of selecting tests + from the list: + - in random mode tests will be selected in random order + - in seq mode each thread will execute tests in the loop one by one as + they specified in the list file. + +--sleep-time=