Commit 7388c5f1 authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

merge

parents 60556efa d92022f7
...@@ -1070,7 +1070,7 @@ dnl Is this the right match for DEC OSF on alpha? ...@@ -1070,7 +1070,7 @@ dnl Is this the right match for DEC OSF on alpha?
*netware*) *netware*)
# No need for curses library so set it to null # No need for curses library so set it to null
with_named_curses="" with_named_curses=""
PLATFORM_NETWARE=yes
# #
# Edit Makefile.in files. # Edit Makefile.in files.
# #
...@@ -1170,6 +1170,7 @@ EOF ...@@ -1170,6 +1170,7 @@ EOF
;; ;;
esac esac
AM_CONDITIONAL(PLATFORM_NETWARE, test "$PLATFORM_NETWARE" = "yes")
#---START: Used in for client configure #---START: Used in for client configure
# Check if we threads are in libc or if we should use # Check if we threads are in libc or if we should use
......
...@@ -193,6 +193,11 @@ page_cur_search_with_match( ...@@ -193,6 +193,11 @@ page_cur_search_with_match(
} }
/*#endif */ /*#endif */
#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 /* 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 cursor to answer a query of the form "tuple < X", where tuple is
the input parameter, and X denotes an arbitrary physical record on the input parameter, and X denotes an arbitrary physical record on
......
...@@ -31,3 +31,16 @@ drop table t1; ...@@ -31,3 +31,16 @@ drop table t1;
explain select 1; explain select 1;
id select_type table type possible_keys key key_len ref rows Extra 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 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;
...@@ -22,3 +22,11 @@ explain select * from t1 ignore key (str,str,foo) where str="foo"; ...@@ -22,3 +22,11 @@ explain select * from t1 ignore key (str,str,foo) where str="foo";
drop table t1; drop table t1;
explain select 1; 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;
...@@ -2293,17 +2293,14 @@ convert_search_mode_to_innobase( ...@@ -2293,17 +2293,14 @@ convert_search_mode_to_innobase(
case HA_READ_BEFORE_KEY: return(PAGE_CUR_L); case HA_READ_BEFORE_KEY: return(PAGE_CUR_L);
case HA_READ_PREFIX: return(PAGE_CUR_GE); case HA_READ_PREFIX: return(PAGE_CUR_GE);
case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE); case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE);
/* TODO: 1) this should really be /* In MySQL HA_READ_PREFIX and HA_READ_PREFIX_LAST always
return(PAGE_CUR_LE_OR_EXTENDS); but since MySQL uses use a complete-field-prefix of a kay value as the search
a wrong flag in search, we convert this to PAGE_CUR_LE; tuple. I.e., it is not allowed that the last field would
2) if the character set is not latin1, then InnoDB just contain n first bytes of the full field value.
uses a MySQL function innobase_mysql_cmp() to MySQL uses a 'padding' trick to convert LIKE 'abc%'
compare CHAR and VARCHAR strings; since that function type queries so that it can use as a search tuple
does not return the number of matched bytes, a complete-field-prefix of a key value. Thus, the InnoDB
PAGE_CUR_LE_OR_EXTENDS does not currently work: we search mode PAGE_CUR_LE_OR_EXTENDS is never used. */
should probably write my_sortncmp_with_n_matcehd_bytes()
to determine if a field 'extends' another;
see dev-public discussion on Feb 7th, 2003 */
default: assert(0); default: assert(0);
} }
......
...@@ -320,6 +320,11 @@ Item *create_func_quarter(Item* a) ...@@ -320,6 +320,11 @@ Item *create_func_quarter(Item* a)
return new Item_func_quarter(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) Item *create_func_radians(Item *a)
{ {
return new Item_func_units((char*) "radians",a,M_PI/180,0.0); return new Item_func_units((char*) "radians",a,M_PI/180,0.0);
......
...@@ -73,6 +73,7 @@ Item *create_func_pi(void); ...@@ -73,6 +73,7 @@ Item *create_func_pi(void);
Item *create_func_pow(Item* a, Item *b); Item *create_func_pow(Item* a, Item *b);
Item *create_func_current_user(void); Item *create_func_current_user(void);
Item *create_func_quarter(Item* a); Item *create_func_quarter(Item* a);
Item *create_func_password(Item* a);
Item *create_func_radians(Item *a); Item *create_func_radians(Item *a);
Item *create_func_release_lock(Item* a); Item *create_func_release_lock(Item* a);
Item *create_func_repeat(Item* a, Item *b); Item *create_func_repeat(Item* a, Item *b);
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
#pragma implementation // gcc: Class implementation #pragma implementation // gcc: Class implementation
#endif #endif
......
...@@ -245,8 +245,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) ...@@ -245,8 +245,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result=0; 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; return const_result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment