diff options
-rw-r--r-- | Docs/manual.texi | 52 | ||||
-rw-r--r-- | include/my_sys.h | 1 | ||||
-rw-r--r-- | mysys/mf_iocache2.c | 22 | ||||
-rw-r--r-- | mysys/my_vsnprintf.c | 1 | ||||
-rw-r--r-- | mysys/thr_lock.c | 4 | ||||
-rw-r--r-- | readline/bind.c | 2 | ||||
-rw-r--r-- | scripts/Makefile.am | 7 | ||||
-rwxr-xr-x | sql-bench/crash-me.sh | 4 | ||||
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/log_event.cc | 16 | ||||
-rw-r--r-- | sql/log_event.h | 20 | ||||
-rw-r--r-- | sql/mf_iocache.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 3 | ||||
-rw-r--r-- | sql/sql_class.cc | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 8 | ||||
-rw-r--r-- | sql/sql_select.cc | 3 | ||||
-rw-r--r-- | sql/sql_table.cc | 1 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 25 | ||||
-rw-r--r-- | sql/unireg.cc | 6 | ||||
-rw-r--r-- | sql/unireg.h | 1 |
21 files changed, 104 insertions, 84 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 77699649cff..ee711dbab3e 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -374,7 +374,7 @@ MySQL Language Reference * ANALYZE TABLE:: @code{ANALYZE TABLE} syntax * REPAIR TABLE:: @code{REPAIR TABLE} syntax * DELETE:: @code{DELETE} syntax -* TRUNCATE:: +* TRUNCATE:: @code{TRUNCATE} syntax * SELECT:: @code{SELECT} syntax * JOIN:: @code{JOIN} syntax * INSERT:: @code{INSERT} syntax @@ -1011,8 +1011,7 @@ The following list describes some useful sections of the manual: For a discussion of @strong{MySQL}'s capabilities, see @ref{Features}. @item -For installation instructions, see @ref{Installing}. For tips on porting -@strong{MySQL} to new architectures or operating systems, see @ref{Porting}. +For installation instructions, see @ref{Installing}. @item For tips on porting @strong{MySQL} to new architectures or operating @@ -3581,7 +3580,9 @@ We will provide hints on optimizing your system and your queries. @item You are allowed to call a @strong{MySQL} developer (in moderation) and -discuss your @strong{MySQL}-related problems. +discuss your @strong{MySQL}-related problems. This option is however +only to be used as a last result during an emergency after we have +failed to grasp the total problem with email. @end itemize @node Extended login support, , Login support, Support @@ -12590,7 +12591,7 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run * ANALYZE TABLE:: @code{ANALYZE TABLE} syntax * REPAIR TABLE:: @code{REPAIR TABLE} syntax * DELETE:: @code{DELETE} syntax -* TRUNCATE:: +* TRUNCATE:: @code{TRUNCATE} syntax * SELECT:: @code{SELECT} syntax * JOIN:: @code{JOIN} syntax * INSERT:: @code{INSERT} syntax @@ -18264,7 +18265,7 @@ the @code{LIMIT} value. @section @code{TRUNCATE} syntax @example -TRUNCATE TABLE table_name +TRUNCATE table_name @end example Is in 3.23 and the same thing as @code{DELETE FROM table_name}. @xref{DELETE}. @@ -19528,7 +19529,7 @@ the @code{mysql} database. @item @code{TABLES} @tab Closes all open tables and force all tables in use to be closed. -@item @code{TABLES table_name [,table_name...]} @tab Flush only the given tables +@item @code{[TABLE | TABLES] table_name [,table_name...]} @tab Flush only the given tables @item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convinient way to get backups if you have a file system, like Veritas,that can take snapshots in time. @@ -21551,13 +21552,19 @@ while other threads are reading from the table. Support for big files (63-bit) on filesystems/operating systems that support big files. @item -All data is stored with the low byte first. This makes the data machine and -OS independent. The only requirement is that the machine uses two's-complement -signed integers (as every machine for the last 20 years has) -and IEEE floating-point format (also totally dominant among mainstream -machines). The only area of machines that may not support binary -compatibility are embedded systems (because they sometimes have peculiar -processors). +All data is stored with the low byte first. This makes the data machine +and OS independent. The only requirement is that the machine uses +two's-complement signed integers (as every machine for the last 20 years +has) and IEEE floating-point format (also totally dominant among +mainstream machines). The only area of machines that may not support +binary compatibility are embedded systems (because they sometimes have +peculiar processors). + +There is no big speed penalty in storing data low byte first; The bytes +in a table row is normally unaligned and it doesn't take that much more +power to read an unaligned byte in order than in reverse order. The +actual fetch-column-value code is also not time critical compared to +other code. @item All number keys are stored with high byte first to give better index compression. @@ -22094,7 +22101,7 @@ You need enough extra memory for all HEAP tables that you want to use at the same time. @item To free memory, you should execute @code{DELETE FROM heap_table}, -@code{TRUNCATE TABLE heap_table} or @code{DROP TABLE heap_table}. +@code{TRUNCATE heap_table} or @code{DROP TABLE heap_table}. @item @strong{MySQL} cannot find out how approximately many rows there are between two values (this is used by the range optimizer to decide which @@ -26255,7 +26262,7 @@ This can be done with the following code: @example mysql> LOCK TABLES real_table WRITE, insert_table WRITE; mysql> insert into real_table select * from insert_table; -mysql> TRUNCATE TABLE insert_table; +mysql> TRUNCATE insert_table; mysql> UNLOCK TABLES; @end example @@ -27110,7 +27117,7 @@ it is very important to @code{OPTIMIZE TABLE} sometimes. @subsection Speed of @code{DELETE} queries If you want to delete all rows in the table, you should use -@code{TRUNCATE TABLE table_name}. @xref{TRUNCATE}. +@code{TRUNCATE table_name}. @xref{TRUNCATE}. The time to delete a record is exactly proportional to the number of indexes. To delete records more quickly, you can increase the size of @@ -29825,7 +29832,7 @@ Use the table description file to create new (empty) data and index files: @example shell> mysql db_name mysql> SET AUTOCOMMIT=1; -mysql> TRUNCATE TABLE table_name; +mysql> TRUNCATE table_name; mysql> quit @end example @@ -38485,6 +38492,13 @@ though, so Version 3.23 is not released as a stable version yet. @appendixsubsec Changes in release 3.23.28 @itemize @bullet @item +Fixed the @code{--skip-networking} works properly on NT. +@item +Fixed bug in @code{MyISAM} when running multiple updating processes on +the same table. +@item +Allow one to use @code{FLUSH TABLE tablename}. +@item Changed all log files to use our own IO_CACHE mechanism instead of FILE:s to avoid OS problems when there is many files open. @item @@ -38500,7 +38514,7 @@ Added status variables @code{large_file_support},@code{net_read_timeout}, Fixed bug where we didn't allow an index name after the @code{FOREIGN KEY} definition. @item -Added @code{TRUNCATE TABLE table_name} as a synonym for +Added @code{TRUNCATE table_name} as a synonym for @code{DELETE FROM table_name}. @item Fixed bug in a BDB key compare function when comparing part keys. diff --git a/include/my_sys.h b/include/my_sys.h index 32b2d18fb4d..c1c47663e12 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -511,6 +511,7 @@ extern uint my_b_fill(IO_CACHE *info); extern void my_b_seek(IO_CACHE *info,my_off_t pos); extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length); extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...); +extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, const char *prefix, uint cache_size, myf cache_myflags); diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 80cea47a80f..b77bddb942a 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -128,30 +128,38 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length) uint my_b_printf(IO_CACHE *info, const char* fmt, ...) { + int result; va_list args; + va_start(args,fmt); + result=my_b_vprintf(info, fmt, args); + va_end(args); + return result; +} + + +uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) +{ reg1 char *to= info->rc_pos; char *end=info->rc_end; uint out_length=0; - va_start(args,fmt); - for (; *fmt ; fmt++) { - if (fmt[0] != '%') + if (*fmt++ != '%') { /* Copy everything until '%' or end of string */ - const char *start=fmt; + const char *start=fmt-1; uint length; - for (fmt++ ; *fmt && *fmt != '%' ; fmt++ ) ; + for (; *fmt && *fmt != '%' ; fmt++ ) ; length= (uint) (fmt - start); out_length+=length; if (my_b_write(info, start, length)) goto err; if (!*fmt) /* End of format */ { - va_end(args); return out_length; } + fmt++; /* Found one '%' */ } /* Skipp if max size is used (to be compatible with printf) */ @@ -203,10 +211,8 @@ uint my_b_printf(IO_CACHE *info, const char* fmt, ...) out_length++; } } - va_end(args); return out_length; err: return (uint) -1; - va_end(args); } diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c index b394adf2a96..ac89e3bcf1a 100644 --- a/mysys/my_vsnprintf.c +++ b/mysys/my_vsnprintf.c @@ -35,6 +35,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) continue; } /* Skipp if max size is used (to be compatible with printf) */ + fmt++; while (isdigit(*fmt) || *fmt == '.' || *fmt == '-') fmt++; if (*fmt == 's') /* String parameter */ diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index df360447e69..b9a9d5274ee 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -422,8 +422,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) /* Request for READ lock */ if (lock->write.data) { - /* We can get allow a read lock even if there is already a write lock - one the table in one the following cases: + /* We can allow a read lock even if there is already a write lock + on the table in one the following cases: - This thread alread have a write lock on the table - The write lock is TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED and the read lock is TL_READ_HIGH_PRIORITY or TL_READ diff --git a/readline/bind.c b/readline/bind.c index bbbbd1b15c4..57383239098 100644 --- a/readline/bind.c +++ b/readline/bind.c @@ -1210,7 +1210,7 @@ rl_parse_and_bind (string) if (fl && funname[fl - 1] == *funname) funname[fl - 1] = '\0'; - rl_macro_bind (useq, &funname[1], _rl_keymap); + rl_macro_bind ((char*) useq, &funname[1], _rl_keymap); } #if defined (PREFIX_META_HACK) /* Ugly, but working hack to keep prefix-meta around. */ diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b3ac40d9959..ec1b33fb42b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -26,7 +26,8 @@ bin_SCRIPTS = @server_scripts@ \ mysqlbug \ mysql_convert_table_format \ mysql_find_rows \ - mysqlhotcopy + mysqlhotcopy \ + mysqldumpslow EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ @@ -40,6 +41,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_convert_table_format.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ + mysqldumpslow.sh \ safe_mysqld.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ @@ -60,7 +62,8 @@ CLEANFILES = @server_scripts@ \ mysqlaccess \ mysql_convert_table_format \ mysql_find_rows \ - mysqlhotcopy + mysqlhotcopy \ + mysqldumpslow SUPERCLEANFILES = mysqlbug diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 5c993e842bc..45bcd2d4a1c 100755 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -289,9 +289,9 @@ report("rename table","rename_table", $dbh->do("drop table crash_q1"); $dbh->do("drop table crash_q"); -report("truncate table","truncate_table", +report("truncate","truncate_table", "create table crash_q (a integer, b integer,c CHAR(10))", - "truncate table crash_q", + "truncate crash_q", "drop table crash_q1"); if ($dbh->do("create table crash_q (a integer, b integer,c CHAR(10))") && diff --git a/sql/log.cc b/sql/log.cc index c697ae276fc..d5b2b16b368 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -582,7 +582,7 @@ void MYSQL_LOG::write(THD *thd,enum enum_server_command command, if (format) { if (my_b_write(&log_file," ",1) || - my_b_printf(&log_file,format,args) == (uint) -1) + my_b_vprintf(&log_file,format,args) == (uint) -1) error=errno; } if (my_b_write(&log_file,"\n",1) || diff --git a/sql/log_event.cc b/sql/log_event.cc index cc06e68e378..e895914aa4d 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -246,11 +246,10 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len) case START_EVENT: return new Start_log_event(buf); case STOP_EVENT: return new Stop_log_event(buf); case INTVAR_EVENT: return new Intvar_log_event(buf); - default: return NULL; + default: + break; } - - //impossible - return NULL; + return NULL; // default value } void Log_event::print_header(FILE* file) @@ -351,6 +350,15 @@ Start_log_event::Start_log_event(const char* buf) :Log_event(buf) created = uint4korr(buf + 2 + sizeof(server_version)); } +int Start_log_event::write_data(IO_CACHE* file) +{ + char buff[sizeof(server_version)+2+4]; + int2store(buff,binlog_version); + memcpy(buff+2,server_version,sizeof(server_version)); + int4store(buff+2+sizeof(server_version),created); + return (my_b_write(file, (byte*) buff, sizeof(buff)) ? -1 : 0); +} + Rotate_log_event::Rotate_log_event(const char* buf, int event_len): Log_event(buf),new_log_ident(NULL),alloced(0) { diff --git a/sql/log_event.h b/sql/log_event.h index e5b52377f8d..fb71a52a82e 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -183,7 +183,7 @@ class Load_log_event: public Log_event { protected: char* data_buf; - void Load_log_event::copy_log_event(const char *buf, ulong data_len); + void copy_log_event(const char *buf, ulong data_len); public: int thread_id; @@ -304,9 +304,9 @@ extern char server_version[50]; class Start_log_event: public Log_event { public: + uint32 created; uint16 binlog_version; char server_version[50]; - uint32 created; Start_log_event() :Log_event(time(NULL)),binlog_version(BINLOG_VERSION) { @@ -316,8 +316,7 @@ public: Start_log_event(IO_CACHE* file, time_t when_arg, uint32 server_id) : Log_event(when_arg, 0, 0, server_id) { - char buf[sizeof(server_version) + sizeof(binlog_version) + - sizeof(created)+4]; + char buf[sizeof(server_version) + 2 + 4 + 4]; if (my_b_read(file, (byte*) buf, sizeof(buf))) return; binlog_version = uint2korr(buf+4); @@ -328,18 +327,11 @@ public: ~Start_log_event() {} Log_event_type get_type_code() { return START_EVENT;} - int write_data(IO_CACHE* file) - { - if (my_b_write(file, (byte*) &binlog_version, sizeof(binlog_version)) || - my_b_write(file, (byte*) server_version, sizeof(server_version)) || - my_b_write(file, (byte*) &created, sizeof(created))) - return -1; - return 0; - } + int write_data(IO_CACHE* file); int get_data_size() { - return sizeof(binlog_version) + sizeof(server_version) + - sizeof(created); + // sizeof(binlog_version) + sizeof(server_version) sizeof(created) + return 2 + sizeof(server_version) + 4; } void print(FILE* file, bool short_form = 0); }; diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index 47c00a8ac00..7f85cc06f57 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -320,7 +320,7 @@ int _my_b_net_read(register IO_CACHE *info, byte *Buffer, read_length=my_net_read(net); if (read_length == (int) packet_error) { - info->error=(uint) -1; + info->error= -1; return 1; } if (read_length == 0) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 76728503b53..ff0307bde1d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1653,7 +1653,7 @@ int main(int argc, char **argv) handler_count--; } } - if (have_tcpip) + if (have_tcpip && !opt_disable_networking) { handler_count++; if (pthread_create(&hThread,&connection_attrib, diff --git a/sql/slave.cc b/sql/slave.cc index 0febb672624..dea11b0119f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -171,9 +171,6 @@ int db_ok(const char* db, I_List<i_string> &do_list, return 1; } - - // impossible - return 0; } static void init_strvar_from_file(char* var, int max_size, FILE* f, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 5be12636bef..4ccf3481763 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -116,8 +116,8 @@ THD::THD() system_thread=0; bzero((char*) &mem_root,sizeof(mem_root)); #if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB) - if (open_cached_file(&transactions.trans_log, - mysql_tempdir,LOG_PREFIX,0,MYF(MY_WME))) + if (open_cached_file(&transaction.trans_log, + mysql_tmpdir,LOG_PREFIX,0,MYF(MY_WME))) killed=1; transaction.bdb_lock_count=0; #endif @@ -145,7 +145,7 @@ THD::~THD() } close_temporary_tables(this); #if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB) - close_cached_file(transactions.trans_log); + close_cached_file(&transaction.trans_log); #endif if (global_read_lock) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3f21041742d..467feaef6d8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -78,7 +78,7 @@ static inline bool end_active_trans(THD *thd) { if (ha_commit(thd)) return 1; - thd->options&= ~OPTION_BEGIN; + thd->options&= ~(ulong) (OPTION_BEGIN); thd->server_status&= ~SERVER_STATUS_IN_TRANS; } return 0; @@ -1562,7 +1562,7 @@ mysql_execute_command(void) if (!org_options & OPTION_AUTO_COMMIT) { /* We changed to auto_commit mode */ - thd->options&= ~OPTION_BEGIN; + thd->options&= ~(ulong) (OPTION_BEGIN); thd->server_status|= SERVER_STATUS_AUTOCOMMIT; if (ha_commit(thd)) { @@ -1747,7 +1747,7 @@ mysql_execute_command(void) even if there is a problem with the OPTION_AUTO_COMMIT flag (Which of course should never happen...) */ - thd->options&= ~OPTION_BEGIN; + thd->options&= ~(ulong) (OPTION_BEGIN); thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (!ha_commit(thd)) send_ok(&thd->net); @@ -1755,7 +1755,7 @@ mysql_execute_command(void) res= -1; break; case SQLCOM_ROLLBACK: - thd->options&= ~OPTION_BEGIN; + thd->options&= ~(ulong) (OPTION_BEGIN); thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (!ha_rollback(thd)) send_ok(&thd->net); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f38b1a52b65..9d6742884a5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3718,7 +3718,8 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, } MI_CREATE_INFO create_info; bzero((char*) &create_info,sizeof(create_info)); - if (options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT) == OPTION_BIG_TABLES) + if ((options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) == + OPTION_BIG_TABLES) create_info.data_file_length= ~(ulonglong) 0; if ((error=mi_create(table->real_name,table->keys,&keydef, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3c7e5c3d180..7ae3b525609 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1446,7 +1446,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, mysql_bin_log.write(&qinfo); } goto end_temporary; - DBUG_RETURN(0); } intern_close_table(new_table); /* close temporary table */ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 540ae3e9a3f..bfa35750f8a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -138,7 +138,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token BOTH %token BY %token CASCADE -%token CHANGED_FILES %token CHECKSUM_SYM %token CHECK_SYM %token COLUMNS @@ -332,8 +331,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token DATE_SUB_INTERVAL %token DAY_HOUR_SYM %token DAY_MINUTE_SYM -%token DAY_OF_WEEK -%token DAY_OF_YEAR %token DAY_SECOND_SYM %token DAY_SYM %token DECODE_SYM @@ -372,7 +369,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token RIGHT %token ROUND %token SECOND_SYM -%token SEC_TO_TIME %token SUBSTRING %token SUBSTRING_INDEX %token TRIM @@ -385,8 +381,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token UNIQUE_USERS %token UNIX_TIMESTAMP %token USER -%token VERSION_SYM -%token WEEKDAY %token WEEK_SYM %token WHEN_SYM %token WORK_SYM @@ -1040,10 +1034,9 @@ alter: bzero((char*) &lex->create_info,sizeof(lex->create_info)); lex->create_info.db_type= DB_TYPE_DEFAULT; } - alter_list order_clause opt_create_table_options + alter_list alter_list: - /* empty */ | alter_list_item | alter_list ',' alter_list_item @@ -1082,7 +1075,8 @@ alter_list_item: { Lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0)); } | RENAME opt_to table_alias table_ident { Lex->db=$4->db.str ; Lex->name= $4->table.str; } - | opt_create_table_options + | create_table_options + | order_clause opt_column: /* empty */ {} @@ -1227,7 +1221,7 @@ select_into: | select_from opt_into select_from: - FROM join_table_list where_clause group_clause having_clause order_clause limit_clause procedure_clause + FROM join_table_list where_clause group_clause having_clause opt_order_clause limit_clause procedure_clause select_options: @@ -1850,9 +1844,12 @@ group_list: ** Order by statement in select */ -order_clause: +opt_order_clause: /* empty */ - | ORDER_SYM BY { Lex->sort_default=1; } order_list + | order_clause + +order_clause: + ORDER_SYM BY { Lex->sort_default=1; } order_list order_list: order_list ',' order_ident order_dir @@ -2136,7 +2133,7 @@ opt_delete_option: | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } truncate: - TRUNCATE_SYM TABLE_SYM table + TRUNCATE_SYM table { Lex->sql_command= SQLCOM_TRUNCATE; Lex->options=0; Lex->lock_option= current_thd->update_lock_default; } @@ -2241,7 +2238,7 @@ flush_options: | flush_option flush_option: - TABLES { Lex->type|= REFRESH_TABLES; } opt_table_list + table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list | TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } | HOSTS_SYM { Lex->type|= REFRESH_HOSTS; } | PRIVILEGES { Lex->type|= REFRESH_GRANT; } diff --git a/sql/unireg.cc b/sql/unireg.cc index 49f4a9fbfac..d02af0ef0d0 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -280,11 +280,11 @@ static uint pack_keys(uchar *keybuff,uint key_count,KEY *keyinfo) } /* Save keynames */ keyname_pos=pos; - *pos++=NAMES_SEP_CHAR; + *pos++=(uchar) NAMES_SEP_CHAR; for (key=keyinfo ; key != end ; key++) { uchar *tmp=(uchar*) strmov((char*) pos,key->name); - *tmp++=NAMES_SEP_CHAR; + *tmp++= (uchar) NAMES_SEP_CHAR; *tmp=0; pos=tmp; } @@ -458,7 +458,7 @@ static bool pack_fields(File file,List<create_field> &create_fields) } /* Write fieldnames */ - buff[0]=NAMES_SEP_CHAR; + buff[0]=(uchar) NAMES_SEP_CHAR; if (my_write(file,(byte*) buff,1,MYF_RW)) DBUG_RETURN(1); i=0; diff --git a/sql/unireg.h b/sql/unireg.h index 988be3d398f..c293433dd42 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -28,6 +28,7 @@ #define LANGUAGE "english/" #define ERRMSG_FILE "errmsg.sys" #define TEMP_PREFIX "MY" +#define LOG_PREFIX "ML" #define PROGDIR "bin/" #ifndef DATADIR #define DATADIR "data/" |