From 3f76925d0670544b0e0be82fd7ef1ab39c285f7f Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 15 Oct 2005 21:57:32 +0500 Subject: [PATCH 01/52] Fix for bug #13573 (wrong data inserted for too big decimals) --- mysql-test/r/type_newdecimal.result | 28 ++++++++++++-- mysql-test/t/type_newdecimal.test | 15 ++++++++ sql/item_func.cc | 12 +++--- sql/my_decimal.cc | 2 +- sql/my_decimal.h | 60 +++++++++++++++++++++-------- 5 files changed, 91 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index be5e29ab662..a99e60e5780 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -846,15 +846,14 @@ select 0/0; NULL select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x; x -999999999999999999999999999999999999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999999999999999999999999999999999 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x -NULL +100000000000000000000000000000000000000000000000000000000000000000 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1019,3 +1018,26 @@ drop procedure wg2; select cast(@non_existing_user_var/2 as DECIMAL); cast(@non_existing_user_var/2 as DECIMAL) NULL +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values(1e100); +Warnings: +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +select * from t1; +c1 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 3f04aa931d2..bfebef6207a 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1044,3 +1044,18 @@ drop procedure wg2; # select cast(@non_existing_user_var/2 as DECIMAL); + + +# +# Bug #13573 (Wrong data inserted for too big values) +# + +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +insert into t1 values(1e100); +select * from t1; +drop table t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 491243e9de7..9e92049dea4 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -972,8 +972,8 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } @@ -1045,8 +1045,8 @@ my_decimal *Item_func_minus::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } @@ -1083,8 +1083,8 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value) return 0; val2= args[1]->val_decimal(&value2); if (!(null_value= (args[1]->null_value || - my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1, - val2) > 1))) + (my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1, + val2) > 3)))) return decimal_value; return 0; } diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index f188d27ff78..1bd16940b47 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -185,7 +185,7 @@ int str2my_decimal(uint mask, const char *from, uint length, } } } - check_result(mask, err); + check_result_and_overflow(mask, err, decimal_value); return err; } diff --git a/sql/my_decimal.h b/sql/my_decimal.h index b65e6aedaa2..b02abacf0a3 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -126,6 +126,19 @@ inline int decimal_operation_results(int result) } #endif /*MYSQL_CLIENT*/ +inline +void max_my_decimal(my_decimal *to, int precision, int frac) +{ + DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& + (frac <= DECIMAL_MAX_SCALE)); + max_decimal(precision, frac, (decimal_t*) to); +} + +inline void max_internal_decimal(my_decimal *to) +{ + max_my_decimal(to, DECIMAL_MAX_PRECISION, 0); +} + inline int check_result(uint mask, int result) { if (result & mask) @@ -133,6 +146,18 @@ inline int check_result(uint mask, int result) return result; } +inline int check_result_and_overflow(uint mask, int result, my_decimal *val) +{ + if (check_result(mask, result) & E_DEC_OVERFLOW) + { + bool sign= val->sign(); + val->fix_buffer_pointer(); + max_internal_decimal(val); + val->sign(sign); + } + return result; +} + inline uint my_decimal_length_to_precision(uint length, uint scale, bool unsigned_flag) { @@ -256,7 +281,8 @@ int my_decimal2double(uint mask, const my_decimal *d, double *result) inline int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) { - return check_result(mask, string2decimal(str, (decimal_t*) d, end)); + return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), + d); } @@ -274,7 +300,7 @@ int string2my_decimal(uint mask, const String *str, my_decimal *d) inline int double2my_decimal(uint mask, double val, my_decimal *d) { - return check_result(mask, double2decimal(val, (decimal_t*) d)); + return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); } @@ -303,7 +329,9 @@ inline int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_add((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_add((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -311,7 +339,9 @@ inline int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_sub((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_sub((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -319,7 +349,9 @@ inline int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_mul((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_mul((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -327,8 +359,10 @@ inline int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc) { - return check_result(mask, decimal_div((decimal_t*) a, (decimal_t*) b, res, - div_scale_inc)); + return check_result_and_overflow(mask, + decimal_div((decimal_t*)a,(decimal_t*)b,res, + div_scale_inc), + res); } @@ -336,7 +370,9 @@ inline int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { - return check_result(mask, decimal_mod((decimal_t*) a, (decimal_t*) b, res)); + return check_result_and_overflow(mask, + decimal_mod((decimal_t*)a,(decimal_t*)b,res), + res); } @@ -347,13 +383,5 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b) return decimal_cmp((decimal_t*) a, (decimal_t*) b); } -inline -void max_my_decimal(my_decimal *to, int precision, int frac) -{ - DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& - (frac <= DECIMAL_MAX_SCALE)); - max_decimal(precision, frac, (decimal_t*) to); -} - #endif /*my_decimal_h*/ From fa56a9d5761c7d1576028b0fa28d8d2ec4896ea0 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Wed, 26 Oct 2005 11:54:15 +0500 Subject: [PATCH 02/52] Additional fix for bug #13573 --- sql/item_func.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 9e92049dea4..2b0f25a2b65 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1124,6 +1124,7 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) { my_decimal value1, *val1; my_decimal value2, *val2; + int err; val1= args[0]->val_decimal(&value1); if ((null_value= args[0]->null_value)) @@ -1131,17 +1132,15 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) val2= args[1]->val_decimal(&value2); if ((null_value= args[1]->null_value)) return 0; - switch (my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value, - val1, val2, prec_increment)) { - case E_DEC_TRUNCATED: - case E_DEC_OK: - return decimal_value; - case E_DEC_DIV_ZERO: - signal_divide_by_null(); - default: - null_value= 1; // Safety + if ((err= my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value, + val1, val2, prec_increment)) > 3) + { + if (err == E_DEC_DIV_ZERO) + signal_divide_by_null(); + null_value= 1; return 0; } + return decimal_value; } From f793d7b5bf4b8ba314d6588a0764818599e8dc58 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 27 Oct 2005 14:51:58 +0200 Subject: [PATCH 03/52] - Removed obsolete and outdated man page files from the man directory - these files are now maintained in the mysqldoc repository and included in the source distribution during the release build. Updated the configure.in script and Makefiles to create the man page file list at build time - Updated the file list in the RPM spec file to include all currently available man pages (this can not be done with wildcards, as the man pages are spread across several subpackages. However, RPM warns about unpackaged files, so newly added man pages can be spotted) --- configure.in | 4 + man/Makefile.am | 26 +-- man/isamchk.1.in | 145 --------------- man/isamlog.1.in | 107 ----------- man/mysql.1.in | 160 ---------------- man/mysql_fix_privilege_tables.1.in | 40 ---- man/mysql_zap.1.in | 52 ------ man/mysqlaccess.1.in | 125 ------------- man/mysqladmin.1.in | 209 --------------------- man/mysqld.1.in | 234 ----------------------- man/mysqld_multi.1.in | 94 ---------- man/mysqld_safe.1.in | 91 --------- man/mysqldump.1.in | 279 ---------------------------- man/{mysqlman.1.in => mysqlman.1} | 2 +- man/mysqlshow.1.in | 98 ---------- man/perror.1.in | 58 ------ man/replace.1.in | 73 -------- support-files/mysql.spec.sh | 34 +++- 18 files changed, 32 insertions(+), 1799 deletions(-) delete mode 100644 man/isamchk.1.in delete mode 100644 man/isamlog.1.in delete mode 100644 man/mysql.1.in delete mode 100644 man/mysql_fix_privilege_tables.1.in delete mode 100644 man/mysql_zap.1.in delete mode 100644 man/mysqlaccess.1.in delete mode 100644 man/mysqladmin.1.in delete mode 100644 man/mysqld.1.in delete mode 100644 man/mysqld_multi.1.in delete mode 100644 man/mysqld_safe.1.in delete mode 100644 man/mysqldump.1.in rename man/{mysqlman.1.in => mysqlman.1} (89%) delete mode 100644 man/mysqlshow.1.in delete mode 100644 man/perror.1.in delete mode 100644 man/replace.1.in diff --git a/configure.in b/configure.in index b893a234dc7..df4b0fbd5af 100644 --- a/configure.in +++ b/configure.in @@ -2202,10 +2202,14 @@ AC_ARG_WITH(man, if test "$with_man" = "yes" then man_dirs="man" + man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'` + man1_files=`echo $man1_files` else man_dirs="" + man1_files="" fi AC_SUBST(man_dirs) +AC_SUBST(man1_files) # Shall we build the bench code? AC_ARG_WITH(bench, diff --git a/man/Makefile.am b/man/Makefile.am index 539c43dfed6..9702c4b2ace 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -17,30 +17,8 @@ ## Process this file with automake to create Makefile.in -man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \ - mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \ - perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1 - -EXTRA_DIST = mysql.1.in isamchk.1.in isamlog.1.in mysql_zap.1.in \ - mysqlaccess.1.in mysqladmin.1.in mysqld.1.in mysqld_multi.1.in \ - mysqldump.1.in mysqlshow.1.in perror.1.in replace.1.in mysqlman.1.in \ - mysqld_safe.1.in mysql_fix_privilege_tables.1.in - -CLEANFILES = $(man_MANS) - -SUFFIXES = .in - -.in: - @RM@ -f $@ $@-t - @SED@ \ - -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ - -e 's!@''sysconfdir''@!@sysconfdir@!' \ - -e 's!@''bindir''@!$(bindir)!g' \ - -e 's!@''libexecdir''@!$(libexecdir)!g' \ - -e 's!@''localstatedir''@!$(localstatedir)!g' \ - -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \ - $< > $@-t - @MV@ $@-t $@ +man1_MANS = @man1_files@ +EXTRA_DIST = $(man1_MANS) # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/man/isamchk.1.in b/man/isamchk.1.in deleted file mode 100644 index d908e8af3ee..00000000000 --- a/man/isamchk.1.in +++ /dev/null @@ -1,145 +0,0 @@ -.TH isamchk 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -.BR isamchk - \- Description, check and repair of ISAM tables. -Used without options all tables on the command will be checked for errors -.SH USAGE -isamchk [OPTIONS] tables[.ISM] -.SH SYNOPSIS -.B isamchk -.RB [ \-a | \-\-analyze ] -.RB [ \-# | \-\-debug=... ] -.RB [ \-\-character\-sets\-dir=...] -.RB [ \-C | \-\-default\-character\-set=...] -.RB [ \-d | \-\-description ] -.RB [ \-e | \-\-extend\-check ] -.RB [ \-f | \-\-force ] -.RB [ \-? | \-\-help ] -.RB [ \-i | \-\-information ] -.RB [ \-k | \-\-keys\-used=# ] -.RB [ \-l | \-\-no\-symlinks] -.RB [ \-q | \-\-quick ] -.RB [ \-r | \-\-recover ] -.RB [ \-o | \-\-safe\-recover ] -.RB [ \-O | "\-\-set\-variable var=option"] -.RB [ \-s | \-\-silent ] -.RB [ \-S | \-\-sort\-index ] -.RB [ \-R | \-\-sort\-records=#] -.RB [ \-u | \-\-unpack ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] -.RB [ \-w | \-\-wait ] -.SH DESCRIPTION -.TP -.BR \-a | \-\-analyze -Analyze distribution of keys. Will make some joins in -MySQL faster. -.TP -.BR \-# | \-\-debug=... -Output debug log. Often this is 'd:t:o ,filename` -.TP -.BR \-\-character\-sets\-dir=... -Directory where character sets are -.TP -.BR \-C | \-\-default\-character\-set=... -Set the default character set -.TP -.BR \-d | \-\-description -Prints some information about table. -.TP -.BR \-e | \-\-extend\-check -Check the table VERY thoroughly. One need use this -only in extreme cases as isamchk should normally find -all errors even without this switch -.TP -.BR \-f | \-\-force -Overwrite old temporary files. -If one uses \-f when checking tables (running isamchk -without \-r), isamchk will automatically restart with -\-r on any wrong table. -.TP -.BR \-? | \-\-help -Display help and exit. -.TP -.BR \-i | \-\-information -Print statistics information about the table -.TP -.BR \-k | \-\-keys\-used=# -Used with '\-r'. Tell ISAM to update only the first -# keys. This can be used to get faster inserts! -.TP -.BR \-l | \-\-no\-symlinks -Do not follow symbolic links when repairing. Normally -isamchk repairs the table a symlink points at. -.TP -.BR \-q | \-\-quick -Used with \-r to get a faster repair. (The data file -isn't touched.) One can give a second '\-q' to force -isamchk to modify the original datafile. -.TP -.BR \-r | \-\-recover -Can fix almost anything except unique keys that aren't -unique. -.TP -.BR \-o | \-\-safe\-recover -Uses old recovery method; slower than '\-r' but can -handle a couple of cases that '\-r' cannot handle. -.TP -.BR \-O | " \-\-set\-variable var=option " -Change the value of a variable. -.TP -.BR \-s | \-\-silent -Only print errors. One can use two \-s to make isamchk -very silent -.TP -.BR \-S | \-\-sort\-index -Sort index blocks. This speeds up 'read\-next' in -applications -.TP -.BR \-R | \-\-sort\-records=# -Sort records according to an index. This makes your -data much more localized and may speed up things -(It may be VERY slow to do a sort the first time!) -.TP -.BR \-u | \-\-unpack -Unpack file packed with pack_isam. -.TP -.BR \-v | \-\-verbose -Print more information. This can be used with -\-d and \-e. Use many \-v for more verbosity! -.TP -.BR \-V | \-\-version -Print version and exit. -.TP -.BR \-w | \-\-wait -Wait if table is locked. -.SH "SEE ALSO" -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/isamlog.1.in b/man/isamlog.1.in deleted file mode 100644 index 5f69e70297a..00000000000 --- a/man/isamlog.1.in +++ /dev/null @@ -1,107 +0,0 @@ -.TH isamlog 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -isamlog - Write info about whats in a nisam log file. -.SH USAGE -isamlog [-?iruvIV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] -.SH SYNOPSIS -.B isamlog -.RB [ -? | -I ] -.RB [ -V ] -.RB [ -c ] -.RB [ -f ] -.RB [ -F ] -.RB [ -i ] -.RB [ -o ] -.RB [ "-p #" ] -.RB [ -r ] -.RB [ -R ] -.RB [ -u ] -.RB [ -v ] -.RB [ -w ] -.SH DESCRIPTION -.TP -.BR isamlog -.TP -.BR -? | -I -info -.TP -.BR -V -version -.TP -.BR -c -do only # commands -.TP -.BR -f -max open files -.TP -.BR -F -file path -.TP -.BR -i -extra info -.TP -.BR -o -offset -.TP -.BR "-p #" -remove # components from path -.TP -.BR -r -recover -.TP -.BR -R -file recordposition -.TP -.BR -u -update -.TP -.BR -v -verbose -.TP -.BR -w -write file -.SH NOTE -If no file name is given isam.log is used -One can give a second and a third '-v' for more verbose. -Normaly one does a update (-u). -If a recover is done all writes and all possibly updates and deletes is done -and errors are only counted. -If one gives table names as arguments only these tables will be updated - - - -.SH "SEE ALSO" -isamchk(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. - -.SH AUTHOR - -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - - -.\" end of man page - - diff --git a/man/mysql.1.in b/man/mysql.1.in deleted file mode 100644 index c4463aa658b..00000000000 --- a/man/mysql.1.in +++ /dev/null @@ -1,160 +0,0 @@ -.TH mysql 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysql \- text-based client for mysqld, a SQL-based relational database daemon -.SH USAGE -mysql [OPTIONS] [Database] -.SH SYNOPSIS -.B mysql -.RB [ \-B | \-\-batch ] -.RB [ \-# | \-\-debug= -.IR logfile ] -.RB [ \-T | \-\-debug-info ] -.RB [ \-e | \-\-exec= -.IR command ] -.RB [ \-f | \-\-force ] -.RB [ \-? | \-\-help ] -.RB [ \-h | \-\-host= -.IR hostname ] -.RB [ \-n | \-\-unbuffered ] -.RB [ \-p[pwd] ] -.RI [ \-\-password=[pwd] ] -.RB [ \-P | \-\-port= -.IR pnum ] -.RB [ \-q | \-\-quick ] -.RB [ \-r | \-\-raw ] -.RB [ \-s | \-\-silent ] -.RB [ \-S | \-\-socket= -.IR snum ] -.RB [ \-u | \-\-user= -.IR uname ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] -.RB [ \-w | \-\-wait ] -.SH DESCRIPTION -The -.IR mysql -program provides a curses-based interface to the SQL-based database -server daemon, -.IR mysqld (1). -Full fuller documentation, refer to the HTML documents installed with -the package. -.SH OPTIONS -.TP -.BR \-B | \-\-batch -Print results with a tab as separator, -each row on a new line. -.TP -\fB\-#\fP|\fB\-\-debug=\fP\fIlogfile\fP -Employ the specified debug log. -.TP -.BR \-T | \-\-debug-info -Print debug information upon exiting. -.TP -\fB\-e | \-\-exec=\fP\fPcommand\fP -Execute the specified command and quit -.BR ( \-\-batch -is implicit). -.TP -.BR \-f | \-\-force -Continue even if the face of a SQL error. -.TP -.BR \-? | \-\-help -Display a help message and exit. -.TP -\fB\-h\fP|\fP\-\-host=\fP\fIhostname\fP -Connect to the specified host. -.TP -.BR \-n | \-\-unbuffered -Flush the buffer after each query. -.TP -\fB\-p\fP|\fB\-\-password\fP[\fB=\fP\fIpwd\fP] -Employ the specified password when connecting to the database server. -If a password is not supplied, it will be requested interactively. -.TP -\fB\-P\fR|\fB\-\-port=\fP\fIpnum\fP -Employ the specified port number for connecting to the database server. -.TP -.BR \-q | \-\-quick -Do not cache the result; print it row by row. -This may slow down the server if the output is suspended. -.TP -.BR \-r | \-\-raw -Write fields without conversion. -(used with -.BR \-\-batch ). -.TP -.BR \-s | \-\-silent -Silent mode: reduce the amount of output. -.TP -\fB\-S\fP|\fB\-\-socket=\fP\fIsnum\fP -Employ the specified socket file for connecting to the database server. -.TP -\fB\-u\fP|\fB\-\-user=\fP\fIuname\fP -Employ the specified user name for logging in to the server. -.TP -.BR \-v | \-\-verbose -Verbose mode: write more -Specifying this option -.I twice -produces a tabular output format. -.TP -.BR \-V | \-\-version -Print the -.I mysql -version number and exit. -.TP -.BR \-w | \-\-wait -Wait and retry if the database server connection is down. -.SH FILES -.TP 2.2i -.I /etc/my.cnf -MySQL configuration file -.TP -.I @bindir@/mysql -Client executable -.TP -.I @libexecdir@/mysqld -Server executable -.TP -.I @bindir@/mysqld_safe -executable shell script for starting mysqld safely -.TP -.I @localstatedir@ -location of database files -.SH EXAMPLE -You can also read a backup dump file back into MySQL with: -.TP -.BR mysql -\fP\fIdatabase\fP -.BR < -backup-file.sql -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 6.3, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/) -This software comes with no warranty. -Manual page by R. P. C. Rodgers, -Lister Hill National Center for Biomedical Communication, -U.S. National Library of Medicine -(rodgers@nlm.nih.gov). -.\" end of man page diff --git a/man/mysql_fix_privilege_tables.1.in b/man/mysql_fix_privilege_tables.1.in deleted file mode 100644 index fe1016e8d98..00000000000 --- a/man/mysql_fix_privilege_tables.1.in +++ /dev/null @@ -1,40 +0,0 @@ -.TH mysql 1 "17 March 2003" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysql_fix_privilege_tables \- Fixes MySQL privilege tables. -.SH SYNOPSIS -mysql_fix_privilege_tables [mysql_root_password] -.SH DESCRIPTION -This scripts updates the mysql.user, mysql.db, mysql.host and the -mysql.func tables to MySQL 3.22.14 and above. - -This is needed if you want to use the new GRANT functions, -CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 - -If you get 'Access denied' errors, run the script again -and give the MySQL root user password as an argument. - -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -This manpage was written by Christian Hammers . - -MySQL is available at http://www.mysql.com/. -.\" end of man page diff --git a/man/mysql_zap.1.in b/man/mysql_zap.1.in deleted file mode 100644 index fb030427dc2..00000000000 --- a/man/mysql_zap.1.in +++ /dev/null @@ -1,52 +0,0 @@ -.TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -zap - a perl script used to kill processes -.SH USAGE -/usr/bin/mysql_zap [-signal] [-?Ift] pattern -.SH SYNOPSIS -.B zap -.RB [ \-I | \-? ] -.RB [ \-f ] -.RB [ \-t ] -.SH DESCRIPTION -.TP -.BR zap -supports by executing -.TP -.BR \-I | \-? -info -.TP -.BR \-f -force -.TP -.BR \-t -test -.SH NOTE -If -.BR -f -isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If -.BR -t -is given the processes is only shown on stdout. -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) -.\" end of man page diff --git a/man/mysqlaccess.1.in b/man/mysqlaccess.1.in deleted file mode 100644 index e0b3d314a10..00000000000 --- a/man/mysqlaccess.1.in +++ /dev/null @@ -1,125 +0,0 @@ -.TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -.BR mysqlaccess \- Create new users to mysql. -.SH USAGE -mysqlaccess [host [user [db]]] OPTIONS -.SH SYNOPSIS -.B mysqlaccess -.RB [ \-? | \-\-help ] -.RB [ \-v | \-\-version ] -.RB [ \-p | \-\-password=# ] -.RB [ \-h | \-\-host=# ] -.RB [ \-d | \-\-db=# ] -.RB [ \-U | \-\-superuser=# ] -.RB [ \-P | \-\-spassword=# ] -.RB [ \-H | \-\-rhost=# ] -.RB [ \-\-old_server ] -.RB [ \-b | \-\-brief ] -.RB [ \-t | \-\-table ] -.RB [ \-\-relnotes] -.RB [ \-\-plan ] -.RB [ \-\-howto ] -.RB [ \-\-debug=N ] -.RB [ \-\-copy ] -.RB [ \-\-preview ] -.RB [ \-\-commit ] -.RB [ \-\-rollback ] -.SH DESCRIPTION -.TP -.BR \-? | \-\-help -display this helpscreen and exit -.TP -.BR \-v | \-\-version -print information on the program `mysqlaccess' -.TP -.BR \-u | \-\-user=# -username for logging in to the db -.TP -.BR \-p | \-\-password=# -validate password for user -.TP -.BR \-h | \-\-host=# -name or IP\-number of the host -.TP -.BR \-d | \-\-db=# -name of the database -.TP -.BR \-U | \-\-superuser=# -connect as superuser -.TP -.BR \-P | \-\-spassword=# -password for superuser -.TP -.BR \-H | \-\-rhost=# -remote MySQL\-server to connect to -.TP -.BR \-\-old_server -connect to old MySQL\-server (before v3.21) which -does not yet know how to handle full where clauses. -.TP -.BR \-b | \-\-brief -single\-line tabular report -.TP -.BR \-t | \-\-table -report in table\-format -.TP -.BR \-\-relnotes -print release\-notes -.TP -.BR \-\-plan -print suggestions/ideas for future releases -.TP -.BR \-\-howto -some examples of how to run `mysqlaccess' -.TP -.BR \-\-debug=N -enter debuglevel N (0..3) -.TP -.BR \-\-copy -reload temporary grant\-tables from original ones -.TP -.BR \-\-preview -show differences in privileges after making -changes in (temporary) grant\-tables -.TP -.BR \-\-commit -copy grant\-rules from temporary tables to grant\-tables -(!don't forget to do an mysqladmin reload) -.TP -.BR \-\-rollback -undo the last changes to the grant\-tables. -.SH NOTE -At least the user and the db must be given (even with wildcards) -If no host is given, `localhost' is assumed -Wildcards (*,?,%,_) are allowed for host, user and db, but be sure -to escape them from your shell!! (i.e., type \\* or '*') -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/mysqladmin.1.in b/man/mysqladmin.1.in deleted file mode 100644 index e62cb32dc78..00000000000 --- a/man/mysqladmin.1.in +++ /dev/null @@ -1,209 +0,0 @@ -.TH mysqladmin 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME - mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations -.SH OPTION SYNOPSIS -.B mysqladmin -.RB [ \-# | \-\-debug= -.IR logfile ] -.RB [ \-f | \-\-force ] -.RB [ \-? | \-\-help ] -.BR [ --character-sets-dir=\fP\fIdirectory\fP ] -.RB [ \-C | \-\-compress ] -.RB [ \-h | \-\-host=[#] ] -.RB [ \-p[pwd] ] -.RI [ \-\-password=[pwd] ] -.RB [ \-P | \-\-port= -.IR pnum ] -.RB [ \-i | \-\-sleep= -.IR sec ] -.RB [ \-E | \-\-vertical ] -.RB [ \-s | \-\-silent ] -.RB [ \-S | \-\-socket= -.IR # ] -.RB [ \-r | \-\-relative ] -.RB [ \-t | \-\-timeout= -.IR # ] -.RB [ \-u | \-\-user= -.IR uname ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] -.RB [ \-w | \-\-wait[=retries] ] -.SH OPTION DESCRIPTION -You can get a list of the options your version of -.IR mysqladmin -supports by executing -.BR "mysqladmin \-\-help" -.SH OPTIONS -.TP -.BR \-# | \-\-debug=\fP\fIlogfile\fP -Output debug log. Often this is 'd:t:o,filename` -.TP -.BR \-f | \-\-force -Don't ask for confirmation on drop database; with -multiple commands, continue even if an error occurs -.TP -.BR \-? | \-\-help - Display help and exit -.TP -.BR --character-sets-dir=\fP\fIdirectory\fP -Set the character set directory -.TP -.BR \-C | \-\-compress -Use compression in server/client protocol -.TP -\fB\-h\fP|\fP\-\-host=\fP\fIhostname\fP -Connect to host -.TP -\fB\-p\fP|\fB\-\-password\fP[\fB=\fP\fIpwd\fP] -Password to use when connecting to server -If password is not given it's asked from the tty -.TP -\fB\-P\fR|\fB\-\-port=\fP\fIpnum\fP -Port number to use for connection -.TP -\fB\-i\fR|\fB\-\-sleep=\fP\fIsec\fP -Execute commands again and again with a sleep between -.TP -.BR \-r | \-\-relative -Show difference between current and previous values -when used with -.BR -i -. Currently works only with -extended-status -.TP -.BR \-E | \-\-vertical -Print output vertically. Is similar to -.BR --relative, -but prints output vertically. -.TP -.BR \-s | \-\-silent -Silently exit if one can't connect to server -.TP -\fB\-S\fR|\fB\-\-socket=\fP\fIfile\fP -Socket file to use for connection -.TP -\fB\-t\fR|\fB\-\-timeout=\fP\fIsec\fP -Timeout for connection to the mysqld server -.TP -\fB\-u\fP|\fB\-\-user=\fP\fIuname\fP -User for login if not current user -.TP -.BR \-v | \-\-verbose -Write more information -.TP -.BR \-V | \-\-version -Output version information and exit -.TP -.BR \-w | \-\-wait - Wait and retry if connection is down -.SH COMMAND SYNOPSIS -.B MySQLADMIN -.RB [ "create \fP\fIdatabasename\fP "] -.RB [ "drop \fP\fIdatabasename\fP" ] -.RB [ extended-status ] -.RB [ flush-hosts ] -.RB [ flush-logs ] -.RB [ flush-tables ] -.RB [ flush-privileges ] -.RB [ " kill id,id,... " ] -.RB [ "password \fP\fInew-password\fP "] -.RB [ ping ] -.RB [ processlist ] -.RB [ reload ] -.RB [ refresh ] -.RB [ shutdown ] -.RB [ slave-start ] -.RB [ slave-stop ] -.RB [ status ] -.RB [ variables ] -.RB [ version ] - -.SH COMMANDS -Where command is a one or more of: (Commands may be shortened) -.TP -.BR "create databasename" -Create a new database -.TP -.BR "drop databasename" -Delete a database and all its tables -.TP -.BR extended-status -Gives an extended status message from the server -.TP -.BR flush-hosts -Flush all cached hosts -.TP -.BR flush-logs -Flush all logs -.TP -.BR flush-status -Clear status variables -.TP -.BR flush-tables -Flush all tables -.TP -.BR flush-threads -Flush the thread cache -.TP -.BR flush-privileges -Reload grant tables (same as reload) -.TP -.BR "kill id,id,..." -Kill mysql threads -.TP -.BR "password \fP\fInew-password\fP" -Change old password to new-password -.TP -.BR ping -Check if mysqld is alive -.TP -.BR processlist -Show list of active threads in server -.TP -.BR reload -Reload grant tables -.TP -.BR refresh -Flush all tables and close and open logfiles -.TP -.BR shutdown -Take server down -.TP -.BR status -Gives a short status message from the server -.TP -.BR variables -Prints variables available -.TP -.BR version -Get version info from server -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) -.\" end of man page - diff --git a/man/mysqld.1.in b/man/mysqld.1.in deleted file mode 100644 index 73f07337f25..00000000000 --- a/man/mysqld.1.in +++ /dev/null @@ -1,234 +0,0 @@ -.TH mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysqld \- The MySQL server demon -.SH USAGE -mysqld [OPTIONS] -.SH SYNOPSIS -.B mysqld -.RB [ \-\-ansi ] -.RB [ \-b | \-\-basedir=\fP\fIpath\fP ] -.RB [ \-\-big-tables ] -.RB [ \-\-bind\-address=IP ] -.RB [ \-\-character\-sets\-dir=\fP\fIpath\fP ] -.RB [ \-\-chroot=\fP\fIpath\fP ] -.RB [ \-h | \-\-datadir=\fP\fIpath\fP ] -.RB [ \-\-default\-character\-set=\fP\fIcharset\fP ] -.RB [ \-\-default\-table\-type=\fP\fItype \fP] -.RB [ \-\-delay\-key\-write\-for\-all\-tables ] -.RB [ \-\-enable\-locking ] -.RB [ \-T | \-\-exit\-info] -.RB [ \-\-flush ] -.RB [ \-? | \-\-help ] -.RB [ \-\-init\-file=file ] -.RB [ \-L | \-\-language=... ] -.RB [ \-l | \-\-log[=file] ] -.RB [ \-\-log\-isam[=file] ] -.RB [ \-\-log\-slow\-queries\fP\fI[=file]\fP ] -.RB [ \-\-log\-update\fP\fI[=file]\fP ] -.RB [ \-\-log\-long\-format ] -.RB [ \-\-low\-priority\-updates ] -.RB [ \-\-memlock ] -.RB [ " \-\-myisam\-recover [=option[,option...]]] where option is one of DEFAULT, BACKUP, FORCE or QUICK." ] -.RB [ \-\-pid\-file=\fP\fIpath\fP ] -.RB [ \-P | \-\-port=... ] -.RB [ \-o | \-\-old\-protocol ] -.RB [ \-\-one\-thread ] -.RB [ \-O | \-\-set\-variable var=\fP\fIoption\fP ] -.RB [ \-Sg | \-\-skip\-grant\-tables ] -.RB [ \-\-safe\-mode ] -.RB [ \-\-secure ] -.RB [ \-\-skip\-concurrent\-insert ] -.RB [ \-\-skip\-delay\-key\-write ] -.RB [ \-\-skip\-locking ] -.RB [ \-\-skip\-name\-resolve ] -.RB [ \-\-skip\-networking ] -.RB [ \-\-skip\-new ] -.RB [ \-\-skip\-host\-cache ] -.RB [ \-\-skip\-show\-database ] -.RB [ \-\-skip\-thread\-priority ] -.RB [ \-\-socket=path ] -.RB [ \-t | \-\-tmpdir=\fP\fIpath \fP] -.RB [ \-u | \-\-user=\fP\fIuser_name\fP ] -.RB [ \-V | \-\-version ] -.SH DESCRIPTION -.TP -.BR --ansi -Use ANSI SQL syntax instead of MySQL syntax. See section 5.2 Running MySQL in ANSI Mode. -.TP -.BR -b | --basedir=\fP\fIpath \fP -Path to installation directory. All paths are usually resolved relative to this. -.TP -.BR --big-tables -Allow big result sets by saving all temporary sets on file. It solves most 'table full' errors, but also slows down the queries where in\-memory tables would suffice. Since Version 3.23.2, MySQL is able to solve it automaticaly by using memory for small temporary tables and switching to disk tables where necessary. -.TP -.BR \-\-bind\-address=\fP\fIIP \fP -IP address to bind to. -.TP -.BR \-\-character\-sets\-dir=\fP\fIpath \fP -Directory where character sets are. See section 10.1.1 The Character Set Used for Data and Sorting. -.TP -.BR \-\-chroot=\fP\fIpath \fP -Chroot mysqld daemon during startup. Recommended security measure. It will somewhat limit LOAD DATA INFILE and SELECT ... INTO OUTFILE though. -.TP -.BR \-h | \-\-datadir=\fP\fIpath \fP -Path to the database root. -.TP -.BR \-\-default\-character\-set=\fP\fIcharset \fP -Set the default character set. See section 10.1.1 The Character Set Used for Data and Sorting. -.TP -.BR \-\-default\-table\-type=\fP\fItype \fP -Set the default table type for tables. See section 8 MySQL Table Types. -.TP -.BR \-\-delay\-key\-write\-for\-all\-tables -Don't flush key buffers between writes for any MyISAM table. See Mysql Manual section 12.2.3 Tuning Server Parameters. -.TP -.BR \-\-enable\-locking -Enable system locking. -.TP -.BR \-T | \-\-exit\-info -Print some debug info at exit. -.TP -.BR \-\-flush -Flush all changes to disk after each SQL command. Normally MySQL only does a write of all changes to disk after each SQL command and lets the operating system handle the syncing to disk. See section 20.2 What to Do if MySQL Keeps Crashing. -.TP -.BR \-? | \-\-help -Display short help and exit. -.TP -.BR \-\-init\-file=\fP\fIfile \fP -Read SQL commands from this file at startup. -.TP -.BR \-L | \-\-language=... -Client error messages in given language. May be given as a full path. See Mysql Manual section 10.1 What Languages Are Supported by MySQL?. -.TP -.BR \-l | \-\-log\fP\fI[=file] \fP -Log connections and queries to file. -.TP -.BR \-\-log\-isam\fP\fI[=file] \fP -Log all ISAM/MyISAM changes to file (only used when debugging ISAM/MyISAM). -.TP -.BR \-\-log\-slow\-queries\fP\fI[=file] \fP -Log all queries that have taken more than long_query_time seconds to execute to file. See Mysql Manual section 21.5 The Slow Query Log. -.TP -.BR \-\-log\-update\fP\fI[=file] \fP -Log updates to file.# where # is a unique number if not given. See Mysql Manual section 21.3 The Update Log. -.TP -.BR \-\-log\-long\-format -Log some extra information to update log. If you are using -.BR \-\-log\-slow\-queries -then queries that are not using indexes are logged to the slow query log. -.TP -.BR \-\-low\-priority\-updates -Table\-modifying operations (INSERT/DELETE/UPDATE) will have lower priority than selects. It can also be done via {INSERT | REPLACE | UPDATE | DELETE} LOW_PRIORITY ... to lower the priority of only one query, or by SET OPTION SQL_LOW_PRIORITY_UPDATES=1 to change the priority in one thread. See Mysql Manual section 12.2.9 Table Locking Issues. -.TP -.BR \-\-memlock -Lock the mysqld process in memory. This works only if your system supports the mlockall() system call. This may help if you have a problem where the operating system is causing mysqld to swap on disk. -.TP -.BR " \-\-myisam\-recover [=option[,option...]]] where option is one of DEFAULT, BACKUP, FORCE or QUICK. " -If this option is used, mysqld will on open check if the table is marked as crashed or if if the table wasn't closed properly (The last option only works if you are running with \-\-skip\-locking). If this is the case mysqld will run check on the table. If the table was corrupted, mysqld will attempt to repair it. The following options affects how the repair works. -.BR DEFAULT -The same as not giving any option to \-\-myisam\-recover. -.BR BACKUP -If the data table was changed during recover, save a backup of the `table_name.MYD' data file as `table_name\-datetime.BAK'. -.BR FORCE -Run recover even if we will loose more than one row from the .MYD file. -.BR QUICK -Don't check the rows in the table if there isn't any delete blocks. -Before a table is automaticly repaired, mysqld will add a note about this in the error log. If you want to be able to recover from most things without user intervention, you should use the options BACKUP,FORCE. This will force a repair of a table even if some rows would be deleted, but it will keep the old data file as a backup so that you can later examine what happened. -.TP -.BR \-\-pid\-file=\fP\fIpath \fP -Path to pid file used by mysqld_safe. -.TP -.BR \-P | \-\-port=... -Port number to listen for TCP/IP connections. -.TP -.BR \-o | \-\-old\-protocol -Use the 3.20 protocol for compatibility with some very old clients. See Mysql Manual section 4.17.3 Upgrading from Version 3.20 to Version 3.21. -.TP -.BR \-\-one\-thread -Only use one thread (for debugging under Linux). See Mysql Manual section H.1 Debugging a MySQL server. -.TP -.BR \-O | " \-\-set\-variable var=\fP\fIoption\fP " -Give a variable a value. \-\-help lists variables. You can find a full description for all variables in the SHOW VARIABLES section in this manual. See Mysql Manual section 7.28.4 SHOW VARIABLES. The tuning server parameters section includes information of how to optimize these. See Mysql Manual section 12.2.3 Tuning Server Parameters. -.TP -.BR \-Sg | \-\-skip\-grant\-tables -This option causes the server not to use the privilege system at all. This gives everyone full access to all databases! (You can tell a running server to start using the grant tables again by executing mysqladmin flush\-privileges or mysqladmin reload.) -.TP -.BR \-\-safe\-mode -Skip some optimize stages. Implies -.BR \-\-skip\-delay\-key\-write. -.TP -.BR \-\-secure -IP numbers returned by the gethostbyname() system call are checked to make sure they resolve back to the original hostname. This makes it harder for someone on the outside to get access by pretending to be another host. This option also adds some sanity checks of hostnames. The option is turned off by default in MySQL Version 3.21 because sometimes it takes a long time to perform backward resolutions. MySQL Version 3.22 caches hostnames (unless \-\-skip\-host\-cache is used) and has this option enabled by default. -.TP -.BR \-\-skip\-concurrent\-insert -Turn off the ability to select and insert at the same time on MyISAM tables. (This is only to be used if you think you have found a bug in this feature). -.TP -.BR \-\-skip\-delay\-key\-write -Ignore the delay_key_write option for all tables. See Mysql Manual section 12.2.3 Tuning Server Parameters. -.TP -.BR \-\-skip\-locking -Don't use system locking. To use isamchk or myisamchk you must shut down the server. See Mysql Manual section 1.6 How Stable Is MySQL?. Note that in MySQL Version 3.23 you can use REPAIR and CHECK to repair/check MyISAM tables. -.TP -.BR \-\-skip\-name\-resolve -Hostnames are not resolved. All Host column values in the grant tables must be IP numbers or localhost. -.TP -.BR \-\-skip\-networking -Don't listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. However, this option is unsuitable for systems that use MIT\-pthreads, because the MIT\-pthreads package doesn't support Unix sockets. -.TP -.BR \-\-skip\-new -Don't use new, possible wrong routines. Implies -.BR \-\-skip\-delay\-key\-write -. This will also set default table type to ISAM. See Mysql Manual section 8.3 ISAM Tables. -.TP -.BR \-\-skip\-host\-cache -Never use host name cache for faster name\-ip resolution, but query DNS server on every connect instead. -.TP -.BR \-\-skip\-show\-database -Don't allow 'SHOW DATABASE' commands, unless the user has process privilege. -.TP -.BR \-\-skip\-thread\-priority -Disable using thread priorities for faster response time. -.TP -.BR \-\-socket=\fP\fIpath \fP -Socket file to use for local connections instead of default /tmp/mysql.sock. -.TP -.BR \-t | \-\-tmpdir=\fP\fIpath\fP -Path for temporary files. It may be useful if your default /tmp directory resides on a partition too small to hold temporary tables. -.TP -.BR \-u | \-\-user=\fP\fIuser_name \fP -Run mysqld daemon as user user_name. This option is mandatory when starting mysqld as root. -.TP -.BR \-V | \-\-version -Output version information and exit. - -.SH NOTE -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/mysqld_multi.1.in b/man/mysqld_multi.1.in deleted file mode 100644 index 58e5c71d01d..00000000000 --- a/man/mysqld_multi.1.in +++ /dev/null @@ -1,94 +0,0 @@ -.TH mysqld_multi 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports. -.SH USAGE -mysqld_multi [OPTIONS] {start|stop|report} [GNR,GNR,GNR...] -.SH SYNOPSIS -.B mysqld_multi -.RB [ --config-file=... ] -.RB [ --example ] -.RB [ --help ] -.RB [ --log=... ] -.RB [ --mysqladmin=... ] -.RB [ --mysqld=... ] -.RB [ --no-log ] -.RB [ --password=... ] -.RB [ --tcp-ip ] -.RB [ --user=... ] -.RB [ --version ] -.SH DESCRIPTION -.TP -.BR mysqld_multi -.TP -.BR --config-file=... -Alternative config file. NOTE: This will not affect this program\'s own options (group [mysqld_multi]), but only groups [mysqld#]. Without this option everything will be searched from the ordinary my.cnf file. -.TP -.BR --example -Give an example of a config file. -.TP -.BR --help -Print this help and exit. -.TP -.BR --log=... -Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended. -.TP -.BR --mysqladmin=... -mysqladmin binary to be used for a server shutdown. -.TP -.BR --mysqld=... -mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just make sure you have mysqld in your environment variable PATH or fix mysqld_safe. -.TP -.BR --no-log -Print to stdout instead of the log file. By default the log file is turned on. -.TP -.BR --password=... -Password for user for mysqladmin. -.TP -.BR --tcp-ip -Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket. -.TP -.BR --user=... -MySQL user for mysqladmin. -.TP -.BR --version -Print the version number and exit. -.SH NOTE -Please see the mysql manual for more detailed information on this. - - - -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. - -.SH AUTHOR - -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - - -.\" end of man page - - diff --git a/man/mysqld_safe.1.in b/man/mysqld_safe.1.in deleted file mode 100644 index 5aabd232a11..00000000000 --- a/man/mysqld_safe.1.in +++ /dev/null @@ -1,91 +0,0 @@ -.TH safe_mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysqld_safe \- start the mysqld daemon on Unix. -.SH SYNOPSIS -.B mysqld_safe -.RB [ \-\-basedir=\fP\fIpath\fP ] -.RB [ \-\-core\-file\-size=# ] -.RB [ \-\-defaults\-extra\-file=\fP\fIpath\fP ] -.RB [ \-\-defaults\-file=\fP\fIpath\fP ] -.RB [ \-\-open\-files=# ] -.RB [ \-\-datadir=\fP\fIpath\fP ] -.RB [ \-\-err\-log=\fP\fIpath \fP] -.RB [ \-\-ledir=path ] -.RB [ \-\-log=\fP\fIpath\fP ] -.RB [ \-\-no\-defaults ] -.RB [ \-\-open\-files=# ] -.RB [ \-\-pid\-file=\fP\fIpath\fP ] -.RB [ \-\-port=# ] -.RB [ \-\-socket=\fP\fIpath\fP ] -.RB [ \-\-timezone=# ] -.RB [ \-\-user=# ] -.SH DESCRIPTION -mysqld_safe adds some safety features such as restarting the server when an -error occurs and logging run-time information to a log file. -.BR -.TP -.BR \-\-basedir=\fP\fIpath \fP -.TP -.BR \-\-core\-file\-size=# -Size of the core file mysqld should be able to create. Passed to ulimit \-c. -.TP -.BR \-\-defaults\-extra\-file=\fP\fIpath \fP -.TP -.BR \-\-defaults\-file=\fP\fIpath \fP -.TP -.BR \-\-datadir=\fP\fIpath \fP -.TP -.BR \-\-err\-log=\fP\fIpath \fP -.TP -.BR \-\-ledir=\fP\fIpath \fP -Path to mysqld -.TP -.BR \-\-log=\fP\fIpath \fP -.TP -.BR \-\-no\-defaults -.TP -.BR \-\-open\-files=# -Number of files mysqld should be able to open. Passed to ulimit \-n. -.TP -.BR \-\-pid\-file=\fP\fIpath \fP -.TP -.BR \-\-port=# -.TP -.BR \-\-socket=\fP\fIpath \fP -.TP -.BR \-\-timezone=# -Set the timezone (the TZ) variable to the value of this parameter. -.TP -.BR \-\-user=# -.SH NOTE -Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file. -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/mysqldump.1.in b/man/mysqldump.1.in deleted file mode 100644 index 0f581429af7..00000000000 --- a/man/mysqldump.1.in +++ /dev/null @@ -1,279 +0,0 @@ -.TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -mysqldump \- text\-based client for dumping or backing up mysql databases, tables and or data. - -.SH USAGE -.BR "mysqldump [\fP\fIOPTIONS\fP] database [\fP\fItables\fP]" -.TP -OR -.BR "mysqldump [\fP\fIOPTIONS\fP] \-\-databases [\fP\fIOPTIONS\fP] DB1 [\fP\fIDB2 DB3...\fP]" -.TP -OR -.BR "mysqldump [\fP\fIOPTIONS\fP] \-\-all-databases [\fP\fIOPTIONS\fP]" - -.SH OPTION SYNOPSIS -.B mysqldump -.RB [ \-A | \-\-all-databases ] -.RB [ \-a | \-\-all ] -.RB [ \-# | \-\-debug=... ] -.RB [ \-\-character-sets-dir=...] -.RB [ \-? | \-\-help ] -.RB [ \-B | \-\-databases ] -.RB [ \-c | \-\-complete-insert ] -.RB [ \-C | \-\-compress ] -.RB [ \-\-default-character-set=...] -.RB [ \-e | \-\-extended-insert ] -.RB [ \-\-add-drop-table ] -.RB [ \-\-add-locks ] -.RB [ \-\-allow-keywords ] -.RB [ \-\-delayed-insert ] -.RB [ \-F | \-\-flush-logs ] -.RB [ \-f | \-\-force ] -.RB [ \-h | \-\-host=... ] -.RB [ \-l | \-\-lock-tables ] -.RB [ \-n | \-\-no-create-db ] -.RB [ \-t | \-\-no-create-info ] -.RB [ \-d | \-\-no-data ] -.RB [ \-O | \-\-set-variable var=\fP\fIoption\fP ] -.RB [ \-\-opt ] -.RB [ \-p | \-\-password\fP\fI[=...]\fP ] -.RB [ \-P | \-\-port=... ] -.RB [ \-q | \-\-quick ] -.RB [ \-Q | \-\-quote-names ] -.RB [ \-S | \-\-socket=... ] -.RB [ \-\-tables ] -.RB [ \-T | \-\-tab=... ] -.RB [ \-u | \-\-user=# ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] -.RB [ \-w | \-\-where= ] -.RB [ \-\-delayed ] -.RB [ \-e | \-\-extended-insert ] -.RB [ \-\-fields\-terminated\-by=... ] -.RB [ \-\-fields\-enclosed\-by=... ] -.RB [ \-\-fields-optionally\-enclosed\-by=... ] -.RB [ \-\-fields\-escaped\-by=... ] -.RB [ \-\-lines\-terminated\-by=... ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] -.RB [ "\-O net_buffer_length=#, where # < 16M" ] -.SH DESCRIPTION -Dumping definition and data mysql database or table -.IR mysqldump -supports by executing -.TP -.BR \-A | \-\-all\-databases -Dump all the databases. This will be same as -.BR \-\-databases -with all databases selected. -.TP -.BR \-a | \-\-all -Include all MySQL specific create options. -.TP -.BR \-# | \-\-debug=... -Output debug log. Often this is 'd:t:o,filename`. -.TP -.BR \-\-character\-sets\-dir=... -Directory where character sets are -.TP -.BR \-? | \-\-help -Display this help message and exit. -.TP -.BR \-B | \-\-databases -To dump several databases. Note the difference in -usage; In this case no tables are given. All name -arguments are regarded as databasenames. -'USE db_name;' will be included in the output -.TP -.BR \-c | \-\-complete\-insert -Use complete insert statements. -.TP -.BR \-C | \-\-compress -Use compression in server/client protocol. -.TP -.BR \-\-default\-character\-set=... -Set the default character set -.TP -.BR \-e | \-\-extended\-insert -Allows utilization of the new, much faster -INSERT syntax. -.TP -.BR \-\-add\-drop\-table -Add a 'drop table' before each create. -.TP -.BR \-\-add\-locks -Add locks around insert statements. -.TP -.BR \-\-allow\-keywords -Allow creation of column names that are keywords. -.TP -.BR \-\-delayed\-insert -Insert rows with INSERT DELAYED. -.TP -.BR \-F | \-\-flush\-logs -Flush logs file in server before starting dump. -.TP -.BR \-f | \-\-force -Continue even if we get an sql\-error. -.TP -.BR \-h | \-\-host=... -Connect to host. -.TP -.BR \-l | \-\-lock\-tables -Lock all tables for read. -.TP -.BR \-n | \-\-no\-create\-db -\&'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' -will not be put in the output. The above line will -be added otherwise, if -.BR \-\-databases -or -.BR \-\-all\-databases -option was given. -.TP -.BR \-t | \-\-no\-create\-info -Don't write table creation info. -.TP -.BR \-d | \-\-no\-data -No row information. -.TP -.BR \-O | "\-\-set\-variable var=option" -give a variable a value. -.BR \-\-help -lists variables -.TP -.BR \-\-opt -Same as -.BR " \-\-add\-drop\-table \-\-add\-locks \-\-all \-\-extended\-insert \-\-quick \-\-lock\-tables " -.TP -.BR \-p | \-\-password[=...] -Password to use when connecting to server. -If password is not given it's solicited on the tty. -.TP -.BR \-P | \-\-port=... -Port number to use for connection. -.TP -.BR \-q | \-\-quick -Don't buffer query, dump directly to stdout. -.TP -.BR \-Q | \-\-quote\-names -Quote table and column names with ` -.TP -.BR \-S | \-\-socket=... -Socket file to use for connection. -.TP -.BR \-\-tables -\fP\fIOverrides \fPoption -.BR \-\-databases (\-B). -.TP -.BR \-T | \-\-tab=... -Creates tab separated textfile for each table to -given path. (creates .sql and .txt files). -NOTE: This only works if mysqldump is run on -the same machine as the mysqld daemon. -.TP -.BR \-u | \-\-user=# -User for login if not current user. -.TP -.BR \-v | \-\-verbose -Print info about the various stages. -.TP -.BR \-V | \-\-version -Output version information and exit. -.TP -.BR \-w | \-\-where= -dump only selected records; QUOTES mandatory! -.TP -.BR \-\-delayed -Insert rows with the INSERT DELAYED command. -.TP -.BR \-e | \-\-extended-insert -Use the new multiline INSERT syntax. (Gives more compact and faster inserts statements.) -.TP -.BR \-\-fields\-terminated\-by=... -.TP -.BR \-\-fields\-enclosed\-by=... -.TP -.TP -.BR \-\-fields-optionally\-enclosed\-by=... -.TP -.BR \-\-fields\-escaped\-by=... -.TP -.BR \-\-lines\-terminated\-by=... -These options are used with the -.BR -T -option and have the same meaning as the corresponding clauses for LOAD DATA INFILE. See Mysql manual section 7.23 LOAD DATA INFILE Syntax. -.TP -.BR \-v | \-\-verbose -Verbose mode. Print out more information on what the program does. -.TP -.BR \-V | \-\-version -Print version information and exit. -.TP -.BR "\-O net_buffer_length=#, where # < 16M " -When creating multi-row-insert statements (as with option -.BR --extended-insert -or -.BR --opt -), mysqldump will create rows up to net_buffer_length length. If you increase this variable, you should also ensure that the max_allowed_packet variable in the MySQL server is bigger than the net_buffer_length. -.SH EXAMPLES -.TP -The most normal use of mysqldump is probably for making a backup of whole -databases. See the section on Database Backups in the MySQL Reference Manual. -.TP -mysqldump \-\-opt \fP\fIdatabase\fP > backup-file.sql -.TP -You can read this back into MySQL with: -.TP -.BR mysql -\fP\fIdatabase\fP -.BR < -backup-file.sql -.TP -or -.TP -.BR mysql -\-e 'source /patch\-to\-backup/backup\-file.sql' database -.TP -However, it's also very useful to populate another MySQL server with information from a database: -.TP -mysqldump \-\-opt \fP\fIdatabase\fP | mysql \-\-host=\fP\fIremote\-host\fP \-C database -.TP -It is possible to dump several databases with one command: -.TP -mysqldump \-\-databases database1 [ database2 database3... ] > my_databases.sql -.TP -If all the databases are wanted, one can use: -.TP -mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql - -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/mysqlman.1.in b/man/mysqlman.1 similarity index 89% rename from man/mysqlman.1.in rename to man/mysqlman.1 index b09b01ca759..2170942ebd9 100644 --- a/man/mysqlman.1.in +++ b/man/mysqlman.1 @@ -1,4 +1,4 @@ -.TH mysqlman 1 "20 July 2004" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" +.TH mysqlman 1 "20 July 2004" "MySQL" "MySQL database" .SH NAME mysqlman \- default man page for mysql .SH "DESCRIPTION" diff --git a/man/mysqlshow.1.in b/man/mysqlshow.1.in deleted file mode 100644 index 2db79ae070e..00000000000 --- a/man/mysqlshow.1.in +++ /dev/null @@ -1,98 +0,0 @@ -.TH mysqlshow 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -.BR mysqlshow - \- Shows the structure of a mysql database (databases,tables and columns) -.SH USAGE -shell> mysqlshow [\fP\fIOPTIONS\fP] [\fP\fIdatabase [table [column]]\fP] -.SH SYNOPSIS -.B mysqlshow -.RB [ \-# | \-\-debug=...] -.RB [ \-? | \-\-help ] -.RB [ \-c | \-\-character\-sets\-dir=...] -.RB [ \-C | \-\-compress ] -.RB [ \-h | \-\-host=... ] -.RB [ \-i | \-\-status ] -.RB [ \-k | \-\-keys ] -.RB [ \-p | \-\-password\fP\fI[=...]\fP ] -.RB [ \-P | \-\-port=... ] -.RB [ \-S | \-\-socket=... ] -.RB [ \-u | \-\-user=# ] -.RB [ \-V | \-\-version ] -.SH DESCRIPTION -.TP -.BR \-# | \-\-debug=... -output debug log. Often this is 'd:t:o,filename` -.TP -.BR \-? | \-\-help -display help and exit -.TP -.BR \-c | \-\-character\-sets\-dir=... -Directory where character sets are -.TP -.BR \-C | \-\-compress -Use compression in server/client protocol -.TP -.BR \-h | \-\-host=... -connect to host -.TP -.BR \-i | \-\-status -Shows a lot of extra information about each table -.TP -.BR \-k | \-\-keys -show keys for table -.TP -.BR \-p | \-\-password \fP\fI[=...] \fP -password to use when connecting to server -If password is not given it's asked from the tty. -.TP -.BR \-P | \-\-port=... -Port number to use for connection -.TP -.BR \-S | \-\-socket=... -Socket file to use for connection -.TP -.BR \-u | \-\-user=# -user for login if not current user -.TP -.BR \-V | \-\-version -output version information and exit - - -.SH NOTE -If last argument contains a shell or SQL wildcard (*,?,% or _) then only -what's matched by the wildcard is shown. -If no database is given then all matching databases are shown. -If no table is given then all matching tables in database are shown -If no column is given then all matching columns and columntypes in table -are shown - -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysql_zap(1), -perror(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/perror.1.in b/man/perror.1.in deleted file mode 100644 index 45b343a9c3f..00000000000 --- a/man/perror.1.in +++ /dev/null @@ -1,58 +0,0 @@ -.TH perror 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -perror \- describes a system or MySQL error code. -.SH SYNOPSIS -perror [OPTIONS] [ERRORCODE [ERRORCODE...]] -.SH DESCRIPTION -Can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. -The error messages are mostly system dependent. -.SH OPTIONS -.TP -.BR \-? | \-\-help -Displays this help and exits. -.TP -.BR \-I | \-\-info -Synonym for the above. -.TP -.BR \-s | \-\-silent -Only print the error message -.TP -.BR \-v | \-\-verbose -Print error code and message (default). -.TP -.BR \-V | \-\-version -Displays version information and exits. -.SH EXAMPLE -shell> perror 64 79 -Error code 64: Machine is not on the network -Error code 79: Can not access a needed shared library -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -replace(1) -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) - -.\" end of man page diff --git a/man/replace.1.in b/man/replace.1.in deleted file mode 100644 index 618ed0f5bea..00000000000 --- a/man/replace.1.in +++ /dev/null @@ -1,73 +0,0 @@ -.TH replace 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" -.SH NAME -.TP -replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings. -.SH USAGE -replace [-?svIV] from to from to ... -- [files] -.TP -or -.TP -replace [-?svIV] from to from to ... < fromfile > tofile -.SH SYNOPSIS -.B replace -.RB [ -? | -I ] -.RB [ -s ] -.RB [ -v ] -.SH DESCRIPTION -.TP -.BR replace -.TP -.BR -? | -I -info -.TP -.BR -s -silent -.TP -.BR -v -verbose -.SH EXTRA INFO -.B Special characters in from string: -.TP -\\^ -Match start of line. -.TP -\\$ -Match end of line. -.TP -\\b -Match space-character, start of line or end of line. For a end \\b the next replace starts locking at the end space-character. A \\b alone in a string matches only a space-character. -.SH EXAMPLE -this command swaps a and b in the given files: -.TP -shell> replace a b b a -- file1 file2 ... -.SH "SEE ALSO" -isamchk(1), -isamlog(1), -mysql(1), -mysqlaccess(1), -mysqladmin(1), -mysqld(1), -mysqld_multi(1), -mysqld_safe(1), -mysqldump(1), -mysql_fix_privilege_tables(1), -mysqlshow(1), -mysql_zap(1), -perror(1), -.P -For more information please refer to the MySQL reference -manual, which may already be installed locally and which -is also available online at http://dev.mysql.com/doc/mysql/en -.SH BUGS -Please refer to http://bugs.mysql.com/ to report bugs. -.SH AUTHOR -Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ -Michael (Monty) Widenius (monty@mysql.com), -MySQL AB (http://www.mysql.com/). -This software comes with no warranty. -Manual page by L. (Kill-9) Pedersen -(kill-9@kill-9.dk), Mercurmedia Data Model Architect / -system developer (http://www.mercurmedia.com) -.\" end of man page - - diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 16845aa4be7..3384e074ba9 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -440,41 +440,48 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/isamchk.1* %doc %attr(644, root, man) %{_mandir}/man1/isamlog.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* +%doc %attr(644, root, man) %{_mandir}/man1/pack_isam.1* %doc %attr(644, root, man) %{_mandir}/man1/perror.1* %doc %attr(644, root, man) %{_mandir}/man1/replace.1* +%doc %attr(644, root, man) %{_mandir}/man1/safe_mysqld.1* %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf %attr(755, root, root) %{_bindir}/isamchk %attr(755, root, root) %{_bindir}/isamlog -%attr(755, root, root) %{_bindir}/my_print_defaults %attr(755, root, root) %{_bindir}/myisamchk %attr(755, root, root) %{_bindir}/myisam_ftdump %attr(755, root, root) %{_bindir}/myisamlog %attr(755, root, root) %{_bindir}/myisampack +%attr(755, root, root) %{_bindir}/my_print_defaults +%attr(755, root, root) %{_bindir}/mysqlbug %attr(755, root, root) %{_bindir}/mysql_convert_table_format +%attr(755, root, root) %{_bindir}/mysqld_multi +%attr(755, root, root) %{_bindir}/mysqld_safe %attr(755, root, root) %{_bindir}/mysql_explain_log %attr(755, root, root) %{_bindir}/mysql_fix_extensions %attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables +%attr(755, root, root) %{_bindir}/mysqlhotcopy %attr(755, root, root) %{_bindir}/mysql_install_db %attr(755, root, root) %{_bindir}/mysql_secure_installation %attr(755, root, root) %{_bindir}/mysql_setpermission -%attr(755, root, root) %{_bindir}/mysql_zap -%attr(755, root, root) %{_bindir}/mysqlbug -%attr(755, root, root) %{_bindir}/mysqld_multi -%attr(755, root, root) %{_bindir}/mysqld_safe -%attr(755, root, root) %{_bindir}/mysqlhotcopy %attr(755, root, root) %{_bindir}/mysqltest +%attr(755, root, root) %{_bindir}/mysql_zap %attr(755, root, root) %{_bindir}/pack_isam %attr(755, root, root) %{_bindir}/perror %attr(755, root, root) %{_bindir}/replace -%attr(755, root, root) %{_bindir}/resolve_stack_dump %attr(755, root, root) %{_bindir}/resolveip +%attr(755, root, root) %{_bindir}/resolve_stack_dump %attr(755, root, root) %{_bindir}/safe_mysqld %attr(755, root, root) %{_sbindir}/mysqld @@ -502,10 +509,14 @@ fi %attr(755, root, root) %{_bindir}/mysqlimport %attr(755, root, root) %{_bindir}/mysqlshow +%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1* %post shared @@ -517,6 +528,7 @@ fi %files devel %defattr(-, root, root, 0755) %doc EXCEPTIONS-CLIENT +%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1* %attr(755, root, root) %{_bindir}/comp_err %attr(755, root, root) %{_bindir}/mysql_config %dir %attr(755, root, root) %{_includedir}/mysql @@ -565,6 +577,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Oct 27 2005 Lenz Grimmer + +- added more man pages + * Thu Oct 13 2005 Lenz Grimmer - added a usermod call to assign a potential existing mysql user to the From b3263c032e5179b4e3c4a942598e87a7428299c1 Mon Sep 17 00:00:00 2001 From: "mysqldev@mysql.com" <> Date: Thu, 27 Oct 2005 18:32:14 +0200 Subject: [PATCH 04/52] - cleanup: removed the empty NEW-RPMS directory and all references - cleanup: removed obsolete support-files/MacOSX/make_mysql_pkg.pl script (we now use Do-pkg for building OS X packages) --- NEW-RPMS/.cvsignore | 1 - netware/BUILD/compile-linux-tools | 1 - netware/BUILD/compile-netware-END | 1 - netware/BUILD/compile-netware-src | 1 - support-files/MacOSX/make_mysql_pkg.pl | 475 ------------------------- 5 files changed, 479 deletions(-) delete mode 100644 NEW-RPMS/.cvsignore delete mode 100644 support-files/MacOSX/make_mysql_pkg.pl diff --git a/NEW-RPMS/.cvsignore b/NEW-RPMS/.cvsignore deleted file mode 100644 index eee690e5a6c..00000000000 --- a/NEW-RPMS/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -MySQL-*.rpm diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index 886f866d674..523e0260087 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -18,7 +18,6 @@ path=`dirname $0` if test -e "Makefile"; then make -k clean; fi # remove files -rm -f NEW-RPMS/* rm -f */.deps/*.P rm -f */*.linux diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END index 2bd59f97114..c5c08cea908 100755 --- a/netware/BUILD/compile-netware-END +++ b/netware/BUILD/compile-netware-END @@ -12,7 +12,6 @@ path=`dirname $0` if test -e "Makefile"; then make -k clean; fi # remove files -rm -f NEW-RPMS/* rm -f */.deps/*.P rm -rf Makefile.in.bk diff --git a/netware/BUILD/compile-netware-src b/netware/BUILD/compile-netware-src index df7f6fcdd1a..f4e8a53ffea 100644 --- a/netware/BUILD/compile-netware-src +++ b/netware/BUILD/compile-netware-src @@ -21,7 +21,6 @@ if test -e "Makefile"; then fi # remove other files -rm -f NEW-RPMS/* rm -f */.deps/*.P rm -rf Makefile.in.bk diff --git a/support-files/MacOSX/make_mysql_pkg.pl b/support-files/MacOSX/make_mysql_pkg.pl deleted file mode 100644 index 22283d57098..00000000000 --- a/support-files/MacOSX/make_mysql_pkg.pl +++ /dev/null @@ -1,475 +0,0 @@ -#!/usr/bin/perl -w -# -# -# make_mysql_pkg.pl -# -# This script creates a Mac OS X installation package -# of MySQL for Apple's Installer application. -# -# To use it: -# -# 1.) Unpack the mysql source tarball and cd into the directory -# 2.) execute this script -# -# -# Written by Marc Liyanage (http://www.entropy.ch) -# -# History: -# -# When Who What -# ------------------------------------------------------------------ -# 2001-09-16 Marc Liyanage First version -# 2001-11-18 Marc Liyanage Improved configure directory options -# - -use strict; -use DirHandle; - -my $data = {}; - -$data->{PREFIX_DIR} = "/usr/local/mysql"; -$data->{CONFIG} = join(" ", - "--prefix=$data->{PREFIX_DIR}", - "--localstatedir=$data->{PREFIX_DIR}/data", - "--libdir=$data->{PREFIX_DIR}/lib", - "--includedir=$data->{PREFIX_DIR}/include", - "--with-named-z-libs=/usr/local/libz.a", - "--with-innodb", - "--with-server-suffix='-entropy.ch'", - "--with-comment='http://www.entropy.ch/software/macosx/mysql/'", - "--with-mysqld-user=mysql", - "--enable-assembler", - "CFLAGS=\"-DHAVE_BROKEN_REALPATH -lncurses\"", -); - - - - - -prepare($data); -configure_source($data); -make($data); -make_binary_distribution($data); -create_pax_root($data); -create_package($data); -cleanup($data); - -print "Package $data->{PACKAGE_TARBALL_FILENAME} created\n"; - - - - - - -# Subroutines follow here... - - - - -# Prepares data in the global $data hash, like version numbers, -# directory names etc. Also makes sure that no old stuff -# is in our way. -# -sub prepare { - - my ($data) = @_; - - # Keep the current wd for reference - # - $data->{OLDWD} = `pwd`; - chomp($data->{OLDWD}); - - # Look for configure script - # - unless (-f "configure") { - abort($data, "Unable to find 'configure', make sure you're in the MySQL source toplevel directory!"); - } - - # Try to find version number there - # - my $mysql_version_h = `cat configure`; - ($data->{VERSION}) = $mysql_version_h =~ /^VERSION=(.+?)$/m; - - unless ($data->{VERSION} =~ /\d+/) { - abort($data, "Unable to find MySQL version number!"); - } - - debug($data, "found MySQL version number $data->{VERSION}"); - - - # PAXROOT_DIR is where we will build our own little - # fake /usr/local directory. Make sure it doesn't exist, - # then try to create it. - # - $data->{PAXROOT_DIR} = "/tmp/mysql-$data->{VERSION}-paxroot"; - - if (-e $data->{PAXROOT_DIR}) { - abort($data, "$data->{PAXROOT_DIR} exists, please remove first"); - } - - if (system("mkdir $data->{PAXROOT_DIR}")) { - abort($data, "Unable to mkdir $data->{PAXROOT_DIR}, please make sure you have the right permissions!"); - } - - - # PACKAGE_DIR is where we will build the package directory - # hierarchy, according to the standard .pkg layout. - # - $data->{PACKAGE_NAME} = "mysql-$data->{VERSION}.pkg"; - $data->{PACKAGE_DIR} = "/tmp/$data->{PACKAGE_NAME}"; - - if (-e $data->{PACKAGE_DIR}) { - abort($data, "$data->{PACKAGE_DIR} exists, please remove first"); - } - - if (system("mkdir $data->{PACKAGE_DIR}")) { - abort($data, "Unable to mkdir $data->{PACKAGE_DIR}, please make sure you have the right permissions!"); - } - - -} - - - -# Configure the MySQL source with our options -# -sub configure_source { - - my ($data) = @_; - - if (system("./configure $data->{CONFIG}")) { - abort($data, "Unable to configure!"); - } - -} - - - - -# Build the software -# -sub make { - - my ($data) = @_; - - if (system("make")) { - abort($data, "Unable to make!"); - } - -} - - - -# We don't ever install the software, but instead we use an -# included script to create a binary distribution -# tarball. -# -sub make_binary_distribution { - - my ($data) = @_; - - if (system("./scripts/make_binary_distribution > make_binary_distribution.out")) { - abort($data, "Unable to make_binary_distribution!"); - } - - my @output = `cat make_binary_distribution.out`; - my $last_line = $output[-1]; - unlink("make_binary_distribution.out"); - - my ($tarball_filename, $tarball_directory) = $last_line =~ /^((.+)\.tar\.gz) created/i; - - unless ($tarball_filename and -f $tarball_filename) { - abort($data, "Unable determine the output filename of scripts/make_binary_distribution!"); - } - - $data->{BINARY_TARBALL_FILENAME} = $tarball_filename; - $data->{BINARY_TARBALL_DIRECTORY} = $tarball_directory; - -} - - - - -# Now we build a fake /usr/local directory hierarchy. -# This will be fed to the pax tool to create the archive. -# -sub create_pax_root { - - my ($data) = @_; - - # Go there and try to extract the binary distribution - # tarball which we created in the previous step. - # - chdir($data->{PAXROOT_DIR}); - my $tarfile = "$data->{OLDWD}/$data->{BINARY_TARBALL_FILENAME}"; - - if (system("tar -xzf $tarfile")) { - abort($data, "Unable to extract $tarfile inside $data->{PAXROOT_DIR}"); - } - - # Rename it to what we want it to be in the - # installed /usr/local directory later on, i.e. - # mysql-. Then create a symlink from - # mysql to mysql- - # - rename($data->{BINARY_TARBALL_DIRECTORY}, "mysql-$data->{VERSION}"); - symlink("mysql-$data->{VERSION}", "mysql"); - - - # We create a bunch of symlinks in /usr/local/bin and - # /usr/local/share/man so that the end-user will not - # have to adjust PATH and MANPATH to include the - # /usr/local/mysql/bin and man directories. - # - system("mkdir -p $_") foreach qw(bin share/man); - - - # First create the symlinks in the bin directory - # - # 2001-02-13: we no longer use symlinks for the binaries, we - # use small dummy scripts instead because the - # mysql scripts do a lot of guesswork with their - # own path and that will not work when called via the symlink - # -# symlink("../mysql/bin/$_", "$_") foreach (grep {$_ !~ /^\.+$/} DirHandle->new("../mysql/bin")->read()); - - chdir("bin"); - - foreach my $command (grep {$_ !~ /^\.+$/} DirHandle->new("../mysql/bin")->read()) { - - my $scriptcode = qq+#!/bin/sh\n# Part of the entropy.ch mysql package\ncd /usr/local/mysql/\nexec ./bin/$command "\$\@"\n+; - open(SCRIPTFILE, ">$command") or die "Unable to write open $command\n"; - print SCRIPTFILE $scriptcode; - close(SCRIPTFILE); - chmod(0755, $command); - - } - - - - - - - - # Now include the man pages. Two problems here: - # 1.) the make_binary_distribution script does not seem - # to include the man pages, so we have to copy them over - # now. [outdated, was fixed by MySQL!] - # 2.) The man pages could be in different sections, so - # we have to recursively copy *and* symlink them. - # - - # First find out what's there in the source distribution. - # Store the names of the manpages in anonymous - # arrays which in turn will be stored in a hash, using - # the section numbers as hash keys. - # - chdir("$data->{PAXROOT_DIR}/mysql"); - my %man_sections; - foreach my $manpage (grep {$_ =~ /^.+\.(\d+)$/} DirHandle->new("man")->read()) { - - my ($section) = $manpage =~ /\.(\d+)$/; - - $man_sections{$section} ||= []; - push @{$man_sections{$section}}, "$manpage"; - - } - - - # Now iterate through the sections and man pages, - # and copy/symlink the man pages - # - chdir("$data->{PAXROOT_DIR}/share/man/"); - - foreach my $section (keys(%man_sections)) { - - system("mkdir -p man$section"); - chdir("man$section"); - - foreach my $manpage (@{$man_sections{$section}}) { - - symlink("../../../mysql/man/$manpage", $manpage) - - } - - chdir(".."); - - } - - - - # Fix up the library and lib directories. They are packed up wrong in the - # binary distribution tarball. - # - # (no longer needed as of 3.23.47) - # (oops, still needed because 3.23.47 is broken...) - # -# if (-d "$data->{PAXROOT_DIR}/mysql/lib/mysql") { -# abort($data, "$data->{PAXROOT_DIR}/mysql/lib/mysql exists, layout has changed!"); -# } -# chdir("$data->{PAXROOT_DIR}/mysql/lib/"); -# system("mkdir -p mysql"); -# system("mv * mysql"); - -# if (-d "$data->{PAXROOT_DIR}/mysql/include/mysql") { -# abort($data, "$data->{PAXROOT_DIR}/mysql/include/mysql exists, layout has changed!"); -# } -# chdir("$data->{PAXROOT_DIR}/mysql/include/"); -# system("mkdir -p mysql"); -# system("mv * mysql"); - - - - - - - - - -} - - - -# Take the pax root directory, create a few auxiliary -# files and then pack everything up into a tarball -# -sub create_package { - - my ($data) = @_; - - # Create the resources directory in which all - # interesting files for this package will be stored - # - $data->{PKG_RESOURCES_DIR} = "$data->{PACKAGE_DIR}/Contents/Resources"; - - if (system("mkdir -p $data->{PKG_RESOURCES_DIR}")) { - abort("Unable to create package resources dir $data->{PKG_RESOURCES_DIR}"); - } - - - # Create the big archive with all the files using - # the pax tool - # - chdir($data->{PAXROOT_DIR}); - if(system("pax -w . | gzip -c > $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.pax.gz")) { - abort("Unable to create package pax file"); - } - - - # Create the "Bill Of Materials" (bom) file. - # - if(system("mkbom . $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.bom")) { - abort("Unable to create package bom file"); - } - - - # Create the ".sizes" file with some information about the package - # - my $size_uncompressed = `du -sk $data->{PAXROOT_DIR} | cut -f 1`; - chomp($size_uncompressed); - - my $size_compressed = `du -sk $data->{PACKAGE_DIR} | cut -f 1`; - chomp($size_compressed); - - my $numfiles = `find /tmp/mysql-$data->{VERSION}-paxroot | wc -l`; - $numfiles--; - - open(SIZESFILE, ">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes") or abort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes"); - print SIZESFILE "NumFiles $numfiles\n"; - print SIZESFILE "InstalledSize $size_uncompressed\n"; - print SIZESFILE "CompressedSize $size_compressed\n"; - close(SIZESFILE); - - - # Create the ".info" file with more information abou the package. - # - open(INFOFILE, ">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info") or abort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info"); - my $infodata = join("", ); - $infodata =~ s/<%(.+?)%>/$data->{$1}/eg; - abort("Unable to get info file data from __DATA__!") unless ($infodata =~ /\w+/); - print INFOFILE $infodata; - close(INFOFILE); - - - - # Finally, create the .tar.gz file for the package, - # this is our end result - # - chdir($data->{PACKAGE_DIR}); - chdir(".."); - - $data->{PACKAGE_TARBALL_FILENAME} = "$data->{PACKAGE_NAME}.tar.gz"; - - if(system("tar -czf $data->{OLDWD}/$data->{PACKAGE_TARBALL_FILENAME} $data->{PACKAGE_NAME}")) { - abort("Unable to create package tar file $data->{OLDWD}/$data->{PACKAGE_TARBALL_FILENAME}"); - } - - - -} - - -# Abort with an error message -# -sub abort { - - my ($data, $errormessage) = @_; - - my ($caller) = (caller(1))[3]; - $caller =~ s/^main:://; - - print "*** Error: $caller(): $errormessage\n"; - - exit 1; - -} - - -# Output informative messages -# -sub debug { - - my ($data, $message) = @_; - - my ($caller) = (caller(1))[3]; - $caller =~ s/^main:://; - - print "*** Info: $caller(): $message\n"; - -} - - - -# Remove temporary items -# -sub cleanup { - - my ($data) = @_; - - chdir($data->{OLDWD}); - - system("rm -rf $data->{PACKAGE_DIR}"); - system("rm -rf $data->{PAXROOT_DIR}"); - system("rm $data->{BINARY_TARBALL_FILENAME}"); - -} - - - - -__DATA__ -Title MySQL -Version <%VERSION%> -Description The MySQL database server in a convenient Mac OS X package. Some additional configuration is necessary, please see http://www.entropy.ch/software/macosx/mysql/ -DefaultLocation /usr/local -Diskname (null) -DeleteWarning -NeedsAuthorization YES -DisableStop NO -UseUserMask NO -Application NO -Relocatable NO -Required NO -InstallOnly NO -RequiresReboot NO -InstallFat NO From 77723c2438f0fba7cd19e6b746391ede7e3135da Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Fri, 28 Oct 2005 01:24:11 +0400 Subject: [PATCH 05/52] Fix bug#14186 select datefield is null not updated Date field was declared as not null, thus expression 'datefield is null' was always false. For SELECT special handling of such cases is used. There 'datefield is null' converted to 'datefield eq "0000-00-00"'. In mysql_update() before creation of select added remove_eq_conds() call. It makes some optimization of conds and in particular performs conversion from 'is null' to 'eq'. Also remove_eq_conds() makes some evaluation of conds and if it founds that conds is always false then update statement is not processed further. All this allows to perform some update statements process faster due to optimized conds, and not wasting resources if conds known to be false. --- mysql-test/r/update.result | 8 ++++++++ mysql-test/t/update.test | 9 +++++++++ sql/sql_select.cc | 4 +--- sql/sql_select.h | 1 + sql/sql_update.cc | 16 ++++++++++++---- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 3408766d603..74c628f96c4 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -337,3 +337,11 @@ a b 22 3 23 3 drop table t1; +create table t1 (f1 date not null); +insert into t1 values('2000-01-01'),('0000-00-00'); +update t1 set f1='2002-02-02' where f1 is null; +select * from t1; +f1 +2000-01-01 +2002-02-02 +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index e81415628d0..a21d10b6571 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -260,5 +260,14 @@ update t1 set a=a+11,b=2 order by a limit 3; update t1 set a=a+12,b=3 order by a limit 3; select * from t1 order by a; +drop table t1; + +# +# Bug#14186 select datefield is null not updated +# +create table t1 (f1 date not null); +insert into t1 values('2000-01-01'),('0000-00-00'); +update t1 set f1='2002-02-02' where f1 is null; +select * from t1; drop table t1; # End of 4.1 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c485d6cd04e..fe5b3d453de 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -69,8 +69,6 @@ static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables, SELECT_LEX_UNIT *unit); static COND *optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value); -static COND *remove_eq_conds(THD *thd, COND *cond, - Item::cond_result *cond_value); static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, @@ -4611,7 +4609,7 @@ optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value) COND_FALSE always false ( 1 = 2 ) */ -static COND * +COND * remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) { if (cond->type() == Item::COND_ITEM) diff --git a/sql/sql_select.h b/sql/sql_select.h index c7440fe4c3a..b92576587fe 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -456,3 +456,4 @@ bool cp_buffer_from_ref(THD *thd, TABLE_REF *ref); bool error_if_full_join(JOIN *join); int report_error(TABLE *table, int error); int safe_index_read(JOIN_TAB *tab); +COND *remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b6bce800b0e..cb8064bef87 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -70,7 +70,7 @@ int mysql_update(THD *thd, ha_rows updated, found; key_map old_used_keys; TABLE *table; - SQL_SELECT *select; + SQL_SELECT *select= 0; READ_RECORD info; TABLE_LIST *update_table_list= ((TABLE_LIST*) thd->lex->select_lex.table_list.first); @@ -131,11 +131,19 @@ int mysql_update(THD *thd, DBUG_RETURN(-1); /* purecov: inspected */ } + if (conds) + { + Item::cond_result cond_value; + conds= remove_eq_conds(thd, conds, &cond_value); + if (cond_value == Item::COND_FALSE) + limit= 0; // Impossible WHERE + } // Don't count on usage of 'only index' when calculating which key to use table->used_keys.clear_all(); - select=make_select(table,0,0,conds,&error); - if (error || - (select && select->check_quick(thd, safe_update, limit)) || !limit) + if (limit) + select=make_select(table,0,0,conds,&error); + if (error || !limit || + (select && select->check_quick(thd, safe_update, limit))) { delete select; free_underlaid_joins(thd, &thd->lex->select_lex); From c7041303895924f6aeab7231412b110d12006de0 Mon Sep 17 00:00:00 2001 From: "tim@siva.hindu.god" <> Date: Fri, 28 Oct 2005 12:13:34 +1300 Subject: [PATCH 06/52] BUG#14358: in mysql.cc, don't neglect to strip delimiter off lines < 9 characters long. --- client/mysql.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index bf417e73e22..441687e2e4e 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1133,10 +1133,11 @@ static COMMANDS *find_command(char *name,char cmd_char) parsing the row and calling find_command() */ if (strstr(name, "\\g") || (strstr(name, delimiter) && - strlen(name) >= 9 && - my_strnncoll(charset_info,(uchar*) name, - 9, - (const uchar*) "delimiter", 9))) + !(strlen(name) >= 9 && + !my_strnncoll(charset_info, + (uchar*) name, 9, + (const uchar*) "delimiter", + 9)))) DBUG_RETURN((COMMANDS *) 0); if ((end=strcont(name," \t"))) { From fda75b151916fcf308ec56ea9381f2b2db6ac241 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Fri, 28 Oct 2005 12:15:46 +0500 Subject: [PATCH 07/52] Fix for bug #9551 (Show commands fail) --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 97d5bf4e1d5..ec5c7a7b51b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8025,7 +8025,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, statistic_increment(thd->status_var.created_tmp_tables, &LOCK_status); - if (use_temp_pool) + if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES)) temp_pool_slot = bitmap_set_next(&temp_pool); if (temp_pool_slot != MY_BIT_NONE) // we got a slot From 0f3192323c4de51205b17cf0e8ea71f773d38517 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 28 Oct 2005 10:46:07 +0200 Subject: [PATCH 08/52] - fixed RPM spec file list after merge, removed dupes --- support-files/mysql.spec.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 384f7ab29fa..5cd9d1646a4 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -548,9 +548,9 @@ fi %attr(755, root, root) %{_bindir}/my_print_defaults %attr(755, root, root) %{_bindir}/mysqlbug %attr(755, root, root) %{_bindir}/mysql_convert_table_format +%attr(755, root, root) %{_bindir}/mysql_create_system_tables %attr(755, root, root) %{_bindir}/mysqld_multi %attr(755, root, root) %{_bindir}/mysqld_safe -%attr(755, root, root) %{_bindir}/mysql_create_system_tables %attr(755, root, root) %{_bindir}/mysql_explain_log %attr(755, root, root) %{_bindir}/mysql_fix_extensions %attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables @@ -558,13 +558,8 @@ fi %attr(755, root, root) %{_bindir}/mysql_install_db %attr(755, root, root) %{_bindir}/mysql_secure_installation %attr(755, root, root) %{_bindir}/mysql_setpermission -%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql -%attr(755, root, root) %{_bindir}/mysql_zap -%attr(755, root, root) %{_bindir}/mysqlbug -%attr(755, root, root) %{_bindir}/mysqld_multi -%attr(755, root, root) %{_bindir}/mysqld_safe -%attr(755, root, root) %{_bindir}/mysqlhotcopy %attr(755, root, root) %{_bindir}/mysqltest +%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql %attr(755, root, root) %{_bindir}/mysql_zap %attr(755, root, root) %{_bindir}/pack_isam %attr(755, root, root) %{_bindir}/perror From 303ba3704415cd095a01974c499772d5a270053e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 28 Oct 2005 13:31:19 +0200 Subject: [PATCH 09/52] - added man page for the mysqlmanager in the RPM spec file list --- support-files/mysql.spec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 45efd2dd3a2..a10e525ee50 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -549,6 +549,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlmanager.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* %doc %attr(644, root, man) %{_mandir}/man1/pack_isam.1* From 7decf21c0204f93ade305bd46ecb2c7f31e5cd93 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 28 Oct 2005 16:50:52 +0200 Subject: [PATCH 10/52] - after merge fix: removed pack_isam from the RPM spec file list again --- support-files/mysql.spec.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index a10e525ee50..1b74ce50328 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -552,7 +552,6 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysqlmanager.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* -%doc %attr(644, root, man) %{_mandir}/man1/pack_isam.1* %doc %attr(644, root, man) %{_mandir}/man1/perror.1* %doc %attr(644, root, man) %{_mandir}/man1/replace.1* %doc %attr(644, root, man) %{_mandir}/man1/safe_mysqld.1* @@ -580,7 +579,6 @@ fi %attr(755, root, root) %{_bindir}/mysqltest %attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql %attr(755, root, root) %{_bindir}/mysql_zap -%attr(755, root, root) %{_bindir}/pack_isam %attr(755, root, root) %{_bindir}/perror %attr(755, root, root) %{_bindir}/replace %attr(755, root, root) %{_bindir}/resolveip From afbd0fafd3aeab18c5a15c0699bba69aca28b74d Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Mon, 31 Oct 2005 16:28:45 +0400 Subject: [PATCH 11/52] Check for NULLs only if we don't replace column results, get real results after all checks. (see bug #14254: func_crypt.test fails on FreeBSD with --ps-protocol). --- client/mysqltest.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 35408368a73..d10ad054798 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3272,19 +3272,24 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags) /* Read result from each column */ for (col_idx= 0; col_idx < num_fields; col_idx++) { - /* FIXME is string terminated? */ - const char *val= (const char *)bind[col_idx].buffer; - ulonglong len= *bind[col_idx].length; + const char *val; + ulonglong len; if (col_idx < max_replace_column && replace_column[col_idx]) { val= replace_column[col_idx]; len= strlen(val); } - if (*bind[col_idx].is_null) + else if (*bind[col_idx].is_null) { val= "NULL"; len= 4; } + else + { + /* FIXME is string terminated? */ + val= (const char *) bind[col_idx].buffer; + len= *bind[col_idx].length; + } if (!display_result_vertically) { if (col_idx) /* No tab before first col */ From 153d4c400ee0c8023c4e1f4be9aadb6fc4768bee Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Mon, 31 Oct 2005 14:13:51 +0100 Subject: [PATCH 12/52] fix for bug #14381 (Key length is limited to 255 bytes on BDB) --- sql/ha_berkeley.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 59f11bfd74a..c747b4eef81 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -94,6 +94,9 @@ class ha_berkeley: public handler uint max_supported_keys() const { return MAX_KEY-1; } uint extra_rec_buf_length() { return BDB_HIDDEN_PRIMARY_KEY_LENGTH; } ha_rows estimate_rows_upper_bound(); + uint max_supported_key_length() const { return MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; } + const key_map *keys_to_use_for_scanning() { return &key_map_full; } bool has_transactions() { return 1;} From 4c73ac667105b21012fe46cf5730636afb6b3635 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Mon, 31 Oct 2005 18:35:26 +0100 Subject: [PATCH 13/52] Accept any shared library for "libz", not just the static one. Bug#6584 --- acinclude.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 9c7271f7cc9..0a5778285ea 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -310,8 +310,9 @@ case $SYSTEM_TYPE in fi ;; *) - if test -f "$mysql_zlib_dir/lib/libz.a" -a \ - -f "$mysql_zlib_dir/include/zlib.h"; then + if test \( -f "$mysql_zlib_dir/lib/libz.a" -o -f "$mysql_zlib_dir/lib/libz.so" -o \ + -f "$mysql_zlib_dir/lib/libz.sl" -o -f "$mysql_zlib_dir/lib/libz.dylib" \) \ + -a -f "$mysql_zlib_dir/include/zlib.h"; then ZLIB_INCLUDES="-I$mysql_zlib_dir/include" ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz" MYSQL_CHECK_ZLIB_DIR From c45c24ed3f0d26e7d95e4dbe5409746938346fba Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 31 Oct 2005 19:57:57 +0100 Subject: [PATCH 14/52] Fixed failure of NDB config retrieval. 1. Made sure that base64 string is terminated with NUL. 2. Made calculation of needed size for base64 string exact. Added checks in test for the above two fixes. --- mysys/base64.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mysys/base64.c b/mysys/base64.c index 0fcd6f096f5..0165982fb67 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -27,9 +27,13 @@ static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" int base64_needed_encoded_length(int length_of_data) { - return ceil(length_of_data * 4 / 3) /* base64 chars */ + - ceil(length_of_data / (76 * 3 / 4)) /* Newlines */ + - 3 /* Padding */; + int nb_base64_chars; + nb_base64_chars= (length_of_data + 2) / 3 * 4; + + return + nb_base64_chars + /* base64 char incl padding */ + (nb_base64_chars - 1)/ 76 + /* newlines */ + 1; /* NUL termination of string */ } @@ -89,6 +93,7 @@ base64_encode(const void *src, size_t src_len, char *dst) else *dst++= base64_table[(c >> 0) & 0x3f]; } + *dst= '\0'; return 0; } @@ -209,6 +214,7 @@ main(void) size_t j; size_t k, l; size_t dst_len; + size_t needed_length; for (i= 0; i < 500; i++) { @@ -227,8 +233,12 @@ main(void) } /* Encode */ - str= (char *) malloc(base64_needed_encoded_length(src_len)); + needed_length= base64_needed_encoded_length(src_len); + str= (char *) malloc(needed_length); + for (k= 0; k < needed_length; k++) + str[k]= 0xff; /* Fill memory to check correct NUL termination */ require(base64_encode(src, src_len, str) == 0); + require(needed_length == strlen(str) + 1); /* Decode */ dst= (char *) malloc(base64_needed_decoded_length(strlen(str))); From 1d9bfbf7d293d38e5137205c30e0eeff09c9d229 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 31 Oct 2005 11:15:44 -0800 Subject: [PATCH 15/52] Handle decision to use mysqld-max over mysqld within mysqld_safe even when --ledir option is specified. (Bug #13774) --- scripts/mysqld_safe.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d6585f4a552..6ce4c1e0da8 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -11,6 +11,7 @@ # executing mysqld_safe KILL_MYSQLD=1; +MYSQLD= trap '' 1 2 3 15 # we shouldn't let anyone kill us @@ -130,14 +131,6 @@ fi user=@MYSQLD_USER@ niceness=0 -# Use the mysqld-max binary by default if the user doesn't specify a binary -if test -x $ledir/mysqld-max -then - MYSQLD=mysqld-max -else - MYSQLD=mysqld -fi - # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= @@ -176,6 +169,16 @@ then chown $user $mysql_unix_port_dir fi +# Use the mysqld-max binary by default if the user doesn't specify a binary +if test -z "$MYSQLD" +then + if test -x $ledir/mysqld-max + then + MYSQLD=mysqld-max + else + MYSQLD=mysqld + fi +fi if test ! -x $ledir/$MYSQLD then From c54d129224234342942dc0b7549dbf969c624ebc Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Mon, 31 Oct 2005 22:14:27 +0200 Subject: [PATCH 16/52] postreview fixes --- sql/item_func.cc | 6 ++---- sql/sql_acl.cc | 2 +- sql/sql_base.cc | 6 ++---- sql/sql_parse.cc | 2 +- sql/table.cc | 6 ++---- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index df25c3c97fa..ce2256290fa 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4756,13 +4756,12 @@ Item_func_sp::execute(Item **itp) THD *thd= current_thd; int res= -1; Sub_statement_state statement_state; - Security_context *save_security_ctx= 0, *save_ctx_func; + Security_context *save_security_ctx= thd->security_ctx, *save_ctx_func; #ifndef NO_EMBEDDED_ACCESS_CHECKS if (context->security_ctx) { /* Set view definer security context */ - save_security_ctx= thd->security_ctx; thd->security_ctx= context->security_ctx; } #endif @@ -4787,8 +4786,7 @@ Item_func_sp::execute(Item **itp) #ifndef NO_EMBEDDED_ACCESS_CHECKS sp_restore_security_context(thd, save_ctx_func); error: - if (save_security_ctx) - thd->security_ctx= save_security_ctx; + thd->security_ctx= save_security_ctx; #else error: #endif diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index bc8b9ba2efb..2b5945b74af 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3532,7 +3532,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, of other queries). For simple queries first_not_own_table is 0. */ for (i= 0, table= tables; - table && table != first_not_own_table && i < number; + table != first_not_own_table && i < number; table= table->next_global, i++) { /* Remove SHOW_VIEW_ACL, because it will be checked during making view */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2da0f7e2ce0..5ffed6c6f82 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2705,16 +2705,14 @@ static bool check_grant_column_in_sctx(THD *thd, GRANT_INFO *grant, { if (!check_grants) return FALSE; - Security_context *save_security_ctx= 0; + Security_context *save_security_ctx= thd->security_ctx; bool res; if (sctx) { - save_security_ctx= thd->security_ctx; thd->security_ctx= sctx; } res= check_grant_column(thd, grant, db, table, name, length); - if (save_security_ctx) - thd->security_ctx= save_security_ctx; + thd->security_ctx= save_security_ctx; return res; } #endif diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1882965fd1e..51d655334f8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5033,7 +5033,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, the given table list refers to the list for prelocking (contains tables of other queries). For simple queries first_not_own_table is 0. */ - for (; tables && tables != first_not_own_table; tables= tables->next_global) + for (; tables != first_not_own_table; tables= tables->next_global) { if (tables->schema_table && (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL))) diff --git a/sql/table.cc b/sql/table.cc index 75c04389411..539c416c369 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2654,7 +2654,7 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length) GRANT_INFO *grant; const char *db_name; const char *table_name; - Security_context *save_security_ctx= 0; + Security_context *save_security_ctx= thd->security_ctx; Security_context *new_sctx= table_ref->security_ctx; bool res; @@ -2675,12 +2675,10 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length) if (new_sctx) { - save_security_ctx= thd->security_ctx; thd->security_ctx= new_sctx; } res= check_grant_column(thd, grant, db_name, table_name, name, length); - if (save_security_ctx) - thd->security_ctx= save_security_ctx; + thd->security_ctx= save_security_ctx; return res; } #endif From 7b611b33f287941e80a7a8d17b59c2a32ae056a2 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Mon, 31 Oct 2005 17:17:16 -0800 Subject: [PATCH 17/52] BUG #14532 Added FIELD_TYPE_BIT to field method 'needs_quotes' to make BIT columns work. --- mysql-test/r/federated.result | 53 +++++++++++++++++++++++++++++++++++ mysql-test/t/federated.test | 34 ++++++++++++++++++++++ sql/field.cc | 1 + 3 files changed, 88 insertions(+) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 7e18cb9f75f..a633b2b2451 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1490,6 +1490,59 @@ id name DROP TABLE federated.alter_me; DROP TABLE federated.normal_table; DROP TABLE IF EXISTS federated.t1; +CREATE TABLE federated.t1 ( +`bitty` bit(3) +) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS federated.t1; +CREATE TABLE federated.t1 ( +`bitty` bit(3) +) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +INSERT INTO federated.t1 VALUES (b'001'); +INSERT INTO federated.t1 VALUES (b'010'); +INSERT INTO federated.t1 VALUES (b'011'); +INSERT INTO federated.t1 VALUES (b'100'); +INSERT INTO federated.t1 VALUES (b'101'); +INSERT INTO federated.t1 VALUES (b'110'); +INSERT INTO federated.t1 VALUES (b'111'); +select * FROM federated.t1; +bitty + + + + + + + +select * FROM federated.t1; +bitty + + + + + + + +delete from federated.t1; +INSERT INTO federated.t1 VALUES (b'001'); +INSERT INTO federated.t1 VALUES (b'010'); +INSERT INTO federated.t1 VALUES (b'011'); +INSERT INTO federated.t1 VALUES (b'100'); +INSERT INTO federated.t1 VALUES (b'101'); +INSERT INTO federated.t1 VALUES (b'110'); +INSERT INTO federated.t1 VALUES (b'111'); +select * FROM federated.t1; +bitty + + + + + + + +drop table federated.t1; +drop table federated.t1; +DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 9880cd78653..82635f617af 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1188,5 +1188,39 @@ connection slave; DROP TABLE federated.normal_table; # END ALTER TEST +# +# Test BUG #14532 +# +--disable_warnings +DROP TABLE IF EXISTS federated.t1; +--enable_warnings +CREATE TABLE federated.t1 ( + `bitty` bit(3) +) DEFAULT CHARSET=latin1; + +connection master; + +--disable_warnings +DROP TABLE IF EXISTS federated.t1; +--enable_warnings + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.t1 ( + `bitty` bit(3) +) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; + +INSERT INTO federated.t1 VALUES (b'001'); +INSERT INTO federated.t1 VALUES (b'010'); +INSERT INTO federated.t1 VALUES (b'011'); +INSERT INTO federated.t1 VALUES (b'100'); +INSERT INTO federated.t1 VALUES (b'101'); +INSERT INTO federated.t1 VALUES (b'110'); +INSERT INTO federated.t1 VALUES (b'111'); +select * FROM federated.t1; +drop table federated.t1; + +connection slave; +drop table federated.t1; source include/federated_cleanup.inc; diff --git a/sql/field.cc b/sql/field.cc index 4a73d8e7981..03d20b4bfe2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1628,6 +1628,7 @@ bool Field::needs_quotes(void) case FIELD_TYPE_MEDIUM_BLOB : case FIELD_TYPE_LONG_BLOB : case FIELD_TYPE_GEOMETRY : + case FIELD_TYPE_BIT: DBUG_RETURN(1); case FIELD_TYPE_DECIMAL : From 2c6902a0938db362d2b228d14ce8a2e3b9848d35 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 1 Nov 2005 02:19:06 +0100 Subject: [PATCH 18/52] mysql-test-run.pl: Make IM ports change with MTR_BUILD_THREAD --- mysql-test/mysql-test-run.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 08ff5a77fac..ea4fa1082db 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -481,6 +481,9 @@ sub command_line_setup () { $opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 40 + 8120; $opt_slave_myport= $opt_master_myport + 16; $opt_ndbcluster_port= $opt_master_myport + 24; + $im_port= $opt_master_myport + 10; + $im_mysqld1_port= $opt_master_myport + 12; + $im_mysqld2_port= $opt_master_myport + 14; } # Read the command line @@ -1070,6 +1073,8 @@ sub environment_setup () { print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n"; print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n"; print "Using NDBCLUSTER_PORT = $opt_ndbcluster_port\n"; + print "Using IM_MYSQLD1_PORT = $ENV{'IM_MYSQLD1_PORT'}\n"; + print "Using IM_MYSQLD2_PORT = $ENV{'IM_MYSQLD2_PORT'}\n"; } From d5b252e630a79f43bdcb83cfc22a929392b957c7 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Mon, 31 Oct 2005 17:26:45 -0800 Subject: [PATCH 19/52] BUG# 14532 Post-review fixes --- mysql-test/r/federated.result | 26 -------------------------- mysql-test/t/federated.test | 3 ++- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index a633b2b2451..7f53bd884ef 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1514,32 +1514,6 @@ bitty    -select * FROM federated.t1; -bitty - - - - - - - -delete from federated.t1; -INSERT INTO federated.t1 VALUES (b'001'); -INSERT INTO federated.t1 VALUES (b'010'); -INSERT INTO federated.t1 VALUES (b'011'); -INSERT INTO federated.t1 VALUES (b'100'); -INSERT INTO federated.t1 VALUES (b'101'); -INSERT INTO federated.t1 VALUES (b'110'); -INSERT INTO federated.t1 VALUES (b'111'); -select * FROM federated.t1; -bitty - - - - - - - drop table federated.t1; drop table federated.t1; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 82635f617af..b6b3b90c083 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1189,7 +1189,8 @@ DROP TABLE federated.normal_table; # END ALTER TEST # -# Test BUG #14532 +# Test BUG #14532 - bit columns broken in federated +# storage engine # --disable_warnings DROP TABLE IF EXISTS federated.t1; From 69cd4c1ebfc01d1ea624bea7436f1f61161a6f99 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 1 Nov 2005 11:43:34 +0400 Subject: [PATCH 20/52] gis.test fixed --- mysql-test/r/gis.result | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 454b33c28be..049ba784dc9 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -665,6 +665,12 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))) +POINT(10 10) +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); +(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))) +POINT(10 10) create table t1 (s1 geometry not null,s2 char(100)); create trigger t1_bu before update on t1 for each row set new.s1 = null; insert into t1 values (null,null); @@ -688,9 +694,3 @@ alter table t1 add primary key pti(pt); ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length alter table t1 add primary key pti(pt(20)); drop table t1; -select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); -(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))) -POINT(10 10) -select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); -(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))) -POINT(10 10) From b98c93e0a86cbbc24c964efdc23f509d93b1b8c1 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 1 Nov 2005 13:08:14 +0400 Subject: [PATCH 21/52] Fix for bug #14445 (analyse.test fails) --- mysql-test/r/analyse.result | 6 +++--- sql/sql_analyse.cc | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 59c75c0f313..0aaf59e9c9d 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -107,7 +107,7 @@ insert into t1 values(1.1); insert into t1 values(2.2); select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.302500000 ENUM('1.1','2.2') NOT NULL +test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.55000 ENUM('1.1','2.2') NOT NULL drop table t1; create table t1 (d double); insert into t1 values (100000); @@ -138,6 +138,6 @@ insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL -sum(profit) 10 6900 2 4 0 0 1946 2868 ENUM('10','275','600','6900') NOT NULL -avg(profit) 10.0000 1380.0000 7 9 0 0 394.6875 570.2003 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL +sum(profit) 10 6900 11 11 0 0 1946 2867.6719 ENUM('10','275','600','6900') NOT NULL +avg(profit) 10.000000000 1380.000000000 21 21 0 0 394.687500000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL drop table t1,t2; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 669f998cde5..fe77628497a 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1036,13 +1036,19 @@ String *field_decimal::std(String *s, ha_rows rows) s->set((double) 0.0, 1,my_thd_charset); return s; } - my_decimal num, std_val, sum2, sum2d; + my_decimal num, tmp, sum2, sum2d; + double std_sqr; + int prec_increment= current_thd->variables.div_precincrement; + int2my_decimal(E_DEC_FATAL_ERROR, rows - nulls, FALSE, &num); my_decimal_mul(E_DEC_FATAL_ERROR, &sum2, sum+cur_sum, sum+cur_sum); - my_decimal_div(E_DEC_FATAL_ERROR, &std_val, &sum2, &num, 0); - my_decimal_sub(E_DEC_FATAL_ERROR, &sum2, sum_sqr+cur_sum, &std_val); - my_decimal_div(E_DEC_FATAL_ERROR, &std_val, &sum2, &num, 0); - my_decimal2string(E_DEC_FATAL_ERROR, &std_val, 0, 0, '0', s); + my_decimal_div(E_DEC_FATAL_ERROR, &tmp, &sum2, &num, prec_increment); + my_decimal_sub(E_DEC_FATAL_ERROR, &sum2, sum_sqr+cur_sum, &tmp); + my_decimal_div(E_DEC_FATAL_ERROR, &tmp, &sum2, &num, prec_increment); + my_decimal2double(E_DEC_FATAL_ERROR, &tmp, &std_sqr); + s->set(((double) std_sqr <= 0.0 ? 0.0 : sqrt(std_sqr)), + min(item->decimals + prec_increment, NOT_FIXED_DEC), my_thd_charset); + return s; } From bb17195a1ccba1d1feb29c898224e6d37ba9a1fb Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 1 Nov 2005 13:18:46 +0400 Subject: [PATCH 22/52] Fix for bug #14183 (ctype_cp983.test fails with the embedded server) --- mysql-test/r/ctype_cp932.result | 16 ------------ mysql-test/r/ctype_cp932_binlog.result | 19 ++++++++++++++ mysql-test/t/ctype_cp932.test | 23 ----------------- mysql-test/t/ctype_cp932_binlog.test | 35 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 39 deletions(-) create mode 100644 mysql-test/r/ctype_cp932_binlog.result create mode 100644 mysql-test/t/ctype_cp932_binlog.test diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/ctype_cp932.result index 8763055647c..b384eaa144d 100644 --- a/mysql-test/r/ctype_cp932.result +++ b/mysql-test/r/ctype_cp932.result @@ -8576,22 +8576,6 @@ FC4B DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; -RESET MASTER; -CREATE TABLE t1(f1 blob); -PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; -SET @var1= x'8300'; -EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 79; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) -master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 -master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1') -SELECT HEX(f1) FROM t1; -HEX(f1) -8300 -DROP table t1; SET collation_connection='cp932_japanese_ci'; create table t1 select repeat('a',4000) a; delete from t1; diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result new file mode 100644 index 00000000000..89f0ae71f4f --- /dev/null +++ b/mysql-test/r/ctype_cp932_binlog.result @@ -0,0 +1,19 @@ +drop table if exists t1; +set names cp932; +set character_set_database = cp932; +RESET MASTER; +CREATE TABLE t1(f1 blob); +PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; +SET @var1= x'8300'; +EXECUTE stmt1 USING @var1; +SHOW BINLOG EVENTS FROM 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 +master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 +master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary +master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1') +SELECT HEX(f1) FROM t1; +HEX(f1) +8300 +DROP table t1; diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/t/ctype_cp932.test index d6c3c226140..3ea8be211df 100644 --- a/mysql-test/t/ctype_cp932.test +++ b/mysql-test/t/ctype_cp932.test @@ -401,29 +401,6 @@ DROP TABLE t2; DROP TABLE t3; #DROP TABLE t4; -# Test prepared statement with 0x8300 sequence in parameter while -# running with cp932 client character set. -RESET MASTER; -CREATE TABLE t1(f1 blob); -PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; -SET @var1= x'8300'; -# TODO: Note that this doesn't actually test the code which was added for -# bug#11338 because this syntax for prepared statements causes the PS to -# be replicated differently than if we executed the PS from C or Java. -# Using this syntax, variable names are inserted into the binlog instead -# of values. The real goal of this test is to check the code that was -# added to Item_param::query_val_str() in order to do hex encoding of -# PS parameters when the client character set is cp932; -# Bug#11338 has an example java program which can be used to verify this -# code (and I have used it to test the fix) until there is some way to -# exercise this code from mysql-test-run. -EXECUTE stmt1 USING @var1; ---replace_column 2 # 5 # -SHOW BINLOG EVENTS FROM 79; -SELECT HEX(f1) FROM t1; -DROP table t1; -# end test for bug#11338 - SET collation_connection='cp932_japanese_ci'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/t/ctype_cp932_binlog.test new file mode 100644 index 00000000000..e8ec0d46caf --- /dev/null +++ b/mysql-test/t/ctype_cp932_binlog.test @@ -0,0 +1,35 @@ +-- source include/not_embedded.inc +-- source include/have_cp932.inc + +--character_set cp932 +--disable_warnings +drop table if exists t1; +--enable_warnings + +set names cp932; +set character_set_database = cp932; + +# Test prepared statement with 0x8300 sequence in parameter while +# running with cp932 client character set. +RESET MASTER; +CREATE TABLE t1(f1 blob); +PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; +SET @var1= x'8300'; +# TODO: Note that this doesn't actually test the code which was added for +# bug#11338 because this syntax for prepared statements causes the PS to +# be replicated differently than if we executed the PS from C or Java. +# Using this syntax, variable names are inserted into the binlog instead +# of values. The real goal of this test is to check the code that was +# added to Item_param::query_val_str() in order to do hex encoding of +# PS parameters when the client character set is cp932; +# Bug#11338 has an example java program which can be used to verify this +# code (and I have used it to test the fix) until there is some way to +# exercise this code from mysql-test-run. +EXECUTE stmt1 USING @var1; +--replace_column 2 # 5 # +SHOW BINLOG EVENTS FROM 79; +SELECT HEX(f1) FROM t1; +DROP table t1; +# end test for bug#11338 + +# End of 4.1 tests From 19502e8eb5a79f04611458ec3784373b756a7948 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 1 Nov 2005 13:00:02 +0200 Subject: [PATCH 23/52] Review of new pushed code Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort) Mark that add_time(), time_diff() and str_to_date() can return null values --- myisam/mi_check.c | 2 +- mysql-test/r/func_sapdb.result | 4 ++-- sql/item_func.cc | 1 - sql/item_timefunc.cc | 4 +++- sql/item_timefunc.h | 1 + sql/spatial.cc | 39 +++++++++++++++++++--------------- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 8783a5fef54..15d1cceebfe 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1839,7 +1839,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, if (sort_one_index(param,info,keyinfo,next_page,new_file)) { DBUG_PRINT("error", - ("From page: %ld, keyoffset: 0x%lx used_length: %d", + ("From page: %ld, keyoffset: %lu used_length: %d", (ulong) pagepos, (ulong) (keypos - buff), (int) used_length)); DBUG_DUMP("buff",(byte*) buff,used_length); diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 68c3baa7bde..ea40e1559fd 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -170,8 +170,8 @@ Field Type Null Key Default Extra f1 date 0000-00-00 f2 datetime YES NULL f3 time YES NULL -f4 time 00:00:00 -f5 time 00:00:00 +f4 time YES NULL +f5 time YES NULL f6 time 00:00:00 f7 datetime YES NULL f8 date YES NULL diff --git a/sql/item_func.cc b/sql/item_func.cc index aff4adb788a..df32672e12b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -766,7 +766,6 @@ void Item_func_abs::fix_length_and_dec() hybrid_type= REAL_RESULT; if (args[0]->result_type() == INT_RESULT) hybrid_type= INT_RESULT; - maybe_null= 1; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 7398b1746da..eb58b180ed7 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2381,6 +2381,7 @@ void Item_func_add_time::fix_length_and_dec() enum_field_types arg0_field_type; decimals=0; max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; /* The field type for the result of an Item_func_add_time function is defined @@ -2742,7 +2743,8 @@ Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg) void Item_func_str_to_date::fix_length_and_dec() { char format_buff[64]; - String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format; + String format_str(format_buff, sizeof(format_buff), &my_charset_bin); + String *format; maybe_null= 1; decimals=0; cached_field_type= MYSQL_TYPE_STRING; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 0df84d14bea..16c64620369 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -808,6 +808,7 @@ public: { decimals=0; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } Field *tmp_table_field(TABLE *t_arg) { diff --git a/sql/spatial.cc b/sql/spatial.cc index 9e72dfb9130..684f7e9ecf3 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -127,15 +127,14 @@ Geometry *Geometry::construct(Geometry_buffer *buffer, Geometry *result; char byte_order; - if (data_len < SRID_SIZE + 1 + 4) + if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4) return NULL; byte_order= data[SRID_SIZE]; geom_type= uint4korr(data + SRID_SIZE + 1); - data+= SRID_SIZE + WKB_HEADER_SIZE; if (!(result= create_by_typeid(buffer, (int) geom_type))) return NULL; - result->m_data= data; - result->m_data_end= data + (data_len - (SRID_SIZE + WKB_HEADER_SIZE)); + result->m_data= data+ SRID_SIZE + WKB_HEADER_SIZE; + result->m_data_end= data + data_len; return result; } @@ -737,7 +736,7 @@ uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, wkb+= ls_len; } - return wkb - wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1182,7 +1181,8 @@ uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len, return 0; res->q_append(n_line_strings); - for (wkb+=4; n_line_strings; n_line_strings--) + wkb+= 4; + while (n_line_strings--) { Gis_line_string ls; int ls_len; @@ -1197,10 +1197,11 @@ uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len, if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (ls_len + WKB_HEADER_SIZE); - len-= (ls_len + WKB_HEADER_SIZE); + ls_len+= WKB_HEADER_SIZE;; + wkb+= ls_len; + len-= ls_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1434,7 +1435,8 @@ uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len, return 0; res->q_append(n_poly); - for (wkb+=4; n_poly; n_poly--) + wkb+=4; + while (n_poly--) { Gis_polygon p; int p_len; @@ -1448,10 +1450,11 @@ uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len, if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (p_len + WKB_HEADER_SIZE); - len-= (p_len + WKB_HEADER_SIZE); + p_len+= WKB_HEADER_SIZE; + wkb+= p_len; + len-= p_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1731,7 +1734,8 @@ uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len, return 0; res->q_append(n_geom); - for (wkb+=4; n_geom; n_geom--) + wkb+= 4; + while (n_geom--) { Geometry_buffer buffer; Geometry *geom; @@ -1750,10 +1754,11 @@ uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len, !(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (g_len + WKB_HEADER_SIZE); - len-= (g_len + WKB_HEADER_SIZE); + g_len+= WKB_HEADER_SIZE; + wkb+= g_len; + len-= g_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } From f3502cd9838f75086de49478115d9a54d4a45a3d Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 1 Nov 2005 16:14:26 +0400 Subject: [PATCH 24/52] Additional fix for bug #14445 (analyse.test fails) --- mysql-test/r/analyse.result | 6 +++--- mysql-test/t/disabled.def | 1 + sql/sql_analyse.cc | 17 ++++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 0aaf59e9c9d..f4e547dbc66 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -107,7 +107,7 @@ insert into t1 values(1.1); insert into t1 values(2.2); select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.55000 ENUM('1.1','2.2') NOT NULL +test.t1.df 1.1 2.2 13 13 0 0 1.65000 0.55000 ENUM('1.1','2.2') NOT NULL drop table t1; create table t1 (d double); insert into t1 values (100000); @@ -138,6 +138,6 @@ insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL -sum(profit) 10 6900 11 11 0 0 1946 2867.6719 ENUM('10','275','600','6900') NOT NULL -avg(profit) 10.000000000 1380.000000000 21 21 0 0 394.687500000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL +sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL +avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL drop table t1,t2; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index eedf4b30e73..8e3dfa55847 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,3 +16,4 @@ rpl_until : Unstable test case, bug#12429 rpl_deadlock : Unstable test case, bug#12429 kill : Unstable test case, bug#9712 archive_gis : The test fails on 32bit Linux +user_var : Ramil should fix this soon diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index fe77628497a..e1f4b8f6076 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -466,7 +466,9 @@ void field_real::add() void field_decimal::add() { + /*TODO - remove rounding stuff after decimal_div returns proper frac */ my_decimal dec_buf, *dec= item->val_decimal(&dec_buf); + my_decimal rounded; uint length; TREE_ELEMENT *element; @@ -476,6 +478,9 @@ void field_decimal::add() return; } + my_decimal_round(E_DEC_FATAL_ERROR, dec, item->decimals, FALSE,&rounded); + dec= &rounded; + length= my_decimal_string_length(dec); if (decimal_is_zero(dec)) @@ -1021,10 +1026,16 @@ String *field_decimal::avg(String *s, ha_rows rows) s->set((double) 0.0, 1,my_thd_charset); return s; } - my_decimal num, avg_val; + my_decimal num, avg_val, rounded_avg; + int prec_increment= current_thd->variables.div_precincrement; + int2my_decimal(E_DEC_FATAL_ERROR, rows - nulls, FALSE, &num); - my_decimal_div(E_DEC_FATAL_ERROR, &avg_val, sum+cur_sum, &num, 0); - my_decimal2string(E_DEC_FATAL_ERROR, &avg_val, 0, 0, '0', s); + my_decimal_div(E_DEC_FATAL_ERROR, &avg_val, sum+cur_sum, &num, prec_increment); + /* TODO remove this after decimal_div returns proper frac */ + my_decimal_round(E_DEC_FATAL_ERROR, &avg_val, + min(sum[cur_sum].frac + prec_increment, DECIMAL_MAX_SCALE), + FALSE,&rounded_avg); + my_decimal2string(E_DEC_FATAL_ERROR, &rounded_avg, 0, 0, '0', s); return s; } From e5f48e13bfd6a792b80edc002ab3def5eb160f60 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 1 Nov 2005 15:54:30 +0200 Subject: [PATCH 25/52] Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements --- mysql-test/r/func_sapdb.result | 4 +-- mysql-test/r/type_newdecimal.result | 2 +- mysql-test/r/user_var.result | 11 ++++++++ mysql-test/t/disabled.def | 1 - mysql-test/t/user_var.test | 4 +++ sql/item.cc | 12 +++++---- sql/item_func.cc | 1 - sql/item_timefunc.h | 1 + sql/sql_base.cc | 19 ++++++------- sql/sql_lex.h | 4 +-- sql/sql_select.cc | 11 +++++--- sql/sql_view.cc | 42 ++++++++++++++--------------- sql/sql_view.h | 2 +- sql/table.cc | 9 +++---- 14 files changed, 70 insertions(+), 53 deletions(-) diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index f209866d953..d984eee80fa 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -180,8 +180,8 @@ Field Type Null Key Default Extra f1 date NO 0000-00-00 f2 datetime YES NULL f3 time YES NULL -f4 time NO 00:00:00 -f5 time NO 00:00:00 +f4 time YES NULL +f5 time YES NULL f6 time NO 00:00:00 f7 datetime YES NULL f8 date YES NULL diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 45eb8aab89e..dbae646c362 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -176,7 +176,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0', `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0', - `abs(-1.1)` decimal(2,1) default NULL, + `abs(-1.1)` decimal(2,1) NOT NULL default '0.0', `-(-1.1)` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index acdc793fb69..75a680e504d 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -123,6 +123,17 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; 0 1 1 0 1 3 2 0 3 6 3 0 +set @a=0; +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 8e3dfa55847..eedf4b30e73 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,4 +16,3 @@ rpl_until : Unstable test case, bug#12429 rpl_deadlock : Unstable test case, bug#12429 kill : Unstable test case, bug#9712 archive_gis : The test fails on 32bit Linux -user_var : Ramil should fix this soon diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index e3b5b4ef33e..61861c26ea8 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -70,6 +70,10 @@ create table t1 (i int not null); insert t1 values (1),(2),(2),(3),(3),(3); select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i; select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; + +set @a=0; +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; drop table t1; # diff --git a/sql/item.cc b/sql/item.cc index 51fb2fe34fd..1850b7d05c3 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5082,14 +5082,16 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) { DBUG_ASSERT(fixed == 0); /* We should only check that arg is in first table */ - st_table_list *orig_next_table= context->last_name_resolution_table; - context->last_name_resolution_table= context->first_name_resolution_table; - if (!arg->fixed && arg->fix_fields(thd, &arg)) + if (!arg->fixed) { + bool res; + st_table_list *orig_next_table= context->last_name_resolution_table; + context->last_name_resolution_table= context->first_name_resolution_table; + res= arg->fix_fields(thd, &arg); context->last_name_resolution_table= orig_next_table; - return TRUE; + if (res) + return TRUE; } - context->last_name_resolution_table= orig_next_table; if (arg->type() == REF_ITEM) { diff --git a/sql/item_func.cc b/sql/item_func.cc index df25c3c97fa..9c1d1f63635 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -636,7 +636,6 @@ void Item_func_num1::fix_num_length_and_dec() { decimals= args[0]->decimals; max_length= args[0]->max_length; - maybe_null= 1; } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 196966f5388..b2352e728c5 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -845,6 +845,7 @@ public: { decimals=0; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } Field *tmp_table_field(TABLE *t_arg) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2da0f7e2ce0..6651a638931 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -37,11 +37,11 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, TABLE_LIST *table_list, MEM_ROOT *mem_root); static void free_cache_entry(TABLE *entry); static void mysql_rm_tmp_tables(void); -static my_bool open_new_frm(const char *path, const char *alias, - const char *db, const char *table_name, - uint db_stat, uint prgflag, - uint ha_open_flags, TABLE *outparam, - TABLE_LIST *table_desc, MEM_ROOT *mem_root); +static bool open_new_frm(THD *thd, const char *path, const char *alias, + const char *db, const char *table_name, + uint db_stat, uint prgflag, + uint ha_open_flags, TABLE *outparam, + TABLE_LIST *table_desc, MEM_ROOT *mem_root); extern "C" byte *table_cache_key(const byte *record,uint *length, my_bool not_used __attribute__((unused))) @@ -1755,7 +1755,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, thd->open_options, entry)) && (error != 5 || (fn_format(path, path, 0, reg_ext, MY_UNPACK_FILENAME), - open_new_frm(path, alias, db, name, + open_new_frm(thd, path, alias, db, name, (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | HA_GET_INDEX | HA_TRY_READ_ONLY), READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, @@ -5260,6 +5260,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order) SYNOPSIS open_new_frm() + THD thread handler path path to .frm alias alias for table db database @@ -5273,8 +5274,8 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order) mem_root temporary MEM_ROOT for parsing */ -static my_bool -open_new_frm(const char *path, const char *alias, +static bool +open_new_frm(THD *thd, const char *path, const char *alias, const char *db, const char *table_name, uint db_stat, uint prgflag, uint ha_open_flags, TABLE *outparam, TABLE_LIST *table_desc, @@ -5296,7 +5297,7 @@ open_new_frm(const char *path, const char *alias, my_error(ER_WRONG_OBJECT, MYF(0), db, table_name, "BASE TABLE"); goto err; } - if (mysql_make_view(parser, table_desc)) + if (mysql_make_view(thd, parser, table_desc)) goto err; } else diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 132a0491968..a8bee9bb59b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -361,8 +361,8 @@ public: friend class st_select_lex_unit; friend bool mysql_new_select(struct st_lex *lex, bool move_down); - friend my_bool mysql_make_view (File_parser *parser, - TABLE_LIST *table); + friend bool mysql_make_view(THD *thd, File_parser *parser, + TABLE_LIST *table); private: void fast_exclude(); }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index af2e5879b95..61dc7772984 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1237,7 +1237,8 @@ JOIN::exec() if (zero_result_cause) { - (void) return_zero_rows(this, result, select_lex->leaf_tables, *columns_list, + (void) return_zero_rows(this, result, select_lex->leaf_tables, + *columns_list, send_row_on_empty_set(), select_options, zero_result_cause, @@ -1671,7 +1672,8 @@ JOIN::exec() { thd->proc_info="Sending data"; DBUG_PRINT("info", ("%s", thd->proc_info)); - result->send_fields(*columns_list, + result->send_fields((procedure ? curr_join->procedure_fields_list : + *curr_fields_list), Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF); error= do_select(curr_join, curr_fields_list, NULL, procedure); thd->limit_found_rows= curr_join->send_records; @@ -9023,7 +9025,6 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) int rc= 0; enum_nested_loop_state error= NESTED_LOOP_OK; JOIN_TAB *join_tab; - List *columns_list= procedure? &join->procedure_fields_list : fields; DBUG_ENTER("do_select"); join->procedure=procedure; @@ -9057,7 +9058,11 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) error= (*end_select)(join,join_tab,1); } else if (join->send_row_on_empty_set()) + { + List *columns_list= (procedure ? &join->procedure_fields_list : + fields); rc= join->result->send_data(*columns_list); + } } else { diff --git a/sql/sql_view.cc b/sql/sql_view.cc index b30f8cb156c..846130c53fc 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -728,20 +728,24 @@ loop_out: SYNOPSIS mysql_make_view() - parser - parser object; - table - TABLE_LIST structure for filling + thd Thread handler + parser parser object + table TABLE_LIST structure for filling RETURN 0 ok 1 error */ -my_bool -mysql_make_view(File_parser *parser, TABLE_LIST *table) +bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table) { - THD *thd= current_thd; + SELECT_LEX *end, *view_select; + LEX *old_lex, *lex; + Query_arena *arena, backup; + int res; + bool result; DBUG_ENTER("mysql_make_view"); - DBUG_PRINT("info", ("table=%p (%s)", table, table->table_name)); + DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name)); if (table->view) { @@ -765,16 +769,12 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) DBUG_RETURN(0); } - SELECT_LEX *end; - LEX *old_lex= thd->lex, *lex; - SELECT_LEX *view_select; - int res= 0; - /* For now we assume that tables will not be changed during PS life (it will be TRUE as far as we make new table cache). */ - Query_arena *arena= thd->stmt_arena, backup; + old_lex= thd->lex; + arena= thd->stmt_arena; if (arena->is_conventional()) arena= 0; else @@ -1133,23 +1133,21 @@ ok: (st_select_lex_node**)&old_lex->all_selects_list; ok2: - if (arena) - thd->restore_active_arena(arena, &backup); if (!old_lex->time_zone_tables_used && thd->lex->time_zone_tables_used) old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used; - thd->lex= old_lex; - if (!table->prelocking_placeholder && table->prepare_security(thd)) - DBUG_RETURN(1); + result= !table->prelocking_placeholder && table->prepare_security(thd); - DBUG_RETURN(0); - -err: +end: if (arena) thd->restore_active_arena(arena, &backup); + thd->lex= old_lex; + DBUG_RETURN(result); + +err: delete table->view; table->view= 0; // now it is not VIEW placeholder - thd->lex= old_lex; - DBUG_RETURN(1); + result= 1; + goto end; } diff --git a/sql/sql_view.h b/sql/sql_view.h index 4cc9eb454fb..f58fe1fc6ca 100644 --- a/sql/sql_view.h +++ b/sql/sql_view.h @@ -19,7 +19,7 @@ bool mysql_create_view(THD *thd, enum_view_create_mode mode); -my_bool mysql_make_view(File_parser *parser, TABLE_LIST *table); +bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table); bool mysql_drop_view(THD *thd, TABLE_LIST *view, enum_drop_mode drop_mode); diff --git a/sql/table.cc b/sql/table.cc index 75c04389411..a18ff4397d1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2654,7 +2654,7 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length) GRANT_INFO *grant; const char *db_name; const char *table_name; - Security_context *save_security_ctx= 0; + Security_context *save_security_ctx; Security_context *new_sctx= table_ref->security_ctx; bool res; @@ -2673,14 +2673,11 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length) table_name= table_ref->table->s->table_name; } + save_security_ctx= thd->security_ctx; if (new_sctx) - { - save_security_ctx= thd->security_ctx; thd->security_ctx= new_sctx; - } res= check_grant_column(thd, grant, db_name, table_name, name, length); - if (save_security_ctx) - thd->security_ctx= save_security_ctx; + thd->security_ctx= save_security_ctx; return res; } #endif From 2343ff86ca5e00486f476b23d1149609aaf7c8cb Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Tue, 1 Nov 2005 17:27:10 +0300 Subject: [PATCH 26/52] Fix bug #14466 lost sort order in GROUP_CONCAT() in a view Item_func_group_concat::print() wasn't printing sort order thus creating wrong view. This results in reported error. --- mysql-test/r/view.result | 12 ++++++++++++ mysql-test/t/view.test | 12 +++++++++++- sql/item_sum.cc | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 6f15e7af399..a74feb4de17 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2323,3 +2323,15 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where DROP VIEW v1,v2; DROP TABLE t1,t2,t3; +create table t1 (f1 int, f2 int); +insert into t1 values(1,1),(1,2),(1,3); +create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1; +create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1; +select * from v1; +f1 group_concat(f2 order by f2 asc) +1 1,2,3 +select * from v2; +f1 group_concat(f2 order by f2 desc) +1 3,2,1 +drop view v1,v2; +drop table t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index aa3189bad69..0bd0e572193 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2189,4 +2189,14 @@ EXPLAIN SELECT * FROM v2 WHERE a=1; DROP VIEW v1,v2; DROP TABLE t1,t2,t3; - +# +# Bug #14466 lost sort order in GROUP_CONCAT() in a view +# +create table t1 (f1 int, f2 int); +insert into t1 values(1,1),(1,2),(1,3); +create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1; +create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1; +select * from v1; +select * from v2; +drop view v1,v2; +drop table t1; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b56d99cf245..b2eaf39d624 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3173,6 +3173,10 @@ void Item_func_group_concat::print(String *str) if (i) str->append(','); (*order[i]->item)->print(str); + if (order[i]->asc) + str->append(" ASC"); + else + str->append(" DESC"); } } str->append(" separator \'", 12); From 46c4e7b6eac47775eccee5fa4987bfa8267877f7 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 1 Nov 2005 16:30:55 +0200 Subject: [PATCH 27/52] Changed MTR_BUILD_THREAD port reserving policy. --- mysql-test/mysql-test-run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 2133043a587..62c2b9014c3 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -223,10 +223,10 @@ MYSQL_MANAGER_USER=root # number is to be used, 0 - 16 or similar. # if [ -n "$MTR_BUILD_THREAD" ] ; then - MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 40 + 8120` + MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 5 + 10000` MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2` - SLAVE_MYPORT=`expr $MASTER_MYPORT + 16` - NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 24` + SLAVE_MYPORT=`expr $MASTER_MYPORT + 3` + NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 4` echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD" echo "Using MASTER_MYPORT = $MASTER_MYPORT" From 6d3bd1e0ee1faca402d65ecea834b7756e386e53 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Tue, 1 Nov 2005 20:53:27 +0300 Subject: [PATCH 28/52] sql_update.cc: After merge fix --- sql/sql_update.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 10debc9427d..bd19d4d85f3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -237,9 +237,8 @@ int mysql_update(THD *thd, } // Don't count on usage of 'only index' when calculating which key to use table->used_keys.clear_all(); - select= make_select(table, 0, 0, conds, 0, &error); if (limit) - select=make_select(table,0,0,conds,&error); + select= make_select(table, 0, 0, conds, 0, &error); if (error || !limit || (select && select->check_quick(thd, safe_update, limit))) { From 3a08c5257a10e4660baa3cfc3f3827d37aa2ab14 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Tue, 1 Nov 2005 19:37:59 +0100 Subject: [PATCH 29/52] fix for bug #14381 (BDB keylength limitted to 255) --- mysql-test/r/bdb.result | 56 +++++++++++++++++++---------------------- sql/ha_berkeley.h | 4 +-- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 2bba44d36e9..530ff6ef59b 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1584,8 +1584,6 @@ g 10 h 10 i 10 alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v); -Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1594,7 +1592,7 @@ t1 CREATE TABLE `t1` ( `t` text, KEY `c` (`c`), KEY `t` (`t`(10)), - KEY `v` (`v`(255)) + KEY `v` (`v`) ) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 select count(*) from t1 where v='a'; count(*) @@ -1616,19 +1614,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL # Using where +1 SIMPLE t1 range v v 303 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -1656,15 +1654,15 @@ i 10 select sql_big_result v,count(t) from t1 group by v limit 10; v count(t) a 1 -a 10 -b 10 -c 10 -d 10 -e 10 -f 10 -g 10 -h 10 -i 10 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 alter table t1 drop key v, add key v (v(30)); show create table t1; Table Create Table @@ -1746,8 +1744,6 @@ g 10 h 10 i 10 alter table t1 modify v varchar(600), drop key v, add key v (v); -Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1756,7 +1752,7 @@ t1 CREATE TABLE `t1` ( `t` text, KEY `c` (`c`), KEY `t` (`t`(10)), - KEY `v` (`v`(255)) + KEY `v` (`v`) ) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 select v,count(*) from t1 group by v limit 10; v count(*) @@ -1785,15 +1781,15 @@ i 10 select sql_big_result v,count(t) from t1 group by v limit 10; v count(t) a 1 -a 10 -b 10 -c 10 -d 10 -e 10 -f 10 -g 10 -h 10 -i 10 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a '); @@ -1874,7 +1870,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes +Warning 1071 Specified key was too long; max key length is 1024 bytes drop table if exists t1; create table t1 (v varchar(65536)); Warnings: diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index c747b4eef81..99e13286554 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -94,8 +94,8 @@ class ha_berkeley: public handler uint max_supported_keys() const { return MAX_KEY-1; } uint extra_rec_buf_length() { return BDB_HIDDEN_PRIMARY_KEY_LENGTH; } ha_rows estimate_rows_upper_bound(); - uint max_supported_key_length() const { return MAX_KEY_LENGTH; } - uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; } + uint max_supported_key_length() const { return 4294967295L; } + uint max_supported_key_part_length() const { return 4294967295L; } const key_map *keys_to_use_for_scanning() { return &key_map_full; } bool has_transactions() { return 1;} From f10399d77e9f74bdc8cff287519971e96ab109d4 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 1 Nov 2005 21:57:24 +0200 Subject: [PATCH 30/52] Add missing return Compile max with --yassl instead of --with-openssl --- BUILD/SETUP.sh | 4 ++-- sql/table.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 96ec5803b63..d598ab94fd0 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -52,9 +52,9 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" -base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" +base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" -max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables" +max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-yassl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server" diff --git a/sql/table.cc b/sql/table.cc index a18ff4397d1..0ea153fa1f2 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2538,11 +2538,11 @@ bool st_table_list::prepare_security(THD *thd) tbl->table->grant= grant; } thd->security_ctx= save_security_ctx; - DBUG_RETURN(FALSE); #else while ((tbl= tb++)) tbl->grant.privilege= ~NO_ACCESS; #endif + DBUG_RETURN(FALSE); } From 3a072a0eef0d669f6f662be2686ffcfe6ab3e36e Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 1 Nov 2005 21:59:24 +0200 Subject: [PATCH 31/52] Added missing DBUG_ENTER (bug in last push) --- sql/table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index 0ea153fa1f2..cbc4342f123 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2511,9 +2511,9 @@ bool st_table_list::prepare_security(THD *thd) { List_iterator_fast tb(*view_tables); TABLE_LIST *tbl; + DBUG_ENTER("st_table_list::prepare_security"); #ifndef NO_EMBEDDED_ACCESS_CHECKS Security_context *save_security_ctx= thd->security_ctx; - DBUG_ENTER("st_table_list::prepare_security"); DBUG_ASSERT(!prelocking_placeholder); if (prepare_view_securety_context(thd)) From 164b4696605febcd65a00e4949d5a31fceb316b8 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 2 Nov 2005 14:43:25 +0200 Subject: [PATCH 32/52] Fixed wrong merge Optimize new pushed code --- sql/item_func.cc | 1 - sql/sql_update.cc | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 44cee556dbd..9c1d1f63635 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1378,7 +1378,6 @@ my_decimal *Item_func_abs::decimal_op(my_decimal *decimal_value) void Item_func_abs::fix_length_and_dec() { Item_func_num1::fix_length_and_dec(); - maybe_null= 1; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index bd19d4d85f3..039aa0f71fa 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -121,7 +121,7 @@ int mysql_update(THD *thd, bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table; int res; - int error=0; + int error; uint used_index= MAX_KEY; bool need_sort= TRUE; #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -132,7 +132,7 @@ int mysql_update(THD *thd, ha_rows updated, found; key_map old_used_keys; TABLE *table; - SQL_SELECT *select= 0; + SQL_SELECT *select; READ_RECORD info; SELECT_LEX *select_lex= &thd->lex->select_lex; bool need_reopen; @@ -237,8 +237,7 @@ int mysql_update(THD *thd, } // Don't count on usage of 'only index' when calculating which key to use table->used_keys.clear_all(); - if (limit) - select= make_select(table, 0, 0, conds, 0, &error); + select= make_select(table, 0, 0, conds, 0, &error); if (error || !limit || (select && select->check_quick(thd, safe_update, limit))) { From b43ca42959be8115a1b80b4f1aa7b2a1afca2576 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 2 Nov 2005 14:57:18 +0200 Subject: [PATCH 33/52] Build max builds with --yassl instead of openssl --- BUILD/SETUP.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index d598ab94fd0..3a330853855 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -52,8 +52,8 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" -base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" -base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" +base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" +base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-yassl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server" From efbdd24c969779ead230ef7e7c0774de0c6270ee Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Wed, 2 Nov 2005 15:17:57 +0200 Subject: [PATCH 34/52] found problem removed --- sql/sql_parse.cc | 2 ++ sql/table.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 51d655334f8..aab4caec5d4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1767,6 +1767,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, /* Saved variable value */ my_bool old_innodb_table_locks= IF_INNOBASE_DB(thd->variables.innodb_table_locks, FALSE); + /* used as fields initializator */ + lex_start(thd, 0, 0); statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS], diff --git a/sql/table.cc b/sql/table.cc index 507e5e163d6..809787a9203 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2538,11 +2538,11 @@ bool st_table_list::prepare_security(THD *thd) tbl->table->grant= grant; } thd->security_ctx= save_security_ctx; - DBUG_RETURN(FALSE); #else while ((tbl= tb++)) tbl->grant.privilege= ~NO_ACCESS; #endif + DBUG_RETURN(FALSE); } From e7fd63bf0ef6575cd28bcefd3b1ef7e7881bf517 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 2 Nov 2005 14:32:50 +0100 Subject: [PATCH 35/52] Portability fix, opnsrv6c --- mysys/base64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysys/base64.c b/mysys/base64.c index 0fcd6f096f5..fed7a7acc41 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -129,7 +129,7 @@ base64_decode(const char *src, size_t size, void *dst) { char b[3]; size_t i= 0; - void *d= dst; + unsigned char *d= (unsigned char*)dst; size_t j; while (i < size) @@ -181,14 +181,14 @@ base64_decode(const char *src, size_t size, void *dst) b[2]= (c >> 0) & 0xff; for (j=0; j<3-mark; j++) - *(char *)d++= b[j]; + *d++= b[j]; } if (i != size) { return -1; } - return d - dst; + return d - (unsigned char*)dst; } From a7c6a100f091f75ff2a9b617295b76a2fe9075d0 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 2 Nov 2005 15:45:25 +0200 Subject: [PATCH 36/52] Use --with-openssl instead of --with-yassl for now --- BUILD/SETUP.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 3a330853855..4f2065657d5 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -44,17 +44,21 @@ set -e export AM_MAKEFLAGS AM_MAKEFLAGS="-j 4" +# SSL library to use. Should be changed to --with-yassl +SSL_LIBRARY=--with-openssl + # If you are not using codefusion add "-Wpointer-arith" to WARNINGS # The following warning flag will give too many warnings: # -Wshadow -Wunused -Winline (The later isn't usable in C++ as # __attribute()__ doesn't work with gnu C++) + global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" -base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" -base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-yassl" -max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-yassl --with-embedded-server --with-big-tables" +base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY" +base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY" +max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine $SSL_LIBRARY --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server" From 54d9d2e1169233686b1357d28e0d30f3391a861b Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 2 Nov 2005 16:28:58 +0200 Subject: [PATCH 37/52] Portability fix (BDB test failed in Intel64) --- mysql-test/r/bdb.result | 2 +- mysql-test/t/bdb.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 530ff6ef59b..5cdf9612300 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1870,7 +1870,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 1024 bytes +Warning 1071 Specified key was too long; max key length is MAX_KEY_LENGTH bytes drop table if exists t1; create table t1 (v varchar(65536)); Warnings: diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 3167682f816..97d8f28cd3f 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -962,6 +962,7 @@ source include/varchar.inc; # Some errors/warnings on create # +--replace_result 1024 MAX_KEY_LENGTH 3072 MAX_KEY_LENGTH create table t1 (v varchar(65530), key(v)); drop table if exists t1; create table t1 (v varchar(65536)); From 4eea84268be0bd4f73d9bd988dc8e41702c8a3b8 Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Wed, 2 Nov 2005 18:46:13 +0400 Subject: [PATCH 38/52] Additional fix for #13573 --- strings/decimal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/strings/decimal.c b/strings/decimal.c index ea6ac2caf38..f536bdb1d6b 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1986,7 +1986,11 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) carry+=hi; } for (; carry; buf0--) + { + if (buf0 < to->buf) + return E_DEC_OVERFLOW; ADD(*buf0, *buf0, 0, carry); + } } /* Now we have to check for -0.000 case */ From 8e7dfad543a04f75d5eed866193813ffbfb85f16 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 2 Nov 2005 15:53:04 +0100 Subject: [PATCH 39/52] BUG#14514 Creating table with packed key fails silently --- include/my_base.h | 2 +- sql/ha_ndbcluster.cc | 2 +- sql/handler.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index c76cf8c604e..ba3edfad0c8 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -248,6 +248,7 @@ enum ha_base_keytype { #define HA_OPTION_CHECKSUM 32 #define HA_OPTION_DELAY_KEY_WRITE 64 #define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */ +#define HA_OPTION_CREATE_FROM_ENGINE 256 #define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */ #define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */ @@ -258,7 +259,6 @@ enum ha_base_keytype { #define HA_CREATE_TMP_TABLE 4 #define HA_CREATE_CHECKSUM 8 #define HA_CREATE_DELAY_KEY_WRITE 64 -#define HA_CREATE_FROM_ENGINE 128 /* Bits in flag to _status */ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 4248230abbe..71bd3acd2a6 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3861,7 +3861,7 @@ int ha_ndbcluster::create(const char *name, uint pack_length, length, i, pk_length= 0; const void *data, *pack_data; char name2[FN_HEADLEN]; - bool create_from_engine= (info->table_options & HA_CREATE_FROM_ENGINE); + bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE); DBUG_ENTER("ha_ndbcluster::create"); DBUG_PRINT("enter", ("name: %s", name)); diff --git a/sql/handler.cc b/sql/handler.cc index 81e94af5dc7..0cc3deda523 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2016,7 +2016,7 @@ int ha_create_table_from_engine(THD* thd, DBUG_RETURN(3); update_create_info_from_table(&create_info, &table); - create_info.table_options|= HA_CREATE_FROM_ENGINE; + create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE; if (lower_case_table_names == 2 && !(table.file->table_flags() & HA_FILE_BASED)) From 9c94aef407980c1e6bcee979fd10f2b0a68b1a17 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 2 Nov 2005 17:34:40 +0100 Subject: [PATCH 40/52] BUG#14514 - Add tests --- mysql-test/r/ndb_basic.result | 4 ++++ mysql-test/t/ndb_basic.test | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index a374f845933..e288592c390 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -673,3 +673,7 @@ select * from atablewithareallylongandirritatingname; a 2 drop table atablewithareallylongandirritatingname; +CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb; +select * from t1; +b +drop table t1; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 1c78a4b8744..1a351018b8d 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -615,3 +615,12 @@ create table atablewithareallylongandirritatingname (a int); insert into atablewithareallylongandirritatingname values (2); select * from atablewithareallylongandirritatingname; drop table atablewithareallylongandirritatingname; + + +# +# BUG#14514 +# + +CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb; +select * from t1; +drop table t1; From f2f4bf5240121151b08d8a025dadc3dc141a5a48 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 2 Nov 2005 19:28:49 +0200 Subject: [PATCH 41/52] wait_for_update must unlock mutex. (Fixed failure in rpl0000008.test) --- sql/log.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/log.cc b/sql/log.cc index f9f71e2d55a..baa2edab101 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2074,7 +2074,10 @@ void MYSQL_LOG::wait_for_update(THD* thd, bool is_slave) DBUG_ENTER("wait_for_update"); if (reset_pending) + { + pthread_mutex_unlock(&LOCK_log); DBUG_VOID_RETURN; + } old_msg= thd->enter_cond(&update_cond, &LOCK_log, is_slave ? From c2f224be5e48d48f7e4bea42344ae543bb851de3 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 2 Nov 2005 20:44:09 +0300 Subject: [PATCH 42/52] Fix -ansi -pedantic compilation failure --- sql/spatial.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/spatial.h b/sql/spatial.h index 6189d5c1462..4253689c078 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -245,8 +245,8 @@ public: static Geometry *create_from_wkt(Geometry_buffer *buffer, Gis_read_stream *trs, String *wkt, bool init_stream=1); - static int Geometry::create_from_wkb(Geometry_buffer *buffer, - const char *wkb, uint32 len, String *res); + static int create_from_wkb(Geometry_buffer *buffer, + const char *wkb, uint32 len, String *res); int as_wkt(String *wkt, const char **end) { uint32 len= get_class_info()->m_name.length; From 93cc0de7cfed2ec0cec5e07269995972cec1fa10 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Thu, 3 Nov 2005 01:50:36 +0300 Subject: [PATCH 43/52] func_gconcat.result: Fixed wrong test case table.cc: Fixed wrong DBUG_ENTER placement --- mysql-test/r/func_gconcat.result | 4 ++-- sql/table.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 6461c393d51..90884dcc596 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp` +Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` DESC separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp` select grp,group_concat(c order by c separator ",") from t1 group by grp; grp group_concat(c order by c separator ",") 1 a @@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp` +Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` ASC separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp` select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; grp group_concat(distinct c order by c desc separator ",") 1 a diff --git a/sql/table.cc b/sql/table.cc index 809787a9203..dd6018b70f3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2511,9 +2511,9 @@ bool st_table_list::prepare_security(THD *thd) { List_iterator_fast tb(*view_tables); TABLE_LIST *tbl; + DBUG_ENTER("st_table_list::prepare_security"); #ifndef NO_EMBEDDED_ACCESS_CHECKS Security_context *save_security_ctx= thd->security_ctx; - DBUG_ENTER("st_table_list::prepare_security"); DBUG_ASSERT(!prelocking_placeholder); if (prepare_view_securety_context(thd)) From d03662cd37ab33f07584115c0399fe12b5567a79 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 3 Nov 2005 11:05:52 +0200 Subject: [PATCH 44/52] Changed mysql-test-run to correspond to the one in 5.0 tree. --- mysql-test/mysql-test-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 9a2c4345bae..296bbecc843 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -208,9 +208,9 @@ MYSQL_MANAGER_USER=root # number is to be used, 0 - 16 or similar. # if [ -n "$MTR_BUILD_THREAD" ] ; then - MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 40 + 8120` - SLAVE_MYPORT=`expr $MASTER_MYPORT + 16` + MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 5 + 10000` MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2` + SLAVE_MYPORT=`expr $MASTER_MYPORT + 3` echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD" echo "Using MASTER_MYPORT = $MASTER_MYPORT" From 2476aa5a70a6b3b402b448671ef980269b7ce352 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 3 Nov 2005 11:19:06 +0200 Subject: [PATCH 45/52] Added new build script for pentium64. --- BUILD/compile-pentium64-debug-max | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 BUILD/compile-pentium64-debug-max diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max new file mode 100755 index 00000000000..f0745c88c90 --- /dev/null +++ b/BUILD/compile-pentium64-debug-max @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" $@ --with-debug=full + +extra_flags="$pentium64_cflags $debug_cflags $max_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $max_configs" + +extra_configs="$extra_configs " + +. "$path/FINISH.sh" From 8243eee9db2f67eec2403d1dfe0877c0bbd6a821 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 3 Nov 2005 11:47:54 +0200 Subject: [PATCH 46/52] Added test-force to Makefile. --- Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 35c5a51caf4..54bafaaa40a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,3 +96,7 @@ tags: test: cd mysql-test ; \ ./mysql-test-run + +test-force: + cd mysql-test ; \ + ./mysql-test-run --force From 30fdafea765579e88cd6035a70fc4676b9b4960c Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Thu, 3 Nov 2005 13:53:49 +0300 Subject: [PATCH 47/52] Fix bug #14093 Query takes a lot of time when date format is not valid Invalid date like 2000-02-32 wasn't converted to int, which lead to not using index and comparison with field as astring, which results in slow query execution. convert_constatn_item() and get_mm_leaf() now forces MODE_INVALID_DATES to allow such conversion. --- mysql-test/r/select.result | 40 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/select.test | 18 +++++++++++++++++ sql/item.h | 1 + sql/item_cmpfunc.cc | 5 +++++ sql/opt_range.cc | 9 ++++++++- 5 files changed, 72 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index cd7c70b603c..7ceedea344f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3193,3 +3193,43 @@ a b c select * from t1 join t2 straight_join t3 on (t1.a=t3.c); a b c drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-31'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-3a'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +select * from t1 where f2 <= '2005-09-3a'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index a3d83c531d2..128115ed12a 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2702,3 +2702,21 @@ select * from t1 join t2 left join t3 on (t1.a=t3.c); select * from t1 join t2 right join t3 on (t1.a=t3.c); select * from t1 join t2 straight_join t3 on (t1.a=t3.c); drop table t1, t2 ,t3; + +# +# Bug #14093 Query takes a lot of time when date format is not valid +# fix optimizes execution. so here we just check that returned set is +# correct. +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), + (4,'2005-10-01'),(5,'2005-12-30'); +# should return all records +select * from t1 where f2 >= 0; +select * from t1 where f2 >= '0000-00-00'; +# should return 4,5 +select * from t1 where f2 >= '2005-09-31'; +select * from t1 where f2 >= '2005-09-3a'; +# should return 1,2,3 +select * from t1 where f2 <= '2005-09-31'; +select * from t1 where f2 <= '2005-09-3a'; +drop table t1; diff --git a/sql/item.h b/sql/item.h index 3e52cbe5fd7..5f31e402c77 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1749,6 +1749,7 @@ public: return ref->save_in_field(field, no_conversions); } Item *new_item(); + virtual Item *real_item() { return ref; } }; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 761d15c8a3e..06cb83a7101 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -186,13 +186,18 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) { if ((*item)->const_item()) { + /* For comparison purposes allow invalid dates like 2000-01-32 */ + ulong orig_sql_mode= field->table->in_use->variables.sql_mode; + field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES; if (!(*item)->save_in_field(field, 1) && !((*item)->null_value)) { Item *tmp=new Item_int_with_ref(field->val_int(), *item); + field->table->in_use->variables.sql_mode= orig_sql_mode; if (tmp) thd->change_item_tree(item, tmp); return 1; // Item was replaced } + field->table->in_use->variables.sql_mode= orig_sql_mode; } return 0; } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ff2b14a27ee..4a9e2556df7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3921,13 +3921,20 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part, value->result_type() != STRING_RESULT && field->cmp_type() != value->result_type()) goto end; - + /* For comparison purposes allow invalid dates like 2000-01-32 */ + ulong orig_sql_mode= field->table->in_use->variables.sql_mode; + if (value->real_item()->type() == Item::STRING_ITEM && + (field->type() == FIELD_TYPE_DATE || + field->type() == FIELD_TYPE_DATETIME)) + field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES; if (value->save_in_field_no_warnings(field, 1) < 0) { + field->table->in_use->variables.sql_mode= orig_sql_mode; /* This happens when we try to insert a NULL field in a not null column */ tree= &null_element; // cmp with NULL is never TRUE goto end; } + field->table->in_use->variables.sql_mode= orig_sql_mode; str= (char*) alloc_root(alloc, key_part->store_length+1); if (!str) goto end; From 7e3f757f2deb08b4f2adb1b4cdd1a764d9678129 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 3 Nov 2005 14:20:13 +0300 Subject: [PATCH 48/52] A fix and a test case for Bug#14210 "Simple query with > operator on large table gives server crash": make sure that when a MyISAM temporary table is created for a cursor, it's created in its memory root, not the memory root of the current query. --- mysql-test/r/sp.result | 42 ++++++++++++++++++++++++++++++ mysql-test/t/sp.test | 52 +++++++++++++++++++++++++++++++++++++ sql/handler.cc | 36 ++++++++++++++------------ sql/handler.h | 2 +- sql/opt_range.cc | 2 +- sql/sql_base.cc | 2 +- sql/sql_select.cc | 9 ++++--- sql/sql_table.cc | 6 +++-- sql/table.cc | 3 ++- sql/unireg.cc | 4 +-- tests/mysql_client_test.c | 54 +++++++++++++++++++++++++++++++++++++++ 11 files changed, 184 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1f3f7dba7da..d50e6dd3751 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3575,4 +3575,46 @@ DROP VIEW bug13095_v1 DROP PROCEDURE IF EXISTS bug13095; DROP VIEW IF EXISTS bug13095_v1; DROP TABLE IF EXISTS bug13095_t1; +drop procedure if exists bug14210| +set @@session.max_heap_table_size=16384| +select @@session.max_heap_table_size| +@@session.max_heap_table_size +16384 +create table t3 (a char(255)) engine=InnoDB| +create procedure bug14210_fill_table() +begin +declare table_size, max_table_size int default 0; +select @@session.max_heap_table_size into max_table_size; +delete from t3; +insert into t3 (a) values (repeat('a', 255)); +repeat +insert into t3 select a from t3; +select count(*)*255 from t3 into table_size; +until table_size > max_table_size*2 end repeat; +end| +call bug14210_fill_table()| +drop procedure bug14210_fill_table| +create table t4 like t3| +create procedure bug14210() +begin +declare a char(255); +declare done int default 0; +declare c cursor for select * from t3; +declare continue handler for sqlstate '02000' set done = 1; +open c; +repeat +fetch c into a; +if not done then +insert into t4 values (upper(a)); +end if; +until done end repeat; +close c; +end| +call bug14210()| +select count(*) from t4| +count(*) +256 +drop table t3, t4| +drop procedure bug14210| +set @@session.max_heap_table_size=default| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index ab57139bb77..eaf69c0ab03 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4488,6 +4488,58 @@ DROP TABLE IF EXISTS bug13095_t1; delimiter |; +# +# BUG#14210: "Simple query with > operator on large table gives server +# crash" +# Check that cursors work in case when HEAP tables are converted to +# MyISAM +# +--disable_warnings +drop procedure if exists bug14210| +--enable_warnings +set @@session.max_heap_table_size=16384| +select @@session.max_heap_table_size| +# To trigger the memory corruption the original table must be InnoDB. +# No harm if it's not, so don't warn if the suite is run with --skip-innodb +--disable_warnings +create table t3 (a char(255)) engine=InnoDB| +--enable_warnings +create procedure bug14210_fill_table() +begin + declare table_size, max_table_size int default 0; + select @@session.max_heap_table_size into max_table_size; + delete from t3; + insert into t3 (a) values (repeat('a', 255)); + repeat + insert into t3 select a from t3; + select count(*)*255 from t3 into table_size; + until table_size > max_table_size*2 end repeat; +end| +call bug14210_fill_table()| +drop procedure bug14210_fill_table| +create table t4 like t3| + +create procedure bug14210() +begin + declare a char(255); + declare done int default 0; + declare c cursor for select * from t3; + declare continue handler for sqlstate '02000' set done = 1; + open c; + repeat + fetch c into a; + if not done then + insert into t4 values (upper(a)); + end if; + until done end repeat; + close c; +end| +call bug14210()| +select count(*) from t4| + +drop table t3, t4| +drop procedure bug14210| +set @@session.max_heap_table_size=default| # # BUG#NNNN: New bug synopsis diff --git a/sql/handler.cc b/sql/handler.cc index 81e94af5dc7..fe0af04cf48 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -293,61 +293,61 @@ enum db_type ha_checktype(THD *thd, enum db_type database_type, } /* ha_checktype */ -handler *get_new_handler(TABLE *table, enum db_type db_type) +handler *get_new_handler(TABLE *table, MEM_ROOT *alloc, enum db_type db_type) { switch (db_type) { #ifndef NO_HASH case DB_TYPE_HASH: - return new ha_hash(table); + return new (alloc) ha_hash(table); #endif case DB_TYPE_MRG_ISAM: - return new ha_myisammrg(table); + return new (alloc) ha_myisammrg(table); #ifdef HAVE_BERKELEY_DB case DB_TYPE_BERKELEY_DB: - return new ha_berkeley(table); + return new (alloc) ha_berkeley(table); #endif #ifdef HAVE_INNOBASE_DB case DB_TYPE_INNODB: - return new ha_innobase(table); + return new (alloc) ha_innobase(table); #endif #ifdef HAVE_EXAMPLE_DB case DB_TYPE_EXAMPLE_DB: - return new ha_example(table); + return new (alloc) ha_example(table); #endif #ifdef HAVE_ARCHIVE_DB case DB_TYPE_ARCHIVE_DB: - return new ha_archive(table); + return new (alloc) ha_archive(table); #endif #ifdef HAVE_BLACKHOLE_DB case DB_TYPE_BLACKHOLE_DB: - return new ha_blackhole(table); + return new (alloc) ha_blackhole(table); #endif #ifdef HAVE_FEDERATED_DB case DB_TYPE_FEDERATED_DB: - return new ha_federated(table); + return new (alloc) ha_federated(table); #endif #ifdef HAVE_CSV_DB case DB_TYPE_CSV_DB: - return new ha_tina(table); + return new (alloc) ha_tina(table); #endif #ifdef HAVE_NDBCLUSTER_DB case DB_TYPE_NDBCLUSTER: - return new ha_ndbcluster(table); + return new (alloc) ha_ndbcluster(table); #endif case DB_TYPE_HEAP: - return new ha_heap(table); + return new (alloc) ha_heap(table); default: // should never happen { enum db_type def=(enum db_type) current_thd->variables.table_type; /* Try first with 'default table type' */ if (db_type != def) - return get_new_handler(table, def); + return get_new_handler(table, alloc, def); } /* Fall back to MyISAM */ case DB_TYPE_MYISAM: - return new ha_myisam(table); + return new (alloc) ha_myisam(table); case DB_TYPE_MRG_MYISAM: - return new ha_myisammrg(table); + return new (alloc) ha_myisammrg(table); } } @@ -1300,7 +1300,7 @@ int ha_delete_table(THD *thd, enum db_type table_type, const char *path, /* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */ if (table_type == DB_TYPE_UNKNOWN || - ! (file=get_new_handler(&dummy_table, table_type))) + ! (file=get_new_handler(&dummy_table, thd->mem_root, table_type))) DBUG_RETURN(ENOENT); if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED)) @@ -2469,6 +2469,7 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key, TYPELIB *ha_known_exts(void) { + MEM_ROOT *mem_root= current_thd->mem_root; if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) { handlerton **types; @@ -2483,7 +2484,8 @@ TYPELIB *ha_known_exts(void) { if ((*types)->state == SHOW_OPTION_YES) { - handler *file= get_new_handler(0,(enum db_type) (*types)->db_type); + handler *file= get_new_handler(0, mem_root, + (enum db_type) (*types)->db_type); for (ext= file->bas_ext(); *ext; ext++) { while ((old_ext= it++)) diff --git a/sql/handler.h b/sql/handler.h index af80f021e75..e16c428954c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -874,7 +874,7 @@ extern ulong total_ha, total_ha_2pc; /* lookups */ enum db_type ha_resolve_by_name(const char *name, uint namelen); const char *ha_get_storage_engine(enum db_type db_type); -handler *get_new_handler(TABLE *table, enum db_type db_type); +handler *get_new_handler(TABLE *table, MEM_ROOT *alloc, enum db_type db_type); enum db_type ha_checktype(THD *thd, enum db_type database_type, bool no_substitute, bool report_error); bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ff2b14a27ee..1dc2996e351 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -931,7 +931,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) } THD *thd= current_thd; - if (!(file= get_new_handler(head, head->s->db_type))) + if (!(file= get_new_handler(head, thd->mem_root, head->s->db_type))) goto failure; DBUG_PRINT("info", ("Allocated new handler %p", file)); if (file->ha_open(head->s->path, head->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 5c929dcdf69..15fb477b0d1 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2634,7 +2634,7 @@ bool rm_temporary_table(enum db_type base, char *path) if (my_delete(path,MYF(0))) error=1; /* purecov: inspected */ *fn_ext(path)='\0'; // remove extension - handler *file=get_new_handler((TABLE*) 0, base); + handler *file= get_new_handler((TABLE*) 0, current_thd->mem_root, base); if (file && file->delete_table(path)) { error=1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 285a5c5696b..f6e1f7e80e9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8279,7 +8279,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, (select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) == OPTION_BIG_TABLES || (select_options & TMP_TABLE_FORCE_MYISAM)) { - table->file=get_new_handler(table,table->s->db_type= DB_TYPE_MYISAM); + table->file= get_new_handler(table, &table->mem_root, + table->s->db_type= DB_TYPE_MYISAM); if (group && (param->group_parts > table->file->max_key_parts() || param->group_length > table->file->max_key_length())) @@ -8287,7 +8288,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, } else { - table->file=get_new_handler(table,table->s->db_type= DB_TYPE_HEAP); + table->file= get_new_handler(table, &table->mem_root, + table->s->db_type= DB_TYPE_HEAP); } if (!using_unique_constraint) @@ -8871,7 +8873,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, new_table= *table; new_table.s= &new_table.share_not_to_be_used; new_table.s->db_type= DB_TYPE_MYISAM; - if (!(new_table.file= get_new_handler(&new_table,DB_TYPE_MYISAM))) + if (!(new_table.file= get_new_handler(&new_table, &new_table.mem_root, + DB_TYPE_MYISAM))) DBUG_RETURN(1); // End of memory save_proc_info=thd->proc_info; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b635c44c6dc..ee5acea87c0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1508,7 +1508,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, if (create_info->row_type == ROW_TYPE_DYNAMIC) db_options|=HA_OPTION_PACK_RECORD; alias= table_case_name(create_info, table_name); - file=get_new_handler((TABLE*) 0, create_info->db_type); + file= get_new_handler((TABLE*) 0, thd->mem_root, create_info->db_type); #ifdef NOT_USED /* @@ -1806,10 +1806,12 @@ mysql_rename_table(enum db_type base, const char *new_db, const char *new_name) { + THD *thd= current_thd; char from[FN_REFLEN], to[FN_REFLEN], lc_from[FN_REFLEN], lc_to[FN_REFLEN]; char *from_base= from, *to_base= to; char tmp_name[NAME_LEN+1]; - handler *file=(base == DB_TYPE_UNKNOWN ? 0 : get_new_handler((TABLE*) 0, base)); + handler *file= (base == DB_TYPE_UNKNOWN ? 0 : + get_new_handler((TABLE*) 0, thd->mem_root, base)); int error=0; DBUG_ENTER("mysql_rename_table"); diff --git a/sql/table.cc b/sql/table.cc index dd6018b70f3..1acf49bc03e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -338,7 +338,8 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, my_free(buff, MYF(0)); } /* Allocate handler */ - if (!(outparam->file= get_new_handler(outparam, share->db_type))) + if (!(outparam->file= get_new_handler(outparam, &outparam->mem_root, + share->db_type))) goto err; error=4; diff --git a/sql/unireg.cc b/sql/unireg.cc index 065f8583f71..0ab77462f61 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -90,7 +90,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, if (!(screen_buff=pack_screens(create_fields,&info_length,&screens,0))) DBUG_RETURN(1); if (db_file == NULL) - db_file= get_new_handler((TABLE*) 0, create_info->db_type); + db_file= get_new_handler((TABLE*) 0, thd->mem_root, create_info->db_type); /* If fixed row records, we need one bit to check for deleted rows */ if (!(create_info->table_options & HA_OPTION_PACK_RECORD)) @@ -699,7 +699,7 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, /* We need a table to generate columns for default values */ bzero((char*) &table,sizeof(table)); table.s= &table.share_not_to_be_used; - handler= get_new_handler((TABLE*) 0, table_type); + handler= get_new_handler((TABLE*) 0, thd->mem_root, table_type); if (!handler || !(buff=(uchar*) my_malloc((uint) reclength,MYF(MY_WME | MY_ZEROFILL)))) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index f46b1cf1784..949c3d5bf1c 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -14319,6 +14319,7 @@ static void test_bug12243() mysql_autocommit(mysql, TRUE); /* restore default */ } + /* Bug#11718: query with function, join and order by returns wrong type */ @@ -14366,6 +14367,58 @@ static void test_bug12925() } +/* + Bug#14210 "Simple query with > operator on large table gives server + crash" +*/ + +static void test_bug14210() +{ + MYSQL_STMT *stmt; + int rc, i; + const char *stmt_text; + ulong type; + + myheader("test_bug14210"); + + mysql_query(mysql, "drop table if exists t1"); + /* + To trigger the problem the table must be InnoDB, although the problem + itself is not InnoDB related. In case the table is MyISAM this test + is harmless. + */ + mysql_query(mysql, "create table t1 (a varchar(255)) type=InnoDB"); + rc= mysql_query(mysql, "insert into t1 (a) values (repeat('a', 256))"); + myquery(rc); + rc= mysql_query(mysql, "set @@session.max_heap_table_size=16384"); + /* Create a big enough table (more than max_heap_table_size) */ + for (i= 0; i < 8; i++) + { + rc= mysql_query(mysql, "insert into t1 (a) select a from t1"); + myquery(rc); + } + /* create statement */ + stmt= mysql_stmt_init(mysql); + type= (ulong) CURSOR_TYPE_READ_ONLY; + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type); + + stmt_text= "select a from t1"; + + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + while ((rc= mysql_stmt_fetch(stmt)) == 0) + ; + DIE_UNLESS(rc == MYSQL_NO_DATA); + + rc= mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "drop table t1"); + myquery(rc); + rc= mysql_query(mysql, "set @@session.max_heap_table_size=default"); + myquery(rc); +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -14621,6 +14674,7 @@ static struct my_tests_st my_tests[]= { { "test_bug11901", test_bug11901 }, { "test_bug11904", test_bug11904 }, { "test_bug12243", test_bug12243 }, + { "test_bug14210", test_bug14210 }, { 0, 0 } }; From e529fdc5eed0dda5de4048c6d636b1f05f28783d Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Thu, 3 Nov 2005 16:17:11 +0400 Subject: [PATCH 49/52] Merging --- mysql-test/r/ctype_cp932_binlog.result | 12 +++++------- mysql-test/t/ctype_cp932_binlog.test | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result index 89f0ae71f4f..d04fce7738c 100644 --- a/mysql-test/r/ctype_cp932_binlog.result +++ b/mysql-test/r/ctype_cp932_binlog.result @@ -6,13 +6,11 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 79; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) -master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8 -master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1') +SHOW BINLOG EVENTS FROM 98; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 98 Query 1 185 use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 185 User var 1 224 @`var1`=_binary 0x8300 COLLATE binary +master-bin.000001 224 Query 1 317 use `test`; INSERT INTO t1 VALUES(@'var1') SELECT HEX(f1) FROM t1; HEX(f1) 8300 diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/t/ctype_cp932_binlog.test index e8ec0d46caf..270e27cf27f 100644 --- a/mysql-test/t/ctype_cp932_binlog.test +++ b/mysql-test/t/ctype_cp932_binlog.test @@ -26,8 +26,7 @@ SET @var1= x'8300'; # code (and I have used it to test the fix) until there is some way to # exercise this code from mysql-test-run. EXECUTE stmt1 USING @var1; ---replace_column 2 # 5 # -SHOW BINLOG EVENTS FROM 79; +SHOW BINLOG EVENTS FROM 98; SELECT HEX(f1) FROM t1; DROP table t1; # end test for bug#11338 From e92452c8ed4ac795e23a2f95d46fd50f6799be14 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Thu, 3 Nov 2005 17:43:03 +0300 Subject: [PATCH 50/52] opt_range.cc: Additional fix for bug#14093 --- sql/opt_range.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 22e9f94d21a..63a49a46110 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3776,6 +3776,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part, SEL_ARG *tree= 0; MEM_ROOT *alloc= param->mem_root; char *str; + ulong orig_sql_mode; DBUG_ENTER("get_mm_leaf"); /* @@ -3922,7 +3923,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part, field->cmp_type() != value->result_type()) goto end; /* For comparison purposes allow invalid dates like 2000-01-32 */ - ulong orig_sql_mode= field->table->in_use->variables.sql_mode; + orig_sql_mode= field->table->in_use->variables.sql_mode; if (value->real_item()->type() == Item::STRING_ITEM && (field->type() == FIELD_TYPE_DATE || field->type() == FIELD_TYPE_DATETIME)) From 2940a338c55bf8902b890fd27d184c3b0e4923b8 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 3 Nov 2005 17:39:40 +0200 Subject: [PATCH 51/52] Disabled a test temporarily. --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index eedf4b30e73..5d010235d97 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,3 +16,4 @@ rpl_until : Unstable test case, bug#12429 rpl_deadlock : Unstable test case, bug#12429 kill : Unstable test case, bug#9712 archive_gis : The test fails on 32bit Linux +ctype_cp932_binlog : The test is not ready yet. hf will complete shortly From a6ada95d1e9c24e6b68230620aa13530634fabca Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Thu, 3 Nov 2005 21:01:27 +0400 Subject: [PATCH 52/52] test enabled --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5d010235d97..eedf4b30e73 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,4 +16,3 @@ rpl_until : Unstable test case, bug#12429 rpl_deadlock : Unstable test case, bug#12429 kill : Unstable test case, bug#9712 archive_gis : The test fails on 32bit Linux -ctype_cp932_binlog : The test is not ready yet. hf will complete shortly