diff options
author | unknown <monty@mashka.mysql.fi> | 2003-02-08 01:12:58 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-02-08 01:12:58 +0200 |
commit | cb38070e9f4e3dcaf3e2f9dc42577802ba035085 (patch) | |
tree | d54b65dfc052978dab95842c84f1a39745ef0d0c | |
parent | 5dd528a2fda1412b8b75a6311dbc7262670983b6 (diff) | |
parent | 133ed0bf6ffde95d02ea35b6c02b5a042d73ecc0 (diff) | |
download | mariadb-git-cb38070e9f4e3dcaf3e2f9dc42577802ba035085.tar.gz |
merge
configure.in:
Auto merged
mysql-test/t/explain.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_create.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | innobase/page/page0cur.c | 5 | ||||
-rw-r--r-- | mysql-test/r/explain.result | 13 | ||||
-rw-r--r-- | mysql-test/t/explain.test | 8 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 19 | ||||
-rw-r--r-- | sql/item_create.cc | 5 | ||||
-rw-r--r-- | sql/item_create.h | 1 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/opt_sum.cc | 11 |
9 files changed, 51 insertions, 16 deletions
diff --git a/configure.in b/configure.in index 8871189a119..e529da3c149 100644 --- a/configure.in +++ b/configure.in @@ -1070,7 +1070,7 @@ dnl Is this the right match for DEC OSF on alpha? *netware*) # No need for curses library so set it to null with_named_curses="" - + PLATFORM_NETWARE=yes # # Edit Makefile.in files. # @@ -1170,6 +1170,7 @@ EOF ;; esac +AM_CONDITIONAL(PLATFORM_NETWARE, test "$PLATFORM_NETWARE" = "yes") #---START: Used in for client configure # Check if we threads are in libc or if we should use diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c index 2042db80529..0e65dc8b1de 100644 --- a/innobase/page/page0cur.c +++ b/innobase/page/page0cur.c @@ -193,6 +193,11 @@ page_cur_search_with_match( } /*#endif */ #endif + + /* The following flag does not work for non-latin1 char sets because + cmp_full_field does not tell how many bytes matched */ + ut_a(mode != PAGE_CUR_LE_OR_EXTENDS); + /* If mode PAGE_CUR_G is specified, we are trying to position the cursor to answer a query of the form "tuple < X", where tuple is the input parameter, and X denotes an arbitrary physical record on diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index ff38e9fae7d..9c9cac4762b 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -31,3 +31,16 @@ drop table t1; explain select 1; 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 +create table t1 (a int not null); +explain select count(*) from t1; +Comment +Select tables optimized away +insert into t1 values(1); +explain select count(*) from t1; +Comment +Select tables optimized away +insert into t1 values(1); +explain select count(*) from t1; +Comment +Select tables optimized away +drop table t1; diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 1cf8c5e93e1..ff1803368b9 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -22,3 +22,11 @@ explain select * from t1 ignore key (str,str,foo) where str="foo"; drop table t1; explain select 1; + +create table t1 (a int not null); +explain select count(*) from t1; +insert into t1 values(1); +explain select count(*) from t1; +insert into t1 values(1); +explain select count(*) from t1; +drop table t1; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 23c6082da92..a037c6989aa 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2293,17 +2293,14 @@ convert_search_mode_to_innobase( case HA_READ_BEFORE_KEY: return(PAGE_CUR_L); case HA_READ_PREFIX: return(PAGE_CUR_GE); case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE); - /* TODO: 1) this should really be - return(PAGE_CUR_LE_OR_EXTENDS); but since MySQL uses - a wrong flag in search, we convert this to PAGE_CUR_LE; - 2) if the character set is not latin1, then InnoDB - uses a MySQL function innobase_mysql_cmp() to - compare CHAR and VARCHAR strings; since that function - does not return the number of matched bytes, - PAGE_CUR_LE_OR_EXTENDS does not currently work: we - should probably write my_sortncmp_with_n_matcehd_bytes() - to determine if a field 'extends' another; - see dev-public discussion on Feb 7th, 2003 */ + /* In MySQL HA_READ_PREFIX and HA_READ_PREFIX_LAST always + use a complete-field-prefix of a kay value as the search + tuple. I.e., it is not allowed that the last field would + just contain n first bytes of the full field value. + MySQL uses a 'padding' trick to convert LIKE 'abc%' + type queries so that it can use as a search tuple + a complete-field-prefix of a key value. Thus, the InnoDB + search mode PAGE_CUR_LE_OR_EXTENDS is never used. */ default: assert(0); } diff --git a/sql/item_create.cc b/sql/item_create.cc index 610b7d77184..5c37abb230f 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -320,6 +320,11 @@ Item *create_func_quarter(Item* a) return new Item_func_quarter(a); } +Item *create_func_password(Item* a) +{ + return new Item_func_password(a); +} + Item *create_func_radians(Item *a) { return new Item_func_units((char*) "radians",a,M_PI/180,0.0); diff --git a/sql/item_create.h b/sql/item_create.h index 0c469e82db8..0c51886180f 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -73,6 +73,7 @@ Item *create_func_pi(void); Item *create_func_pow(Item* a, Item *b); Item *create_func_current_user(void); Item *create_func_quarter(Item* a); +Item *create_func_password(Item* a); Item *create_func_radians(Item *a); Item *create_func_release_lock(Item* a); Item *create_func_repeat(Item* a, Item *b); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3dbcdaf0537..879c75eb2e2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,8 +23,6 @@ */ - - #ifdef __GNUC__ #pragma implementation // gcc: Class implementation #endif diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 2ca6ddbab10..d8c61fa1a1d 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -245,8 +245,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result=0; } } - if (used_tables != removed_tables) - const_result=0; // We didn't remove all tables + /* + If we have a where clause, we can only ignore searching in the + tables if MIN/MAX optimisation replaced all used tables + This is to not to use replaced values in case of: + SELECT MIN(key) FROM table_1, empty_table + removed_tables is != 0 if we have used MIN() or MAX(). + */ + if (removed_tables && used_tables != removed_tables) + const_result= 0; // We didn't remove all tables return const_result; } |