From 496bc77694abe410bed1968fc34cf685d765131f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Oct 2003 17:54:32 -0400 Subject: [PATCH 1/2] Fixed bug #1323 (varchar fields becoming char fields adter create ... select) --- mysql-test/r/create.result | 2 +- sql/sql_select.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e6192eb6ccb..7b784e3c3ee 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -78,7 +78,7 @@ Field Type Null Key Default Extra x varchar(50) YES NULL describe t2; Field Type Null Key Default Extra -x char(50) YES NULL +x varchar(50) YES NULL drop table t2; create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f; describe t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 53c41482a36..bffe3cd7968 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3706,6 +3706,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, new_field->field_name=item->name; if (org_field->maybe_null()) new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join + if (org_field->type()==FIELD_TYPE_VAR_STRING) + table->db_create_options|= HA_OPTION_PACK_RECORD; } return new_field; } From c7fd510a4191eb85890dddc235852f3b8a98362d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Oct 2003 15:44:31 +0300 Subject: [PATCH 2/2] Simple cleanups client/mysqlbinlog.cc: Add default handling to mysqlbinlog mysql-test/mysql-test-run.sh: Cleanup of mysqldump/mysqlbinlog argument handling scripts/Makefile.am: Remove duplicate scripts/mysql_install_db.sh: Change -eq to = --- client/mysqlbinlog.cc | 10 +++++++++- mysql-test/mysql-test-run.sh | 14 ++++++++------ scripts/Makefile.am | 1 - scripts/mysql_install_db.sh | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 84dcc4a7395..8e108e20299 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -40,6 +40,7 @@ static FILE *result_file; #ifndef DBUG_OFF static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace"; #endif +static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); @@ -278,7 +279,7 @@ static void die(const char* fmt, ...) static void print_version() { - printf("%s Ver 2.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s Ver 2.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); } @@ -374,6 +375,7 @@ static int parse_args(int *argc, char*** argv) int ho_error; result_file = stdout; + load_defaults("my",load_default_groups,argc,argv); if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) exit(ho_error); @@ -743,12 +745,16 @@ void free_tmpdir(MY_TMPDIR *tmpdir) int main(int argc, char** argv) { + static char **defaults_argv; MY_INIT(argv[0]); + parse_args(&argc, (char***)&argv); + defaults_argv=argv; if (!argc) { usage(); + free_defaults(defaults_argv); return -1; } @@ -778,6 +784,8 @@ int main(int argc, char** argv) my_fclose(result_file, MYF(0)); if (use_remote) mysql_close(mysql); + free_defaults(defaults_argv); + my_end(0); return 0; } diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 577f396440c..6cba5eecddd 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -429,14 +429,14 @@ if [ x$SOURCE_DIST = x1 ] ; then MYSQL_TEST="$BASEDIR/client/mysqltest" fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then - MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" + MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" else - MYSQL_DUMP="$BASEDIR/client/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" + MYSQL_DUMP="$BASEDIR/client/mysqldump" fi if [ -f "$BASEDIR/client/.libs/mysqlbinlog" ] ; then - MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog --local-load=$MYSQL_TMP_DIR" + MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog" else - MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog --local-load=$MYSQL_TMP_DIR" + MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog" fi if [ -n "$STRACE_CLIENT" ]; then MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST" @@ -459,8 +459,8 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi MYSQL_TEST="$BASEDIR/bin/mysqltest" - MYSQL_DUMP="$BASEDIR/bin/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" - MYSQL_BINLOG="$BASEDIR/bin/mysqlbinlog --local-load=$MYSQL_TMP_DIR" + MYSQL_DUMP="$BASEDIR/bin/mysqldump" + MYSQL_BINLOG="$BASEDIR/bin/mysqlbinlog" MYSQLADMIN="$BASEDIR/bin/mysqladmin" WAIT_PID="$BASEDIR/bin/mysql_waitpid" MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager" @@ -478,6 +478,8 @@ else fi fi +MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK" +MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR" export MYSQL_DUMP export MYSQL_BINLOG diff --git a/scripts/Makefile.am b/scripts/Makefile.am index adb88290d9b..17b98fe45c3 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -66,7 +66,6 @@ pkgdata_DATA = make_binary_distribution # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ - make_win_src_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index d66c33c16b1..5a6b11fb19b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -136,7 +136,7 @@ then fi fi -if test "$ip_only" -eq 1 +if test "$ip_only" ="1" then ip=`echo "$resolved" | awk '/ /{print $6}'` hostname=$ip