diff options
author | monty@mashka.mysql.fi <> | 2003-01-21 21:07:59 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-01-21 21:07:59 +0200 |
commit | 25c393a12ea7264f265f958027d6e0a1735acc77 (patch) | |
tree | b3f7b07e6d74a88c6ef0b3e8f43bc27b784bb24d /sql | |
parent | 6522ee6c9845cf61903592e9a36c78dc4f69f569 (diff) | |
download | mariadb-git-25c393a12ea7264f265f958027d6e0a1735acc77.tar.gz |
Portability fixes (for windows)
Some changes to the prepared statement protocol to make it easier to use and faster.
Diffstat (limited to 'sql')
40 files changed, 41 insertions, 68 deletions
diff --git a/sql/field.cc b/sql/field.cc index 1b388287811..1aa01b1e2c5 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2053,7 +2053,8 @@ String *Field_longlong::val_str(String *val_buffer, #endif longlongget(j,ptr); - length=(uint) cs->longlong10_to_str(cs,to,mlength,unsigned_flag ? 10 : -10, j); + length=(uint) (cs->longlong10_to_str)(cs,to,mlength, + unsigned_flag ? 10 : -10, j); val_buffer->length(length); if (zerofill) prepend_zeros(val_buffer); @@ -3928,7 +3929,7 @@ int Field_string::store(longlong nr) char buff[64]; int l; CHARSET_INFO *cs=charset(); - l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr); + l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr); return Field_string::store(buff,(uint)l,cs); } @@ -4095,7 +4096,7 @@ int Field_varstring::store(longlong nr) char buff[64]; int l; CHARSET_INFO *cs=charset(); - l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr); + l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr); return Field_varstring::store(buff,(uint)l,cs); } diff --git a/sql/filesort.cc b/sql/filesort.cc index 00ef12839cf..0e0b2c8f33a 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -23,7 +23,6 @@ #endif #include <m_ctype.h> #include "sql_sort.h" -#include "assert.h" #ifndef THREAD #define SKIP_DBUG_IN_FILESORT diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 168c3327d79..067c066713f 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -55,7 +55,6 @@ #ifdef HAVE_BERKELEY_DB #include <m_ctype.h> #include <myisampack.h> -#include <assert.h> #include <hash.h> #include "ha_berkeley.h" #include "sql_manager.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 86544542613..6125a616f78 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -32,7 +32,6 @@ InnoDB */ #ifdef HAVE_INNOBASE_DB #include <m_ctype.h> -#include <assert.h> #include <hash.h> #include <myisampack.h> diff --git a/sql/item.cc b/sql/item.cc index ecc63aa4b95..a4f7008aa4e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -22,7 +22,6 @@ #include "mysql_priv.h" #include <m_ctype.h> #include "my_dir.h" -#include <assert.h> /***************************************************************************** ** Item functions @@ -1056,7 +1055,8 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) break; if ((tmp= find_field_in_tables(thd, this, sl->get_table_list(), &where, - 0)) != not_found_field); + 0)) != not_found_field) + break; if (sl->master_unit()->first_select()->linkage == DERIVED_TABLE_TYPE) break; // do not look over derived table diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 79807653317..829caeede1d 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -23,7 +23,6 @@ #include "mysql_priv.h" #include <m_ctype.h> -#include "assert.h" Item_bool_func2* Item_bool_func2::eq_creator(Item *a, Item *b) { return new Item_func_eq(a, b); diff --git a/sql/item_func.cc b/sql/item_func.cc index d489ff1055d..6ba6ba13744 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -28,7 +28,6 @@ #include <time.h> #include <ft_global.h> #include <zlib.h> -#include <assert.h> /* return TRUE if item is a constant */ diff --git a/sql/item_row.cc b/sql/item_row.cc index 355228e45df..0c060b6d8db 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysql_priv.h" -#include "assert.h" Item_row::Item_row(List<Item> &arg): Item(), used_tables_cache(0), array_holder(1), const_item_cache(1) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 748ef096dbe..df2352db231 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1321,12 +1321,14 @@ String *Item_func_password::val_str(String *str) char* seed_ptr=key->c_ptr(); while (*seed_ptr) { - seed=seed*211+*seed_ptr; /* Use simple hashing */ + seed=(seed*211+*seed_ptr) & 0xffffffffL; /* Use simple hashing */ seed_ptr++; } /* Use constants which allow nice random values even with small seed */ - randominit(&rand_st,seed*111111+33333333L,seed*1111+55555555L); + randominit(&rand_st, + (ulong) ((ulonglong) seed*111111+33333333L) & (ulong) 0xffffffff, + (ulong) ((ulonglong) seed*1111+55555555L) & (ulong) 0xffffffff); make_scrambled_password(tmp_value,res->c_ptr(),use_old_passwords, &rand_st); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index c5ecdc87d40..4ee851c2f84 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -494,7 +494,7 @@ void Item_in_subselect::single_value_transformer(THD *thd, else { sl->item_list.empty(); - sl->item_list.push_back(new Item_int(1)); + sl->item_list.push_back(new Item_int("Not_used", (longlong) 1, 21)); if (sl->table_list.elements) { item= (*func)(expr, new Item_asterisk_remover(this, item, diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 2a96594af4e..cc90cd8fcd8 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -22,7 +22,7 @@ #endif #include "mysql_priv.h" -#include "assert.h" + Item_sum::Item_sum(List<Item> &list) { arg_count=list.elements; diff --git a/sql/lex.h b/sql/lex.h index a505911ccf6..b17d3313c3f 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -136,7 +136,7 @@ static SYMBOL symbols[] = { { "DROP", SYM(DROP),0,0}, { "DUMPFILE", SYM(DUMPFILE),0,0}, { "DYNAMIC", SYM(DYNAMIC_SYM),0,0}, - { "DUPLICATE", SYM(DUPLICATE),0,0}, + { "DUPLICATE", SYM(DUPLICATE_SYM),0,0}, { "ERRORS", SYM(ERRORS),0,0}, { "END", SYM(END),0,0}, { "ELSE", SYM(ELSE),0,0}, diff --git a/sql/lock.cc b/sql/lock.cc index 74d1109b203..8f342b28d67 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -68,8 +68,7 @@ TODO: #include "mysql_priv.h" #include <hash.h> -#include <assert.h> -#include <ha_myisammrg.h> +#include "ha_myisammrg.h" #ifndef MASTER #include "../srclib/myisammrg/myrg_def.h" #else diff --git a/sql/log.cc b/sql/log.cc index 5dcb5857026..033896a2674 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -29,7 +29,6 @@ #include <my_dir.h> #include <stdarg.h> #include <m_ctype.h> // For test_if_number -#include <assert.h> #define files_charset_info my_charset_latin1 diff --git a/sql/log_event.cc b/sql/log_event.cc index d2fcc83a98f..248bac04df2 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -24,8 +24,6 @@ #include <my_dir.h> #endif /* MYSQL_CLIENT */ -#include <assert.h> - #define log_cs my_charset_latin1 /***************************************************************************** @@ -1652,7 +1650,7 @@ void Rotate_log_event::pack_info(Protocol *protocol) memcpy(buf, new_log_ident, ident_len); b_pos+= ident_len; b_pos= strmov(b_pos, ";pos="); - b_pos=int10_to_str(pos, b_pos, 10); + b_pos=longlong10_to_str(pos, b_pos, 10); if (flags & LOG_EVENT_FORCED_ROTATE_F) b_pos= strmov(b_pos ,"; forced by master"); protocol->store(buf, b_pos-buf); @@ -1789,7 +1787,7 @@ void Intvar_log_event::pack_info(Protocol *protocol) char buf[64], *pos; pos= strmov(buf, get_var_type_name()); *(pos++)='='; - pos=int10_to_str(val, pos, -10); + pos= longlong10_to_str(val, pos, -10); protocol->store(buf, pos-buf); } #endif // !MYSQL_CLIENT @@ -2000,7 +1998,7 @@ void Slave_log_event::pack_info(Protocol *protocol) pos= strmov(pos, ",log="); pos= strmov(pos, master_log); pos= strmov(pos, ",pos="); - pos= int10_to_str(master_pos, pos, 10); + pos= longlong10_to_str(master_pos, pos, 10); protocol->store(buf, pos-buf); } #endif // !MYSQL_CLIENT diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index 1bc65eebd23..742f94c9e2b 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -37,7 +37,6 @@ #include <errno.h> static void my_aiowait(my_aio_result *result); #endif -#include <assert.h> extern "C" { diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 7a354ef5ff1..feb6675e787 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -24,6 +24,7 @@ #include <thr_lock.h> #include <my_base.h> /* Needed by field.h */ #include <my_bitmap.h> +#include <assert.h> #ifdef __EMX__ #undef write /* remove pthread.h macro definition for EMX */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8a2dfe50d54..6b3a1a7600c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -32,7 +32,6 @@ #include <nisam.h> #include <thr_alarm.h> #include <ft_global.h> -#include <assert.h> #define mysqld_charset my_charset_latin1 diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 43066a29624..33309d35157 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -33,8 +33,6 @@ #include <m_ctype.h> #include <nisam.h> #include "sql_select.h" -#include <assert.h> - #ifndef EXTRA_DEBUG #define test_rb_tree(A,B) {} diff --git a/sql/password.c b/sql/password.c index 9b6189a161c..37040c20683 100644 --- a/sql/password.c +++ b/sql/password.c @@ -151,11 +151,8 @@ void create_random_string(int length,struct rand_struct *rand_st,char* target) { char* end=target+length; /* Use pointer arithmetics as it is faster way to do so. */ - while (target<end) - { - *target=rnd(rand_st)*94+33; - target++; - } + for (; target<end ; target++) + *target= (char) (rnd(rand_st)*94+33); } @@ -296,7 +293,7 @@ void make_scrambled_password(char *to,const char *password, { to[0]=PVERSION41_CHAR; /* New passwords have version prefix */ /* Rnd returns number from 0 to 1 so this would be good salt generation.*/ - salt=rnd(rand_st)*65535+1; + salt=(unsigned short) (rnd(rand_st)*65535+1); /* Use only 2 first bytes from it */ sprintf(to+1,"%04x",salt); /* First hasing is done without salt */ @@ -556,7 +553,7 @@ void get_hash_and_password(ulong* salt, uint8 pversion, char* hash, unsigned cha val=*(++salt); for (t=3; t>=0; t--) { - bin_password[t]=val & 255; + bin_password[t]= (char) (val & 255); val>>=8; /* Scroll 8 bits to get next part*/ } bin_password+=4; /* Get to next 4 chars*/ @@ -575,8 +572,7 @@ void get_hash_and_password(ulong* salt, uint8 pversion, char* hash, unsigned cha val=*salt; for (t=3;t>=0;t--) { - bp[t]=val%256; - + bp[t]= (uchar) (val & 255); val>>=8; /* Scroll 8 bits to get next part*/ } bp+=4; /* Get to next 4 chars*/ diff --git a/sql/protocol.cc b/sql/protocol.cc index 48ef9ecb71e..be5202111d0 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -25,7 +25,6 @@ #include "mysql_priv.h" #include <stdarg.h> -#include <assert.h> /* Send a error string to client */ diff --git a/sql/set_var.cc b/sql/set_var.cc index 79e9f67e905..30067336d5a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -930,7 +930,7 @@ err: bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names) { - char buff[80], *value, *error= 0; + char buff[80], *error= 0; uint error_len= 0; String str(buff, sizeof(buff), system_charset_info), *res; @@ -938,7 +938,7 @@ bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names) { if (!(res= var->value->val_str(&str))) goto err; - (long) var->save_result.ulong_value= (ulong) + var->save_result.ulong_value= (ulong) find_set(enum_names, res->c_ptr(), res->length(), &error, &error_len); if (error_len) { diff --git a/sql/slave.cc b/sql/slave.cc index 97961eb00f8..ce1a8e4befd 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -24,7 +24,6 @@ #include "repl_failsafe.h" #include <thr_alarm.h> #include <my_dir.h> -#include <assert.h> bool use_slave_mask = 0; MY_BITMAP slave_error_mask; diff --git a/sql/spatial.cc b/sql/spatial.cc index 5c6be3c221c..42dd74a697a 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -66,7 +66,8 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len) cur_rt < ci_collection_end; ++cur_rt) { if ((cur_rt->m_name[len] == 0) && - (strncasecmp(cur_rt->m_name, name, len) == 0)) + (default_charset_info->strncasecmp(default_charset_info, + cur_rt->m_name, name, len) == 0)) { return cur_rt; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 30477cf4e99..cedb34b48bb 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -29,7 +29,6 @@ #include "sql_acl.h" #include "hash_filo.h" #include <m_ctype.h> -#include <assert.h> #include <stdarg.h> diff --git a/sql/sql_base.cc b/sql/sql_base.cc index db32030efd1..e4af362c3e3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -24,7 +24,6 @@ #include <my_dir.h> #include <hash.h> #include <nisam.h> -#include <assert.h> #ifdef __WIN__ #include <io.h> #endif diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 9e1d9c0b64c..b1ea9815f42 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -307,7 +307,6 @@ TODO list: #else #include "../myisammrg/myrg_def.h" #endif -#include <assert.h> #if defined(EXTRA_DEBUG) && !defined(DBUG_OFF) #define MUTEX_LOCK(M) { DBUG_PRINT("lock", ("mutex lock 0x%lx", (ulong)(M))); \ diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 5734b340744..d352fc95fdd 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -35,7 +35,6 @@ #include <io.h> #endif #include <mysys_err.h> -#include <assert.h> /***************************************************************************** diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 0d8af46dbf6..e2d484b1c2b 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include "sql_select.h" -#include <assert.h> /* TODO: HANDLER blabla OPEN [ AS foobar ] [ (column-list) ] diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 013101a0ecc..2bac815d12a 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -382,7 +382,7 @@ int mysqld_help(THD *thd, const char *mask) if ((res= send_header_2(protocol)) || (count==0 && (search_categories(thd, 0, &categories_list, 0)<0 && - (res= 1))) || + ((res= 1)))) || (res= send_variant_2_list(protocol,&categories_list,true))) goto end; } @@ -396,7 +396,7 @@ int mysqld_help(THD *thd, const char *mask) else if ((res= send_header_2(protocol)) || (res= send_variant_2_list(protocol,&function_list,false)) || (search_categories(thd, mask, &categories_list, 0)<0 && - (res=1)) || + ((res=1))) || (res= send_variant_2_list(protocol,&categories_list,true))) { goto end; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e4fc3a5aec3..716e37b5cb7 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -21,7 +21,6 @@ #include "item_create.h" #include <m_ctype.h> #include <hash.h> -#include <assert.h> LEX_STRING tmp_table_alias= {(char*) "tmp-table",8}; @@ -235,7 +234,9 @@ static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote) yyUnget(); // ptr points now after last token char tmp.length=lex->yytoklen=length; tmp.str=(char*) lex->thd->alloc(tmp.length+1); - for (from= (byte*) lex->tok_start, to= tmp.str, end= to+length ; to != end ;) + for (from= (byte*) lex->tok_start, to= (byte*) tmp.str, end= to+length ; + to != end ; + ) { if ((*to++= *from++) == quote) from++; // Skip double quotes diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 9fc00e5f56d..85a171e9fe4 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -303,7 +303,7 @@ public: st_select_lex* outer_select(); st_select_lex* first_select() { return (st_select_lex*) slave; } st_select_lex_unit* next_unit() { return (st_select_lex_unit*) next; } - void st_select_lex_unit::exclude_level(); + void exclude_level(); /* UNION methods */ int prepare(THD *thd, select_result *result); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 42f4d39147b..e53d60799c9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -21,7 +21,6 @@ #include <m_ctype.h> #include <myisam.h> #include <my_dir.h> -#include <assert.h> #define files_charset_info system_charset_info diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 8e0c031065e..75b4fcb1896 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -67,7 +67,6 @@ Long data handling: #include "mysql_priv.h" #include "sql_acl.h" #include "sql_select.h" // for JOIN -#include <assert.h> // for DEBUG_ASSERT() #include <m_ctype.h> // for isspace() #define IS_PARAM_NULL(pos, param_no) pos[param_no/8] & (1 << param_no & 7) diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 5bdc15c2bf0..99fcedfc023 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -22,7 +22,6 @@ #include "log_event.h" #include "mini_client.h" #include <my_dir.h> -#include <assert.h> extern const char* any_db; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8ee1fbca6a5..d21c89bc512 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -29,7 +29,6 @@ #include <m_ctype.h> #include <hash.h> #include <ft_global.h> -#include <assert.h> const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "MAYBE_REF","ALL","range","index","fulltext" }; diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 646621ac2eb..0d604d043cc 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -100,7 +100,7 @@ bool String::set(longlong num, CHARSET_INFO *cs) if (alloc(l)) return TRUE; - str_length=(uint32) cs->longlong10_to_str(cs,Ptr,l,-10,num); + str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,-10,num); str_charset=cs; return FALSE; } @@ -111,7 +111,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs) if (alloc(l)) return TRUE; - str_length=(uint32) cs->longlong10_to_str(cs,Ptr,l,10,num); + str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,10,num); str_charset=cs; return FALSE; } diff --git a/sql/sql_string.h b/sql/sql_string.h index ad91b20f18c..6d54373f642 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -115,7 +115,7 @@ public: Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; str_charset=cs; } - bool String::set_latin1(const char *str, uint32 arg_length); + bool set_latin1(const char *str, uint32 arg_length); inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs) { if (!alloced) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index fcae9d03e00..f6b3305761e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -23,7 +23,6 @@ #endif #include <hash.h> #include <myisam.h> -#include <assert.h> #ifdef __WIN__ #include <io.h> diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a424aefd45f..fb594f28b2d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -208,7 +208,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token DES_KEY_FILE %token DISABLE_SYM %token DISTINCT -%token DUPLICATE +%token DUPLICATE_SYM %token DYNAMIC_SYM %token ENABLE_SYM %token ENCLOSED @@ -3177,7 +3177,7 @@ expr_or_default: opt_insert_update: /* empty */ - | ON DUPLICATE + | ON DUPLICATE_SYM { /* for simplisity, let's forget about INSERT ... SELECT ... UPDATE for a moment */ @@ -3866,8 +3866,9 @@ keyword: | DES_KEY_FILE {} | DIRECTORY_SYM {} | DO_SYM {} - | DUMPFILE {} | DUAL_SYM {} + | DUMPFILE {} + | DUPLICATE_SYM {} | DYNAMIC_SYM {} | END {} | ENUM {} @@ -4565,11 +4566,7 @@ optional_order_or_limit: { THD *thd= YYTHD; LEX *lex= &thd->lex; - if (!lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) - { - send_error(lex->thd, ER_SYNTAX_ERROR); - YYABORT; - } + DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE); SELECT_LEX *sel= lex->current_select->select_lex(); sel->master_unit()->global_parameters= sel->master_unit(); |