From 4e284cabae79d5fb8c05c03f1aba527db6be978f Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 03:05:19 +0100 Subject: Use ZLIB_LIBS when linking libmysqlclient_r (Bug #6418) --- libmysql_r/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index 939cb4c73dd..0a5c380ff35 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -22,7 +22,7 @@ target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ -LIBS = @LIBS@ @openssl_libs@ +LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ INCLUDES = @MT_INCLUDES@ \ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ -- cgit v1.2.1 From fd7935427308bbd376438543e6ffe570f842f9df Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 11 Jan 2005 19:40:33 +0200 Subject: Fixed Bug#2813, "analyse does not quot string values in enams from string". --- mysql-test/r/analyse.result | 6 +++++ mysql-test/t/analyse.test | 4 +++ sql/sql_analyse.cc | 59 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index b51afab5b54..8013bc516bb 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -96,3 +96,9 @@ select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL drop table t1,t2; +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +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.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL +drop table t1; diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 47f3473584b..34343c2b7bf 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -38,3 +38,7 @@ select * from t2; insert into t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +drop table t1; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 1e0aebbc1ec..5265857f3b1 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -59,6 +59,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)), return compare_ulonglong(s,t); } +static bool append_escaped(String *to_str, String *from_str); Procedure * proc_analyse_init(THD *thd, ORDER *param, select_result *result, @@ -890,7 +891,8 @@ int collect_string(String *element, else info->found = 1; info->str->append('\''); - info->str->append(*element); + if (append_escaped(info->str, element)) + return 1; info->str->append('\''); return 0; } // collect_string @@ -1025,3 +1027,58 @@ uint check_ulonglong(const char *str, uint length) while (*cmp && *cmp++ == *str++) ; return ((uchar) str[-1] <= (uchar) cmp[-1]) ? smaller : bigger; } /* check_ulonlong */ + + + +/* + FUNCTION: append_escaped() + + DESCRIPTION + append_escaped() takes a String type variable, where it appends + escaped the second argument. Only characters that require escaping + will be escaped. + + ARGUMENTS + A pointer to a String variable, where results will be appended + A pointer to a String variable, which is appended to the result + String, escaping those characters that require it. + + RETURN VALUES + 0 Success + 1 Out of memory +*/ + +static bool append_escaped(String *to_str, String *from_str) +{ + char *from, *end, c; + + if (to_str->realloc(to_str->length() + from_str->length())) + return 1; + + from= (char*) from_str->ptr(); + end= from + from_str->length(); + for (; from < end; from++) + { + c= *from; + switch (c) { + case '\0': + c= '0'; + break; + case '\032': + c= 'Z'; + break; + case '\\': + case '\'': + break; + default: + goto normal_character; + } + if (to_str->append('\\')) + return 1; + + normal_character: + if (to_str->append(c)) + return 1; + } + return 0; +} -- cgit v1.2.1 From 39d90b710f787d33d044072bdd92b7b8f49c1813 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Jan 2005 21:50:30 +0100 Subject: Replace ZLIB_LIBS in mysql_config. (Bug #6418) --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4158b5a34dc..71b70fc0e4a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -121,6 +121,7 @@ SUFFIXES = .sh -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -- cgit v1.2.1 From a5c08a718e325a65c659450f065cbd1ea9675b80 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Tue, 11 Jan 2005 23:09:10 +0100 Subject: ndbcluster.sh: increased timeouts to see if more tests get started automatically --- mysql-test/ndb/ndbcluster.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 848223a091c..2d529f8fe0f 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -191,7 +191,7 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi -if sleep_until_file_created $fs_ndb/ndb_3.pid 30 +if sleep_until_file_created $fs_ndb/ndb_3.pid 120 then :; else exit 1 fi @@ -201,7 +201,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_1.pid 30 +if sleep_until_file_created $fs_ndb/ndb_1.pid 120 then :; else stop_default_ndbcluster exit 1 @@ -212,7 +212,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_2.pid 30 +if sleep_until_file_created $fs_ndb/ndb_2.pid 120 then :; else stop_default_ndbcluster exit 1 -- cgit v1.2.1 From a9dc068a4366f10f2746d07d49f4ad109bab781e Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Wed, 12 Jan 2005 11:17:03 +0100 Subject: ndb - fix 64-bit problem in autotest --- ndb/test/src/CpcClient.cpp | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index 2ef23528360..1d1b4fcb977 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -30,7 +30,7 @@ 0, 0, \ 0, \ (desc), \ - (void *)(value) } + (value) } #define CPC_ARG(name, type, opt, desc) \ { (name), \ @@ -351,17 +351,12 @@ SimpleCpcClient::define_process(Process & p, Properties& reply){ int SimpleCpcClient::list_processes(Vector &procs, Properties& reply) { - enum Proclist { - Proclist_Start, - Proclist_End, - Proclist_Entry - }; + int start, end, entry; const ParserRow_t list_reply[] = { - CPC_CMD("start processes", Proclist_Start, ""), - - CPC_CMD("end processes", Proclist_End, ""), + CPC_CMD("start processes", &start, ""), + CPC_CMD("end processes", &end, ""), - CPC_CMD("process", Proclist_Entry, ""), + CPC_CMD("process", &entry, ""), CPC_ARG("id", Int, Mandatory, "Id of process."), CPC_ARG("name", String, Mandatory, "Name of process"), CPC_ARG("group", String, Mandatory, "Group of process"), @@ -390,26 +385,29 @@ SimpleCpcClient::list_processes(Vector &procs, Properties& reply) { bool done = false; while(!done) { const Properties *proc; - enum Proclist p; - cpc_recv(list_reply, &proc, (void **)&p); + void *p; + cpc_recv(list_reply, &proc, &p); - switch(p) { - case Proclist_Start: + if(p == &start) + { /* do nothing */ - break; - case Proclist_End: + } + else if(p == &end) + { done = true; - break; - case Proclist_Entry: + } + else if(p == &entry) + { if(proc != NULL){ Process p; convert(* proc, p); procs.push_back(p); } - break; - default: - /* ignore */ - break; + } + else + { + ndbout_c("internal error: %d", __LINE__); + return -1; } } return 0; -- cgit v1.2.1