From 1b99948246e35c8d2b25591dcdd8277bb2db3d07 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 01:15:56 +0300 Subject: [PATCH 01/10] Removed duplicated and wrong merged code sql/sql_base.cc: Fixed wrong comment --- sql/sql_base.cc | 2 +- sql/sql_parse.cc | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 98ea4e0adf3..e3c0efb83b8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1714,7 +1714,7 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables) SYNOPSIS open_normal_and_derived_tables thd - thread handler - tables - list of tables for open&locking + tables - list of tables for open RETURN FALSE - ok diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e01ec3d483b..1ee80eea4a9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2517,11 +2517,6 @@ mysql_execute_command(THD *thd) */ start_waiting_global_read_lock(thd); - // put tables back for PS rexecuting - tables= lex->link_first_table_back(tables, create_table, - create_table_local); - break; - unsent_create_error: // put tables back for PS rexecuting tables= lex->link_first_table_back(tables, create_table, @@ -3694,14 +3689,6 @@ error: thd->lock= 0; } DBUG_VOID_RETURN; - - error1: - /* - Release the protection against the global read lock and wake - everyone, who might want to set a global read lock. - */ - start_waiting_global_read_lock(thd); - DBUG_VOID_RETURN; } From 74dd6421777f2046b8e5067f8c918d1f29e9f339 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 11:16:37 +0200 Subject: [PATCH 02/10] sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform sql/sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/sql_repl.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 499e3cdd4f5..185f84cc772 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -110,6 +110,7 @@ mwagner@here.mwagner.org mwagner@ultrafly.mysql.com mwagner@work.mysql.com mysqldev@build.mysql2.com +ndbdev@dl145b.mysql.com nick@mysql.com nick@nick.leippe.com patg@krsna.patg.net diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 9485031c144..ed2d477fc5d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -84,7 +84,7 @@ static int send_file(THD *thd) char fname[FN_REFLEN+1]; const char *errmsg = 0; int old_timeout; - uint packet_len; + unsigned long packet_len; char buf[IO_SIZE]; // It's safe to alloc this DBUG_ENTER("send_file"); From 78fc41727e17807668ab87c41060abf59a6cc2ee Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 15:05:18 +0200 Subject: [PATCH 03/10] *don't* mess with kernel defines, boy. and HAVE_ATOMIC_ADD/HAVE_ATOMIC_SUB is tested in configure --- include/my_global.h | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index 0d6f52a3376..f24bcd528ca 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -203,18 +203,6 @@ C_MODE_END #define BAD_MEMCPY #endif -/* In Linux-alpha we have atomic.h if we are using gcc */ -#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD) -#define HAVE_ATOMIC_ADD -#define HAVE_ATOMIC_SUB -#endif - -/* In Linux-ia64 including atomic.h will give us an error */ -#if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD) -#undef HAVE_ATOMIC_ADD -#undef HAVE_ATOMIC_SUB -#endif - #if defined(_lint) && !defined(lint) #define lint #endif @@ -276,16 +264,17 @@ C_MODE_END #include #endif #ifdef HAVE_ATOMIC_ADD -#define __SMP__ -#ifdef HAVE_LINUX_CONFIG_H -#include /* May define CONFIG_SMP */ -#endif -#ifndef CONFIG_SMP -#define CONFIG_SMP +#if defined(__ia64__) +#define new my_arg_new +#define need_to_restore_new 1 #endif C_MODE_START #include C_MODE_END +#ifdef need_to_restore_new /* probably safer than #ifdef new */ +#undef new +#undef need_to_restore_new +#endif #endif #include /* Recommended by debian */ /* We need the following to go around a problem with openssl on solaris */ From 7509b50054bbcb6d703f6ce41972d1533614b221 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 21:08:45 +0200 Subject: [PATCH 04/10] after merge fixes --- mysql-test/r/create.result | 14 +++++++++++--- mysql-test/t/create.test | 7 +++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 103bed598ef..a4f5cc517b3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -497,9 +497,9 @@ drop database mysqltest; select database(); database() NULL -select database(); -database() -NULL +select database(), user(); +database() user() +NULL mysqltest_1@localhost use test; create table t1 (a int, index `primary` (a)); ERROR 42000: Incorrect index name 'primary' @@ -563,3 +563,11 @@ select * from t2; b 1 drop table t1,t2; +create table t1 (a int); +create table t1 select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +create table t2 union = (t1) select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +flush tables with read lock; +unlock tables; +drop table t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 2ba726f29e2..4644d3db5c5 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -403,8 +403,11 @@ drop database mysqltest; select database(); # Connect without a database -connect (user4,localhost,mysqltest_1,,*NO-ONE*); -select database(); +connect (user1,localhost,mysqltest_1,,*NO-ONE*); +connection user1; +select database(), user(); +connection default; +disconnect user1; # # Test for Bug 856 'Naming a key "Primary" causes trouble' From 72dd44b9dede604b0ffc9acb2458ffde405212af Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 23:46:03 +0300 Subject: [PATCH 05/10] Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called in FIELD() functions Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable mysql-test/r/func_gconcat.result: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/r/innodb.result: Moved test here form func_gconcat mysql-test/r/olap.result: New test results after optimization mysql-test/t/func_gconcat.test: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/t/innodb.test: Moved test here form func_gconcat sql/field.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_berkeley.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_blackhole.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_heap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_innodb.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_ndbcluster.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/handler.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/hash_filo.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_cmpfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_func.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called sql/item_geofunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_strfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_subselect.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_sum.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_timefunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_uniq.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/log_event.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/mysql_priv.h: Change key_map_full to not be const as we are giving it a proper value on startup sql/mysqld.cc: Move key_map variables here and initialize key_map_full properly sql/opt_range.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/opt_range.h: Fix that test_quick_select() works with any ammount of keys sql/procedure.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol_cursor.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/set_var.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_analyse.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_class.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_crypt.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_insert.cc: Fixed that max_rows is ulong sql/sql_list.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_map.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_olap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_select.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Fixed that ROLLUP don't have to always create a temporary table Added new argument to remove_const() to make above possible Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP sql/sql_string.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_table.cc: Simple optimizations Fixed wrong checking of build_table_path() in undef-ed code sql/sql_udf.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_yacc.yy: removed extra {} --- mysql-test/r/func_gconcat.result | 37 ++++++------- mysql-test/r/innodb.result | 12 +++++ mysql-test/r/olap.result | 2 +- mysql-test/t/func_gconcat.test | 27 +++------- mysql-test/t/innodb.test | 15 ++++++ sql/field.cc | 5 +- sql/ha_berkeley.cc | 5 +- sql/ha_blackhole.cc | 9 ++-- sql/ha_heap.cc | 5 +- sql/ha_innodb.cc | 5 +- sql/ha_isam.cc | 10 ++-- sql/ha_isammrg.cc | 5 +- sql/ha_myisam.cc | 5 +- sql/ha_myisammrg.cc | 5 +- sql/ha_ndbcluster.cc | 9 ++-- sql/handler.cc | 5 +- sql/hash_filo.cc | 5 +- sql/item.cc | 5 +- sql/item_cmpfunc.cc | 5 +- sql/item_func.cc | 16 +++--- sql/item_geofunc.cc | 5 +- sql/item_strfunc.cc | 5 +- sql/item_subselect.cc | 5 +- sql/item_sum.cc | 5 +- sql/item_timefunc.cc | 5 +- sql/item_uniq.cc | 9 ++-- sql/log_event.cc | 4 +- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 4 ++ sql/opt_range.cc | 5 +- sql/opt_range.h | 8 ++- sql/procedure.cc | 5 +- sql/protocol.cc | 5 +- sql/protocol_cursor.cc | 5 +- sql/set_var.cc | 5 +- sql/sql_analyse.cc | 5 +- sql/sql_class.cc | 5 +- sql/sql_crypt.cc | 5 +- sql/sql_insert.cc | 8 +-- sql/sql_list.cc | 5 +- sql/sql_map.cc | 5 +- sql/sql_olap.cc | 5 +- sql/sql_select.cc | 90 ++++++++++++++++++++------------ sql/sql_string.cc | 2 - sql/sql_table.cc | 8 +-- sql/sql_udf.cc | 9 ++-- sql/sql_yacc.yy | 1 - 47 files changed, 180 insertions(+), 237 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 057822839fa..7a256edc91a 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -343,18 +343,6 @@ GROUP_CONCAT(b ORDER BY b) First Row Second Row DROP TABLE t1; -CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1),(2),(3); -CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), -CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); -SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; -a_id b_list -1 1,2,3 -2 4,5 -3 NULL -DROP TABLE t2; -DROP TABLE t1; CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID)); INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ'); CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC)); @@ -462,15 +450,28 @@ SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; gc NULL DROP TABLE t1; -create table r2 (a int, b int); -insert into r2 values (1,1), (2,2); -select b x, (select group_concat(x) from r2) from r2; -x (select group_concat(x) from r2) +create table t2 (a int, b int); +insert into t2 values (1,1), (2,2); +select b x, (select group_concat(x) from t2) from t2; +x (select group_concat(x) from t2) 1 1,1 2 2,2 -drop table r2; -create table t1 (d int, a int, b int, c int); +drop table t2; +create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int); insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select d,a,b from t1 order by a; +d a b +1 1 3 +2 1 4 +3 1 2 +5 1 1 +6 1 2 +4 2 7 +7 2 3 +8 2 3 +explain select a, group_concat(b) from t1 group by a with rollup; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort select a, group_concat(b) from t1 group by a with rollup; a group_concat(b) 1 3,4,2,1,2 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 4c983014d4b..3d7e99fa7bc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1647,3 +1647,15 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); ERROR HY000: The used table type doesn't support FULLTEXT indexes DROP TABLE t1; +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), +CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +a_id b_list +1 1,2,3 +2 4,5 +3 NULL +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index ab84fa5739a..0c6c4684853 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -83,7 +83,7 @@ TV NULL NULL 600 NULL NULL NULL 7785 explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort +1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort Warnings: Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 485e8ba143c..5f02db7707c 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -213,21 +213,6 @@ INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row'); SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a; DROP TABLE t1; -# -# check null values #1 -# - ---disable_warnings -CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1),(2),(3); -CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), - CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---enable_warnings -INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); -SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; -DROP TABLE t2; -DROP TABLE t1; - # # check null values #2 # @@ -288,17 +273,19 @@ DROP TABLE t1; # # Bug #8656: Crash with group_concat on alias in outer table # -create table r2 (a int, b int); -insert into r2 values (1,1), (2,2); -select b x, (select group_concat(x) from r2) from r2; -drop table r2; +create table t2 (a int, b int); +insert into t2 values (1,1), (2,2); +select b x, (select group_concat(x) from t2) from t2; +drop table t2; # # Bug #7405: problems with rollup # -create table t1 (d int, a int, b int, c int); +create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int); insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select d,a,b from t1 order by a; +explain select a, group_concat(b) from t1 group by a with rollup; select a, group_concat(b) from t1 group by a with rollup; select a, group_concat(distinct b) from t1 group by a with rollup; select a, group_concat(b order by b) from t1 group by a with rollup; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 201489c0ddb..1ce95811fc3 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1187,3 +1187,18 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; --error 1214; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); DROP TABLE t1; + +# +# check null values #1 +# + +--disable_warnings +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), + CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +--enable_warnings +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +DROP TABLE t2; +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 21c3fe12bb2..292bbe80362 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,13 +19,10 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index d4adea4a7b4..35a137df97b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,13 +47,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index a5456d54c1b..109098948ac 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ef0d0022860..ad0e8819842 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b3b82df5469..2016f58083a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,13 +28,10 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b755c63698f..b074edf719d 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index 7e14ccb43bf..f6fe1a49e9e 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index b4ac8cc777f..34e6c429a8f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 3374ee1271a..1f9e6a71d16 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 516703112dd..d361bec8fcc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,13 +20,10 @@ NDB Cluster */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_NDBCLUSTER_DB #include diff --git a/sql/handler.cc b/sql/handler.cc index d47bb02a58c..d9db1afff7a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,13 +17,10 @@ /* Handler-calling-functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index 34f3cd6b035..a16ff6ac7be 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,11 +20,8 @@ ** to usage. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index d32a6581049..96fa1a8fac4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f53dcb43e5c..b17c4a9fbf7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,13 +17,10 @@ /* This file defines all compare functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index ad8479c7b0b..2d16ef5e183 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,13 +17,10 @@ /* This file defines all numerical functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include @@ -1491,9 +1488,6 @@ longlong Item_func_field::val_int() { DBUG_ASSERT(fixed == 1); - if (args[0]->null_value) - return 0; - if (cmp_type == STRING_RESULT) { String *field; @@ -1509,18 +1503,22 @@ longlong Item_func_field::val_int() else if (cmp_type == INT_RESULT) { longlong val= args[0]->val_int(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val_int()) + if (val == args[i]->val_int() && !args[i]->null_value) return (longlong) (i); } } else { double val= args[0]->val(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val()) + if (val == args[i]->val() && !args[i]->null_value) return (longlong) (i); } } diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index e907c5a0d45..9dbc1724824 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,14 +17,11 @@ /* This file defines all spatial functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 725712f4e85..56b06cb02c4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,13 +20,10 @@ ** (This shouldn't be needed) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f7defd96b04..9bd9eff5ef7 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,13 +22,10 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9c35fb1d427..5c34dc6a603 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,14 +17,11 @@ /* Sum functions (COUNT, MIN...) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 9f5cd61f95a..b7f9236ce46 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,13 +17,10 @@ /* This file defines all time functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index c83373bd8b0..8e9653aba88 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,10 +16,7 @@ /* Compability file */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif diff --git a/sql/log_event.cc b/sql/log_event.cc index 9701ef2ff00..866a7c21bb4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,12 +17,10 @@ #ifndef MYSQL_CLIENT -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5b9e81620ce..0d058190a46 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -37,7 +37,7 @@ typedef ulong key_part_map; /* Used for finding key parts */ /* useful constants */ extern const key_map key_map_empty; -extern const key_map key_map_full; +extern key_map key_map_full; /* Should be threaded as const */ extern const char *primary_key_name; #include "mysql_com.h" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5e3142ccf0e..44b91fd3530 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -351,6 +351,9 @@ char mysql_real_data_home[FN_REFLEN], *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; +const key_map key_map_empty(0); +key_map key_map_full(0); // Will be initialized later + const char *opt_date_time_formats[3]; char *language_ptr, *default_collation_name, *default_character_set_name; @@ -5677,6 +5680,7 @@ static void mysql_init_variables(void) mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list)); bzero((gptr) &com_stat, sizeof(com_stat)); + key_map_full.set_all(); /* Character sets */ system_charset_info= &my_charset_utf8_general_ci; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7b37f0ce4f7..4b6e56468d2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,13 +23,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/opt_range.h b/sql/opt_range.h index b55bb4708bf..87e0315a09e 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -143,10 +143,14 @@ class SQL_SELECT :public Sql_alloc { ~SQL_SELECT(); void cleanup(); bool check_quick(THD *thd, bool force_quick_range, ha_rows limit) - { return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0; } + { + key_map tmp; + tmp.set_all(); + return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 0; + } inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; } int test_quick_select(THD *thd, key_map keys, table_map prev_tables, - ha_rows limit, bool force_quick_range=0); + ha_rows limit, bool force_quick_range); }; diff --git a/sql/procedure.cc b/sql/procedure.cc index 10689dd36f6..bd742f645d2 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,13 +17,10 @@ /* Procedures (functions with changes output of select) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 835bd986fb8..9a1a05591dd 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index 53a03001544..bb6a0eab2ee 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index 5564ba096ac..b89cdffd4cb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,13 +48,10 @@ new attribute. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 678bdbb4588..df66b3c4228 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,13 +23,10 @@ ** - type set is out of optimization yet */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ff45b164893..fff1e3a3b54 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,13 +22,10 @@ ** *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index eda7f0f6bbb..1cfa0eb8570 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,14 +23,11 @@ needs something like 'ssh'. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b4021943967..718e6b00ddc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -752,7 +752,7 @@ public: volatile bool status,dead; COPY_INFO info; I_List rows; - uint group_count; + ulong group_count; TABLE_LIST table_list; // Argument delayed_insert() @@ -1420,7 +1420,7 @@ static void free_delayed_insert_blobs(register TABLE *table) bool delayed_insert::handle_inserts(void) { int error; - uint max_rows; + ulong max_rows; bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(); delayed_row *row; DBUG_ENTER("handle_inserts"); @@ -1439,11 +1439,11 @@ bool delayed_insert::handle_inserts(void) } thd.proc_info="insert"; - max_rows=delayed_insert_limit; + max_rows= delayed_insert_limit; if (thd.killed || table->version != refresh_version) { thd.killed=1; - max_rows= ~(uint)0; // Do as much as possible + max_rows= ~(ulong)0; // Do as much as possible } /* diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 485c569f49c..219ff85946e 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,14 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 9baacd1bc4b..408938e7639 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index a365cbb0614..5631cf9dcef 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,13 +28,10 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9661c0c13c9..38e54ed7104 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,13 +17,10 @@ /* mysql_select and join optimization */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include @@ -35,9 +32,6 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "ref_or_null","unique_subquery","index_subquery" }; -const key_map key_map_empty(0); -const key_map key_map_full(~(uint)0); - static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array); static bool make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, DYNAMIC_ARRAY *keyuse); @@ -66,7 +60,7 @@ static bool only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables); static void update_depend_map(JOIN *join); static void update_depend_map(JOIN *join, ORDER *order); static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond, - bool *simple_order); + bool change_list, bool *simple_order); static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables, List &fields, bool send_row, uint select_options, const char *info, @@ -613,7 +607,7 @@ JOIN::optimize() /* Optimize distinct away if possible */ { ORDER *org_order= order; - order=remove_const(this, order,conds,&simple_order); + order=remove_const(this, order,conds,1, &simple_order); /* If we are using ORDER BY NULL or ORDER BY const_expression, return result in any order (even if we are using a GROUP BY) @@ -681,8 +675,9 @@ JOIN::optimize() DBUG_RETURN(1); } simple_group= 0; - if (rollup.state == ROLLUP::STATE_NONE) - group_list= remove_const(this, group_list, conds, &simple_group); + group_list= remove_const(this, group_list, conds, + rollup.state == ROLLUP::STATE_NONE, + &simple_group); if (!group_list && group) { order=0; // The output has only one row @@ -694,7 +689,7 @@ JOIN::optimize() if (procedure && procedure->group) { group_list= procedure->group= remove_const(this, procedure->group, conds, - &simple_group); + 1, &simple_group); calc_group_buffer(this, group_list); } @@ -1638,8 +1633,8 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select, { select->head=table; table->reginfo.impossible_range=0; - if ((error=select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, - limit)) == 1) + if ((error= select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, + limit, 0)) == 1) DBUG_RETURN(select->quick->records); if (error == -1) { @@ -3452,7 +3447,8 @@ make_simple_join(JOIN *join,TABLE *tmp_table) join_tab->select_cond=0; join_tab->quick=0; join_tab->type= JT_ALL; /* Map through all records */ - join_tab->keys.init(~(uint)0); /* test everything in quick */ + join_tab->keys.init(); + join_tab->keys.set_all(); /* test everything in quick */ join_tab->info=0; join_tab->on_expr=0; join_tab->ref.key = -1; @@ -3684,7 +3680,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt), 0) < 0) { /* Before reporting "Impossible WHERE" for the whole query @@ -3697,7 +3693,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt),0) < 0) DBUG_RETURN(1); // Impossible WHERE } else @@ -4200,20 +4196,39 @@ static void update_depend_map(JOIN *join, ORDER *order) /* - simple_order is set to 1 if sort_order only uses fields from head table - and the head table is not a LEFT JOIN table + Remove all constants and check if ORDER only contains simple expressions + + SYNOPSIS + remove_const() + join Join handler + first_order List of SORT or GROUP order + cond WHERE statement + change_list Set to 1 if we should remove things from list + If this is not set, then only simple_order is + calculated + simple_order Set to 1 if we are only using simple expressions + + RETURN + Returns new sort order + + simple_order is set to 1 if sort_order only uses fields from head table + and the head table is not a LEFT JOIN table + */ static ORDER * -remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) +remove_const(JOIN *join,ORDER *first_order, COND *cond, + bool change_list, bool *simple_order) { if (join->tables == join->const_tables) - return 0; // No need to sort - DBUG_ENTER("remove_const"); + return change_list ? 0 : first_order; // No need to sort + ORDER *order,**prev_ptr; table_map first_table= join->join_tab[join->const_tables].table->map; table_map not_const_tables= ~join->const_table_map; table_map ref; + DBUG_ENTER("remove_const"); + prev_ptr= &first_order; *simple_order= join->join_tab[join->const_tables].on_expr ? 0 : 1; @@ -4244,7 +4259,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } if ((ref=order_tables & (not_const_tables ^ first_table))) { - if (!(order_tables & first_table) && only_eq_ref_tables(join,first_order,ref)) + if (!(order_tables & first_table) && + only_eq_ref_tables(join,first_order, ref)) { DBUG_PRINT("info",("removing: %s", order->item[0]->full_name())); continue; @@ -4253,11 +4269,13 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } } } - *prev_ptr= order; // use this entry + if (change_list) + *prev_ptr= order; // use this entry prev_ptr= &order->next; } - *prev_ptr=0; - if (!first_order) // Nothing to sort/group + if (change_list) + *prev_ptr=0; + if (prev_ptr == &first_order) // Nothing to sort/group *simple_order=1; DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order)); DBUG_RETURN(first_order); @@ -6357,7 +6375,7 @@ test_if_quick_select(JOIN_TAB *tab) delete tab->select->quick; tab->select->quick=0; return tab->select->test_quick_select(tab->join->thd, tab->keys, - (table_map) 0, HA_POS_ERROR); + (table_map) 0, HA_POS_ERROR, 0); } @@ -7352,12 +7370,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, parameres are set correctly by the range optimizer. */ key_map new_ref_key_map; - new_ref_key_map.clear_all(); /* Force the creation of quick select */ - new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */ + new_ref_key_map.clear_all(); // Force the creation of quick select + new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key. if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0, - (tab->join->select_options & OPTION_FOUND_ROWS) ? - HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0) + (tab->join->select_options & + OPTION_FOUND_ROWS) ? + HA_POS_ERROR : + tab->join->unit->select_limit_cnt,0) <= + 0) DBUG_RETURN(0); } ref_key= new_ref_key; @@ -8902,6 +8923,8 @@ bool JOIN::make_sum_func_list(List &field_list, List &send_fields, for (uint i=0 ; i <= send_group_parts ;i++) sum_funcs_end[i]= func; } + else if (rollup.state == ROLLUP::STATE_READY) + DBUG_RETURN(FALSE); // Don't put end marker *func=0; // End marker DBUG_RETURN(FALSE); } @@ -9415,9 +9438,10 @@ bool JOIN::rollup_make_fields(List &fields_arg, List &sel_fields, This is an element that is used by the GROUP BY and should be set to NULL in this level */ + Item_null_result *null_item; item->maybe_null= 1; // Value will be null sometimes - Item_null_result *null_item= rollup.null_items[i]; - null_item->result_field= ((Item_field *) item)->result_field; + null_item= rollup.null_items[i]; + null_item->result_field= item->get_tmp_table_field(); item= null_item; break; } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index e5339782f02..983c2d90a1d 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -17,11 +17,9 @@ /* This file is originally from the mysql distribution. Coded by monty */ #include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - #include #include #include diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7e80a71beb0..3aa6da7ad0c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -325,7 +325,7 @@ int quick_rm_table(enum db_type base,const char *db, build_table_path(path, sizeof(path), db, table_name, reg_ext); if (my_delete(path,MYF(0))) error=1; /* purecov: inspected */ - build_table_path(path, sizeof(path), db, table_name, ""); + *fn_ext(path)= 0; // Remove reg_ext return ha_delete_table(base,path) || error; } @@ -1339,7 +1339,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, /* Check if table exists */ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { - char tmp_table_name[NAME_LEN+1]; + char tmp_table_name[tmp_file_prefix_length+22+22+22+3]; my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x", tmp_file_prefix, current_pid, thd->thread_id, thd->tmp_table++); @@ -2622,7 +2622,7 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List &keys) build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /* don't need to free((gptr) key_info_buffer);*/ @@ -2723,7 +2723,7 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list, build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /*don't need to free((gptr) key_numbers);*/ diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index deed806db2a..72c92a5c53a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,13 +28,10 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: implement sql_udf.h -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #include #ifdef HAVE_DLOPEN diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7585f0b10a0..bc21649fe54 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4064,7 +4064,6 @@ replace: } insert_field_spec {} - {} ; insert_lock_option: From 61c12aa299890bfbde8d8726c623c7af4eee5ec6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 07:15:11 +0200 Subject: [PATCH 06/10] after mergemerge --- mysql-test/r/create.result | 8 ++++++++ mysql-test/t/create.test | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index b9dda435b11..de3840447dc 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -563,6 +563,14 @@ select * from t2; b 1 drop table t1,t2; +create table t1 (a int); +create table t1 select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +create table t2 union = (t1) select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +flush tables with read lock; +unlock tables; +drop table t1; create table t1(column.name int); ERROR 42000: Incorrect table name 'column' create table t1(test.column.name int); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a08603f8efb..b73cd28c71c 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -408,12 +408,12 @@ connection user1; select database(), user(); connection default; disconnect user1; +use test; # # Test for Bug 856 'Naming a key "Primary" causes trouble' # -use test; --error 1280 create table t1 (a int, index `primary` (a)); --error 1280 @@ -470,8 +470,6 @@ drop table t1,t2; # This tests two additional possible errors and a hang if # an improper fix is present. # -connection default; -use test; create table t1 (a int); --error 1093 create table t1 select * from t1; From d6e0883b070cbb66a3dc94384816835964025aba Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 14:58:32 +0400 Subject: [PATCH 07/10] Fix show warnings limit 0 and show warnings limit 0, 0. Add test coverage for SHOW WARNINGS LIMIT a, b; mysql-test/r/warnings.result: Add test coverage for SHOW WARNINGS LIMIT a,b mysql-test/t/warnings.test: Add test coverage for SHOW WARNINGS LIMIT a,b sql/sql_error.cc: Fix show warnings limit 0 and show warnings limit 0, 0 --- mysql-test/r/warnings.result | 53 ++++++++++++++++++++++++++++++++++++ mysql-test/t/warnings.test | 22 +++++++++++++++ sql/sql_error.cc | 4 +-- 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index d1d96afa153..e97b309547a 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -179,3 +179,56 @@ drop table t1; set table_type=MYISAM; Warnings: Warning 1287 'table_type' is deprecated; use 'storage_engine' instead +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +update t1 set a='abc'; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 2, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 3 +show warnings limit 0, 10; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 9, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 10, 1; +Level Code Message +show warnings limit 9, 2; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 0, 0; +Level Code Message +show warnings limit 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +show warnings limit 0; +Level Code Message +show warnings limit 1, 0; +Level Code Message +select * from t1 limit 0; +a +select * from t1 limit 1, 0; +a +select * from t1 limit 0, 0; +a +drop table t1; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 2a90f5f637d..6a6d533ad61 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -133,3 +133,25 @@ drop table t1; # Test for deprecated table_type variable # set table_type=MYISAM; + +# +# Tests for show warnings limit a, b +# +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# should generate 10 warnings +update t1 set a='abc'; +show warnings limit 2, 1; +show warnings limit 0, 10; +show warnings limit 9, 1; +show warnings limit 10, 1; +show warnings limit 9, 2; +show warnings limit 0, 0; +show warnings limit 1; +show warnings limit 0; +show warnings limit 1, 0; +# make sure behaviour is consistent with select ... limit +select * from t1 limit 0; +select * from t1 limit 1, 0; +select * from t1 limit 0, 0; +drop table t1; diff --git a/sql/sql_error.cc b/sql/sql_error.cc index d19e9fbdb09..a31e15d0745 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -203,6 +203,8 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) offset--; continue; } + if (limit-- == 0) + break; protocol->prepare_for_resend(); protocol->store(warning_level_names[err->level], warning_level_length[err->level], system_charset_info); @@ -210,8 +212,6 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) protocol->store(err->msg, strlen(err->msg), system_charset_info); if (protocol->write()) DBUG_RETURN(1); - if (!--limit) - break; } send_eof(thd); DBUG_RETURN(0); From 062a1b8b4e09c6de8ab592d37567d40d13798875 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 19:38:52 +0200 Subject: [PATCH 08/10] a compiler must see '#pragma implementation' *before* '#pragma interface' (that comes with the #include'd header file) --- client/sql_string.cc | 3 +-- configure.in | 13 ++++++++++++- include/my_global.h | 9 ++------- mysys/raid.cc | 2 -- sql/examples/ha_archive.cc | 2 -- sql/examples/ha_example.cc | 2 -- sql/examples/ha_tina.cc | 2 -- sql/field.cc | 3 ++- sql/ha_berkeley.cc | 4 +++- sql/ha_blackhole.cc | 2 +- sql/ha_heap.cc | 3 ++- sql/ha_innodb.cc | 3 ++- sql/ha_isam.cc | 3 ++- sql/ha_isammrg.cc | 3 ++- sql/ha_myisam.cc | 3 ++- sql/ha_myisammrg.cc | 3 ++- sql/ha_ndbcluster.cc | 3 ++- sql/handler.cc | 3 ++- sql/hash_filo.cc | 3 ++- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 3 ++- sql/item_func.cc | 3 ++- sql/item_geofunc.cc | 2 +- sql/item_strfunc.cc | 3 ++- sql/item_subselect.cc | 3 ++- sql/item_sum.cc | 3 ++- sql/item_timefunc.cc | 3 ++- sql/item_uniq.cc | 3 ++- sql/log_event.cc | 3 ++- sql/opt_range.cc | 3 ++- sql/procedure.cc | 3 ++- sql/protocol.cc | 3 ++- sql/protocol_cursor.cc | 3 ++- sql/set_var.cc | 3 ++- sql/sql_analyse.cc | 3 ++- sql/sql_class.cc | 3 ++- sql/sql_crypt.cc | 3 ++- sql/sql_list.cc | 3 ++- sql/sql_map.cc | 3 ++- sql/sql_olap.cc | 3 ++- sql/sql_select.cc | 3 ++- sql/sql_string.cc | 3 ++- sql/sql_udf.cc | 3 ++- sql/tztime.cc | 3 +-- 44 files changed, 86 insertions(+), 56 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index 8f0e46c5eea..690997152f1 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,12 +16,11 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include #include #include #include diff --git a/configure.in b/configure.in index a5c2e7044fe..e685e811c2f 100644 --- a/configure.in +++ b/configure.in @@ -1837,12 +1837,23 @@ if test "$ac_cv_sizeof_off_t" -eq 0 then AC_MSG_ERROR("MySQL needs a off_t type.") fi + +# do we need #pragma interface/#pragma implementation ? +# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin +AC_MSG_CHECKING(the need for @%:@pragma interface/implementation) +# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't +# follow any standard), we'll use well-defined preprocessor macros: +AC_TRY_CPP([ +#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +#error USE_PRAGMA_IMPLEMENTATION +#endif +],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION") + # This always gives a warning. Ignore it unless you are cross compiling AC_C_BIGENDIAN #---START: Used in for client configure # Check base type of last arg to accept MYSQL_TYPE_ACCEPT - #---END: # Figure out what type of struct rlimit to use with setrlimit MYSQL_TYPE_STRUCT_RLIMIT diff --git a/include/my_global.h b/include/my_global.h index c978bf82b3a..523ecfba74d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -43,16 +43,11 @@ #define HAVE_ERRNO_AS_DEFINE #endif /* __CYGWIN__ */ -/* Determine when to use "#pragma interface" */ -#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ +#ifdef USE_PRAGMA_IMPLEMENTATION #define USE_PRAGMA_INTERFACE #endif -/* Determine when to use "#pragma implementation" */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) -#define USE_PRAGMA_IMPLEMENTATION -#endif - #if defined(i386) && !defined(__i386__) #define __i386__ #endif diff --git a/mysys/raid.cc b/mysys/raid.cc index 20e70d2d102..62587c438ca 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,8 +70,6 @@ tonu@mysql.com & monty@mysql.com */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index e58996d3c01..10712c2e3be 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -14,8 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 2592d307e37..31e4e97c5c7 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -63,8 +63,6 @@ -Brian */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 16e28e5ae85..07e69bfac80 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -38,8 +38,6 @@ TODO: -Brian */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index 292bbe80362..692f123097a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,10 +19,11 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 35a137df97b..33f7b6238b0 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,10 +47,12 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" + #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 109098948ac..5b1527aa210 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,11 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ad0e8819842..4fc0116a26a 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2016f58083a..3f2e11e8bd1 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,10 +28,11 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b074edf719d..afa7dffa5f4 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -14,10 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index f6fe1a49e9e..c0e6f665f08 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 34e6c429a8f..d8608c6a599 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 1f9e6a71d16..edb3521470f 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d361bec8fcc..a0080af1dfb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,11 +20,12 @@ NDB Cluster */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + #ifdef HAVE_NDBCLUSTER_DB #include #include "ha_ndbcluster.h" diff --git a/sql/handler.cc b/sql/handler.cc index d9db1afff7a..f14564b6629 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,10 +17,11 @@ /* Handler-calling-functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index a16ff6ac7be..ec200768222 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,8 +20,9 @@ ** to usage. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index 96fa1a8fac4..c96794ff482 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index b17c4a9fbf7..337ac949d35 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,10 +17,11 @@ /* This file defines all compare functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d16ef5e183..442ef15bba8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,10 +17,11 @@ /* This file defines all numerical functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 9dbc1724824..8b856d809d6 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,11 +17,11 @@ /* This file defines all spatial functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 56b06cb02c4..5ca5caf6bdf 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,10 +20,11 @@ ** (This shouldn't be needed) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9bd9eff5ef7..ebc08545566 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,10 +22,11 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 5c34dc6a603..0e252259f53 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,11 +17,12 @@ /* Sum functions (COUNT, MIN...) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b7f9236ce46..a3cf69035f3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,10 +17,11 @@ /* This file defines all time functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 8e9653aba88..7701bbbb63e 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,7 +16,8 @@ /* Compability file */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" diff --git a/sql/log_event.cc b/sql/log_event.cc index 866a7c21bb4..a4319f63b83 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,10 +17,11 @@ #ifndef MYSQL_CLIENT -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4b6e56468d2..bd1befb436f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,10 +23,11 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/procedure.cc b/sql/procedure.cc index bd742f645d2..a0042dd879e 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,10 +17,11 @@ /* Procedures (functions with changes output of select) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 9a1a05591dd..6a17ae2f95b 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index bb6a0eab2ee..b225e06ed32 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index b89cdffd4cb..0fa9932dbbc 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,10 +48,11 @@ new attribute. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index df66b3c4228..fb5d0eb0a3f 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,10 +23,11 @@ ** - type set is out of optimization yet */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fff1e3a3b54..805db107370 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,10 +22,11 @@ ** *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index 1cfa0eb8570..f21a109e95d 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,11 +23,12 @@ needs something like 'ssh'. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 219ff85946e..d57a7dfe4e3 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,11 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 408938e7639..aac44949d89 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 5631cf9dcef..024abb6c74b 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,10 +28,11 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 38e54ed7104..0424cd8fdbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,10 +17,11 @@ /* mysql_select and join optimization */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 983c2d90a1d..ab2db4aaf53 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,10 +16,11 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#include #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include #include #include #include diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 72c92a5c53a..0b84d1b5fb3 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,10 +28,11 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_DLOPEN diff --git a/sql/tztime.cc b/sql/tztime.cc index 30ff25f080f..b5ebc9f350a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -25,12 +25,11 @@ it creates unsolved link dependencies on some platforms. */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include #if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" #else From bfac85343fde7ad4ffbc0bd54d9f36053d574f69 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 20:10:47 +0200 Subject: [PATCH 09/10] mtr_misc.pl, mtr_report.pl: Try kill all children to the mysql-test-run process when exiting mtr_process.pl: Added new function mtr_exit() that try kill all children to the mysql-test-run process when exiting mysql-test-run.pl: Try kill all children to the mysql-test-run process when exiting New --vardir caused problems on Windows Changed faulty calls to error() to mtr_error() mysql-test/mysql-test-run.pl: Try kill all children to the mysql-test-run process when exiting New --vardir caused problems on Windows Changed faulty calls to error() to mtr_error() mysql-test/lib/mtr_report.pl: Try kill all children to the mysql-test-run process when exiting mysql-test/lib/mtr_process.pl: Added new function mtr_exit() that try kill all children to the mysql-test-run process when exiting mysql-test/lib/mtr_misc.pl: Try kill all children to the mysql-test-run process when exiting --- mysql-test/lib/mtr_misc.pl | 2 +- mysql-test/lib/mtr_process.pl | 14 ++++++++++++++ mysql-test/lib/mtr_report.pl | 3 ++- mysql-test/mysql-test-run.pl | 14 ++++++++------ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 5f80864d1f7..efa1b3bec21 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -25,7 +25,7 @@ sub mtr_full_hostname () { if ( $hostname !~ /\./ ) { my $address= gethostbyname($hostname) - or die "Couldn't resolve $hostname : $!"; + or mtr_error("Couldn't resolve $hostname : $!"); my $fullname= gethostbyaddr($address, AF_INET); $hostname= $fullname if $fullname; } diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 78758e54aa4..7bca422773c 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -17,6 +17,7 @@ sub mtr_spawn ($$$$$$); sub mtr_stop_mysqld_servers ($); sub mtr_kill_leftovers (); sub mtr_record_dead_children (); +sub mtr_exit ($); sub sleep_until_file_created ($$$); # static in C @@ -784,4 +785,17 @@ sub sleep_until_file_created ($$$) { } +############################################################################## +# +# When we exit, we kill off all children +# +############################################################################## + +sub mtr_exit ($) { + my $code= shift; + local $SIG{HUP} = 'IGNORE'; + kill('HUP', -$$); + exit($code); +} + 1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index cb41549422f..a258d139bb1 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -268,7 +268,8 @@ sub mtr_warning (@) { } sub mtr_error (@) { - die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + mtr_exit(1); } sub mtr_debug (@) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9d809593ea7..d4fb37c2f96 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -398,7 +398,7 @@ sub main () { } } - exit(0); + mtr_exit(0); } ############################################################################## @@ -568,7 +568,9 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/var"; } - if ( $opt_vardir !~ m,^/, ) + # We make the path absolute, as the server will do a chdir() before usage + unless ( $opt_vardir =~ m,^/, or + ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) ) { # Make absolute path, relative test dir $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; @@ -1295,9 +1297,9 @@ sub install_db ($$) { mtr_report("Installing \u$type Databases"); open(IN, $init_db_sql) - or error("Can't open $init_db_sql: $!"); + or mtr_error("Can't open $init_db_sql: $!"); open(OUT, ">", $init_db_sql_tmp) - or error("Can't write to $init_db_sql_tmp: $!"); + or mtr_error("Can't write to $init_db_sql_tmp: $!"); while () { chomp; @@ -1571,7 +1573,7 @@ sub report_failure_and_restart ($) { { stop_masters_slaves(); } - exit(1); + mtr_exit(1); } # FIXME always terminate on failure?! @@ -2270,5 +2272,5 @@ Options not yet described, or that I want to look into more with-openssl HERE - exit(1); + mtr_exit(1); } From 936b9319b8219daffab3bc6650a02801bf53c8bd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jun 2005 21:22:23 +0500 Subject: [PATCH 10/10] ctype_cp1250_ch.result, ctype_cp1250_ch.test: Adding test. ctype-win1250ch.c: Bug #9759 Empty result with 'LIKE' and cp1250_czech_cs Wrong min_sort_char fix. strings/ctype-win1250ch.c: Bug #9759 Empty result with 'LIKE' and cp1250_czech_cs Wrong min_sort_char fix. mysql-test/t/ctype_cp1250_ch.test: Adding test. mysql-test/r/ctype_cp1250_ch.result: Adding test. --- mysql-test/r/ctype_cp1250_ch.result | 12 ++++++++++++ mysql-test/t/ctype_cp1250_ch.test | 12 ++++++++++++ strings/ctype-win1250ch.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 62936b84caf..7b2ca7d7e0e 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -7,3 +7,15 @@ SELECT a, length(a), a='', a=' ', a=' ' FROM t1; a length(a) a='' a=' ' a=' ' 0 1 1 1 DROP TABLE t1; +CREATE TABLE t1 ( +popisek varchar(30) collate cp1250_general_ci NOT NULL default '', +PRIMARY KEY (`popisek`) +); +INSERT INTO t1 VALUES ('2005-01-1'); +SELECT * FROM t1 WHERE popisek = '2005-01-1'; +popisek +2005-01-1 +SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; +popisek +2005-01-1 +drop table t1; diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index 06aea7b9979..814da628fb7 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -10,3 +10,15 @@ CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs; INSERT INTO t1 VALUES (''); SELECT a, length(a), a='', a=' ', a=' ' FROM t1; DROP TABLE t1; + +# +# Bug#9759 Empty result with 'LIKE' and cp1250_czech_cs +# +CREATE TABLE t1 ( + popisek varchar(30) collate cp1250_general_ci NOT NULL default '', + PRIMARY KEY (`popisek`) +); +INSERT INTO t1 VALUES ('2005-01-1'); +SELECT * FROM t1 WHERE popisek = '2005-01-1'; +SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; +drop table t1; diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index d843971b93f..2a899dfd147 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -550,7 +550,7 @@ static uchar NEAR like_range_prefix_max_win1250ch[] = { 240, 242, 242, 245, 245, 245, 245, 247, 248, 251, 251, 251, 251, 253, 254, 255, }; -#define min_sort_char '\x00' +#define min_sort_char '\x20' #define max_sort_char '\xff' /*