Commit 41ed0141 authored by unknown's avatar unknown

Added fix for using variables with distinct


Docs/manual.texi:
  Updated links
client/mysqltest.c:
  Added 'ping' method
configure.in:
  Upgraded version number
mysql-test/r/user_var.result:
  Added test for using variables with distinct
mysql-test/t/kill.test:
  Use 'ping' to force reconnect
mysql-test/t/user_var.test:
  Added test for using variables with distinct
sql-bench/run-all-tests.sh:
  Fixed argument passing
parent 68414519
...@@ -2459,6 +2459,9 @@ A Windows GUI client by David Ecker. ...@@ -2459,6 +2459,9 @@ A Windows GUI client by David Ecker.
Kiosk; a @strong{MySQL} client for database management. Written in Perl. Kiosk; a @strong{MySQL} client for database management. Written in Perl.
Will be a part of Bazaar. Will be a part of Bazaar.
@item @uref{http://www.casestudio.com/}
Db design tool that supports MySQL 3.23.
@item @uref{http://home.skif.net/~voland/zeos/eng/index.html}@* @item @uref{http://home.skif.net/~voland/zeos/eng/index.html}@*
Zeos - A client that supports @strong{MySQL}, Interbase and PostgreSQL. Zeos - A client that supports @strong{MySQL}, Interbase and PostgreSQL.
...@@ -42152,6 +42155,8 @@ Fixed newly introduce bug in @code{ORDER BY}. ...@@ -42152,6 +42155,8 @@ Fixed newly introduce bug in @code{ORDER BY}.
Fixed wrong define @code{CLIENT_TRANSACTIONS}. Fixed wrong define @code{CLIENT_TRANSACTIONS}.
@item @item
Fixed bug in @code{SHOW VARIABLES} when using INNOBASE tables. Fixed bug in @code{SHOW VARIABLES} when using INNOBASE tables.
@item
Setting and using user variables in @code{SELECT DISTINCT} didn't work.
@end itemize @end itemize
@node News-3.23.34a, News-3.23.34, News-3.23.35, News-3.23.x @node News-3.23.34a, News-3.23.34, News-3.23.35, News-3.23.x
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
**********************************************************************/ **********************************************************************/
#define MTEST_VERSION "1.6" #define MTEST_VERSION "1.7"
#include <global.h> #include <global.h>
#include <my_sys.h> #include <my_sys.h>
...@@ -156,6 +156,7 @@ struct st_query ...@@ -156,6 +156,7 @@ struct st_query
Q_SYNC_WITH_MASTER, Q_ERROR, Q_SYNC_WITH_MASTER, Q_ERROR,
Q_SEND, Q_REAP, Q_SEND, Q_REAP,
Q_DIRTY_CLOSE, Q_REPLACE, Q_DIRTY_CLOSE, Q_REPLACE,
Q_PING,
Q_UNKNOWN, /* Unknown command. */ Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */ Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND Q_COMMENT_WITH_COMMAND
...@@ -174,6 +175,7 @@ const char *command_names[] = { ...@@ -174,6 +175,7 @@ const char *command_names[] = {
"sync_with_master", "error", "sync_with_master", "error",
"send", "reap", "send", "reap",
"dirty_close", "replace_result", "dirty_close", "replace_result",
"ping",
0 0
}; };
...@@ -1662,6 +1664,9 @@ int main(int argc, char** argv) ...@@ -1662,6 +1664,9 @@ int main(int argc, char** argv)
case Q_SYNC_WITH_MASTER: do_sync_with_master(q); break; case Q_SYNC_WITH_MASTER: do_sync_with_master(q); break;
case Q_COMMENT: /* Ignore row */ case Q_COMMENT: /* Ignore row */
case Q_COMMENT_WITH_COMMAND: case Q_COMMENT_WITH_COMMAND:
case Q_PING:
(void) mysql_ping(&cur_con->mysql);
break;
default: processed = 0; break; default: processed = 0; break;
} }
} }
......
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.34a) AM_INIT_AUTOMAKE(mysql, 3.23.35)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
......
@a - connection_id() @a - connection_id()
3 3
i
1
2
i @vv1:=if(sv1.i,1,0) @vv2:=if(sv2.i,1,0) @vv3:=if(sv3.i,1,0) @vv1+@vv2+@vv3
1 1 0 1 2
2 1 0 0 1
...@@ -3,21 +3,24 @@ connect (con2, localhost, root,,test,0, mysql-master.sock); ...@@ -3,21 +3,24 @@ connect (con2, localhost, root,,test,0, mysql-master.sock);
#remember id of con1 #remember id of con1
connection con1; connection con1;
drop table if exists connection_kill; drop table if exists t1;
create table connection_kill (kill_id int); create table t1 (kill_id int);
insert into connection_kill values(connection_id()); insert into t1 values(connection_id());
#kill con1 #kill con1
connection con2; connection con2;
select ((@id := kill_id) - kill_id) from connection_kill; select ((@id := kill_id) - kill_id) from t1;
kill @id; kill @id;
# verify that con1 is really dead # Wait for thread to do.
--sleep 5
# verify that con1 is doning a reconnect
connection con1; connection con1;
error 2013; ping
select 1; ping
select @id != connection_id();
#make sure the server is still alive #make sure the server is still alive
connection con2; connection con2;
select 4; select 4;
drop table connection_kill; drop table t1;
...@@ -3,3 +3,13 @@ set @a := foo; ...@@ -3,3 +3,13 @@ set @a := foo;
set @a := connection_id() + 3; set @a := connection_id() + 3;
select @a - connection_id(); select @a - connection_id();
# Check using and setting variables with SELECT DISTINCT
drop table if exists t1,t2;
CREATE TABLE t1 ( i int not null, v int not null,index (i));
insert into t1 values (1,1),(1,3),(2,1);
create table t2 (i int not null, unique (i));
insert into t2 select distinct i from t1;
select * from t2;
select distinct t2.i,@vv1:=if(sv1.i,1,0),@vv2:=if(sv2.i,1,0),@vv3:=if(sv3.i,1,0), @vv1+@vv2+@vv3 from t2 left join t1 as sv1 on sv1.i=t2.i and sv1.v=1 left join t1 as sv2 on sv2.i=t2.i and sv2.v=2 left join t1 as sv3 on sv3.i=t2.i and sv3.v=3;
drop table t1,t2;
...@@ -37,6 +37,7 @@ use DBI; ...@@ -37,6 +37,7 @@ use DBI;
$opt_silent=1; # Don't write header $opt_silent=1; # Don't write header
@ORG_ARGV=@ARGV;
chomp($pwd = `pwd`); $pwd = "." if ($pwd eq ''); chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n"; require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
$opt_silent=0; $opt_silent=0;
...@@ -46,7 +47,7 @@ $redirect= !($machine =~ /windows/i || $machine =~ "^NT\s") ? "2>&1" : ""; ...@@ -46,7 +47,7 @@ $redirect= !($machine =~ /windows/i || $machine =~ "^NT\s") ? "2>&1" : "";
$dir= ($pwd =~ /\\/) ? '\\' : '/'; # directory symbol for shell $dir= ($pwd =~ /\\/) ? '\\' : '/'; # directory symbol for shell
$prog_args=""; $prog_args="";
foreach $arg (@ARGV) foreach $arg (@ORG_ARGV)
{ {
if ($redirect) if ($redirect)
{ {
......
...@@ -835,6 +835,8 @@ class Item_func_get_user_var :public Item_func ...@@ -835,6 +835,8 @@ class Item_func_get_user_var :public Item_func
void fix_length_and_dec(); void fix_length_and_dec();
enum Item_result result_type() const; enum Item_result result_type() const;
const char *func_name() const { return "get_user_var"; } const char *func_name() const { return "get_user_var"; }
bool const_item() const { return 0; }
table_map used_tables() const { return RAND_TABLE_BIT; }
}; };
class Item_func_inet_aton : public Item_int_func class Item_func_inet_aton : public Item_int_func
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment