Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-23 12:35:56+04:00, kostja@stripped +45 -0
Merge bodhi.local:/opt/local/work/mysql-5.0-runtime
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
MERGE: 1.1810.2078.42
mysql-test/mysql-test-run.pl@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +9 -11
Manual merge.
MERGE: 1.30.1.87
mysql-test/r/im_daemon_life_cycle.result@stripped, 2006-10-23 12:12:55+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.2.1.5
mysql-test/r/ps.result@stripped, 2006-10-23 12:12:55+04:00, kostja@stripped +0 -1
Auto merged
MERGE: 1.56.1.22
mysql-test/r/rpl_insert_id.result@stripped, 2006-10-23 12:12:56+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.12.3.8
mysql-test/r/sp-error.result@stripped, 2006-10-23 12:18:27+04:00, kostja@stripped +0 -13
Use local
MERGE: 1.102.1.7
mysql-test/r/sp-vars.result@stripped, 2006-10-23 12:12:56+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.1.1.4
mysql-test/r/sp.result@stripped, 2006-10-23 12:19:17+04:00, kostja@stripped +0 -156
Use local
(will overwrite)
MERGE: 1.170.1.45
mysql-test/r/trigger.result@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.29.1.19
mysql-test/r/view.result@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -14
Auto merged
MERGE: 1.138.23.4
mysql-test/t/func_gconcat.test@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.44.1.3
mysql-test/t/im_daemon_life_cycle.imtest@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.1.1.5
mysql-test/t/ps.test@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -20
Auto merged
MERGE: 1.56.1.18
mysql-test/t/rpl_insert_id.test@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.13.1.9
mysql-test/t/sp-error.test@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +43 -21
Manual merge.
MERGE: 1.100.1.10
mysql-test/t/sp.test@stripped, 2006-10-23 12:12:57+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.174.1.30
mysql-test/t/trigger.test@stripped, 2006-10-23 12:12:58+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.34.1.20
mysql-test/t/view.test@stripped, 2006-10-23 12:21:52+04:00, kostja@stripped +1 -36
Use local.
MERGE: 1.126.21.2
server-tools/instance-manager/guardian.cc@stripped, 2006-10-23 12:12:58+04:00, kostja@stripped +0 -1
Auto merged
MERGE: 1.20.1.4
server-tools/instance-manager/guardian.h@stripped, 2006-10-23 12:12:58+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.12.1.1
server-tools/instance-manager/instance.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +2 -3
Manual merge.
MERGE: 1.32.1.3
server-tools/instance-manager/instance_map.cc@stripped, 2006-10-23 12:12:58+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.26.1.2
server-tools/instance-manager/listener.cc@stripped, 2006-10-23 12:12:58+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.24.1.3
server-tools/instance-manager/manager.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +2 -4
Manual merge.
MERGE: 1.32.1.4
server-tools/instance-manager/options.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +2 -5
Manual merge.
MERGE: 1.30.2.3
server-tools/instance-manager/options.h@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +2 -1
Manual merge.
MERGE: 1.14.1.2
sql/item_func.cc@stripped, 2006-10-23 12:12:59+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.270.25.1
sql/item_func.h@stripped, 2006-10-23 12:12:59+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.136.2.19
sql/item_sum.cc@stripped, 2006-10-23 12:12:59+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.170.1.13
sql/item_sum.h@stripped, 2006-10-23 12:12:59+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.102.1.3
sql/log_event.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.174.1.39
sql/set_var.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.125.5.27
sql/sp_head.cc@stripped, 2006-10-23 12:13:00+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.200.1.25
sql/sql_base.cc@stripped, 2006-10-23 12:13:01+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.235.66.7
sql/sql_class.h@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.230.1.76
sql/sql_insert.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.146.37.2
sql/sql_lex.cc@stripped, 2006-10-23 12:13:01+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.142.1.60
sql/sql_lex.h@stripped, 2006-10-23 12:13:02+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.175.20.4
sql/sql_load.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.78.1.22
sql/sql_parse.cc@stripped, 2006-10-23 12:13:03+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.426.1.158
sql/sql_select.cc@stripped, 2006-10-23 12:35:49+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.312.104.1
sql/sql_trigger.cc@stripped, 2006-10-23 12:13:04+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.35.1.22
sql/sql_update.cc@stripped, 2006-10-23 12:35:50+04:00, kostja@stripped +0 -0
Manual merge.
MERGE: 1.154.2.47
sql/sql_view.cc@stripped, 2006-10-23 12:13:04+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.78.11.4
sql/sql_yacc.yy@stripped, 2006-10-23 12:13:05+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.371.1.122
tests/mysql_client_test.c@stripped, 2006-10-23 12:13:06+04:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.167.1.43
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kostja
# Host: bodhi.local
# Root: /opt/local/work/mysql-5.1-runtime-merge/RESYNC
--- 1.193/sql/item_sum.cc 2006-10-23 12:36:10 +04:00
+++ 1.194/sql/item_sum.cc 2006-10-23 12:36:10 +04:00
@@ -1065,7 +1065,7 @@ longlong Item_sum_count::val_int()
void Item_sum_count::cleanup()
{
DBUG_ENTER("Item_sum_count::cleanup");
- clear();
+ count= 0;
Item_sum_int::cleanup();
used_table_cache= ~(table_map) 0;
DBUG_VOID_RETURN;
--- 1.105/sql/item_sum.h 2006-10-23 12:36:10 +04:00
+++ 1.106/sql/item_sum.h 2006-10-23 12:36:10 +04:00
@@ -643,8 +643,8 @@ public:
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
void cleanup()
{
- clear();
- Item_sum_num::cleanup();
+ count= 0;
+ Item_sum_sum::cleanup();
}
};
@@ -727,7 +727,8 @@ public:
enum Item_result result_type () const { return REAL_RESULT; }
void cleanup()
{
- clear();
+ cur_dec= 0;
+ count= 0;
Item_sum_num::cleanup();
}
};
@@ -862,7 +863,7 @@ public:
{ decimals= 0; max_length=21; unsigned_flag= 1; maybe_null= null_value= 0; }
void cleanup()
{
- clear();
+ bits= reset_bits;
Item_sum_int::cleanup();
}
};
--- 1.509/sql/sql_yacc.yy 2006-10-23 12:36:11 +04:00
+++ 1.510/sql/sql_yacc.yy 2006-10-23 12:36:11 +04:00
@@ -1724,15 +1724,20 @@ call:
lex->value_list.empty();
sp_add_used_routine(lex, YYTHD, $2, TYPE_ENUM_PROCEDURE);
}
- '(' sp_cparam_list ')' {}
+ opt_sp_cparam_list {}
;
/* CALL parameters */
-sp_cparam_list:
+opt_sp_cparam_list:
/* Empty */
- | sp_cparams
+ | '(' opt_sp_cparams ')'
;
+opt_sp_cparams:
+ /* Empty */
+ | sp_cparams
+ ;
+
sp_cparams:
sp_cparams ',' expr
{
@@ -6822,7 +6827,7 @@ when_list2:
/* Warning - may return NULL in case of incomplete SELECT */
table_ref:
table_factor { $$=$1; }
- | join_table { $$=$1; }
+ | join_table
{
LEX *lex= Lex;
if (!($$= lex->current_select->nest_last_join(lex->thd)))
@@ -6864,7 +6869,7 @@ join_table:
| table_ref normal_join table_ref
ON
{
- YYERROR_UNLESS($1 && ($$=$3));
+ YYERROR_UNLESS($1 && $3);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $3))
YYABORT;
@@ -6879,7 +6884,7 @@ join_table:
| table_ref STRAIGHT_JOIN table_factor
ON
{
- YYERROR_UNLESS($1 && ($$=$3));
+ YYERROR_UNLESS($1 && $3);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $3))
YYABORT;
--- 1.8/mysql-test/r/im_daemon_life_cycle.result 2006-10-23 12:36:11 +04:00
+++ 1.9/mysql-test/r/im_daemon_life_cycle.result 2006-10-23 12:36:11 +04:00
@@ -8,6 +8,7 @@ mysqld2 offline
Killing the process...
Sleeping...
Success: the process was restarted.
+Success: server is ready to accept connection on socket.
--------------------------------------------------------------------
-- Test for BUG#12751
--- 1.7/mysql-test/r/sp-vars.result 2006-10-23 12:36:11 +04:00
+++ 1.8/mysql-test/r/sp-vars.result 2006-10-23 12:36:11 +04:00
@@ -4,6 +4,7 @@ DROP FUNCTION IF EXISTS sp_vars_check_re
DROP FUNCTION IF EXISTS sp_vars_check_ret2;
DROP FUNCTION IF EXISTS sp_vars_check_ret3;
DROP FUNCTION IF EXISTS sp_vars_check_ret4;
+DROP FUNCTION IF EXISTS sp_vars_div_zero;
SET @@sql_mode = 'ansi';
CREATE PROCEDURE sp_vars_check_dflt()
BEGIN
@@ -88,6 +89,12 @@ CREATE FUNCTION sp_vars_check_ret4() RET
BEGIN
RETURN 12 * 10 + 34 + 0.1234;
END|
+CREATE FUNCTION sp_vars_div_zero() RETURNS INTEGER
+BEGIN
+DECLARE div_zero INTEGER;
+SELECT 1/0 INTO div_zero;
+RETURN div_zero;
+END|
---------------------------------------------------------------
Calling the routines, created in ANSI mode.
@@ -172,6 +179,9 @@ sp_vars_check_ret4()
154.12
Warnings:
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+SELECT sp_vars_div_zero();
+sp_vars_div_zero()
+NULL
SET @@sql_mode = 'traditional';
---------------------------------------------------------------
@@ -257,12 +267,16 @@ sp_vars_check_ret4()
154.12
Warnings:
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+SELECT sp_vars_div_zero();
+sp_vars_div_zero()
+NULL
DROP PROCEDURE sp_vars_check_dflt;
DROP PROCEDURE sp_vars_check_assignment;
DROP FUNCTION sp_vars_check_ret1;
DROP FUNCTION sp_vars_check_ret2;
DROP FUNCTION sp_vars_check_ret3;
DROP FUNCTION sp_vars_check_ret4;
+DROP FUNCTION sp_vars_div_zero;
CREATE PROCEDURE sp_vars_check_dflt()
BEGIN
DECLARE v1 TINYINT DEFAULT 1e200;
@@ -346,6 +360,12 @@ CREATE FUNCTION sp_vars_check_ret4() RET
BEGIN
RETURN 12 * 10 + 34 + 0.1234;
END|
+CREATE FUNCTION sp_vars_div_zero() RETURNS INTEGER
+BEGIN
+DECLARE div_zero INTEGER;
+SELECT 1/0 INTO div_zero;
+RETURN div_zero;
+END|
---------------------------------------------------------------
Calling the routines, created in TRADITIONAL mode.
@@ -366,6 +386,8 @@ sp_vars_check_ret4()
154.12
Warnings:
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+SELECT sp_vars_div_zero();
+ERROR 22012: Division by 0
SET @@sql_mode = 'ansi';
DROP PROCEDURE sp_vars_check_dflt;
DROP PROCEDURE sp_vars_check_assignment;
@@ -373,6 +395,7 @@ DROP FUNCTION sp_vars_check_ret1;
DROP FUNCTION sp_vars_check_ret2;
DROP FUNCTION sp_vars_check_ret3;
DROP FUNCTION sp_vars_check_ret4;
+DROP FUNCTION sp_vars_div_zero;
---------------------------------------------------------------
BIT data type tests
--- 1.7/mysql-test/t/im_daemon_life_cycle.imtest 2006-10-23 12:36:11 +04:00
+++ 1.8/mysql-test/t/im_daemon_life_cycle.imtest 2006-10-23 12:36:11 +04:00
@@ -17,6 +17,12 @@
###########################################################################
+# Wait for IM to start accepting connections.
+
+--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 30
+
+###########################################################################
+
#
# BUG#12751: Instance Manager: client hangs
#
--- 1.50/mysql-test/r/trigger.result 2006-10-23 12:36:11 +04:00
+++ 1.51/mysql-test/r/trigger.result 2006-10-23 12:36:11 +04:00
@@ -1073,10 +1073,11 @@ SELECT @x;
NULL
SET @x=2;
UPDATE t1 SET i1 = @x;
-ERROR 22012: Division by 0
+Warnings:
+Error 1365 Division by 0
SELECT @x;
@x
-2
+NULL
SET SQL_MODE='';
SET @x=3;
INSERT INTO t1 VALUES (@x);
@@ -1085,10 +1086,12 @@ SELECT @x;
NULL
SET @x=4;
UPDATE t1 SET i1 = @x;
-ERROR 22012: Division by 0
+Warnings:
+Error 1365 Division by 0
+Error 1365 Division by 0
SELECT @x;
@x
-4
+NULL
SET @@sql_mode=@save_sql_mode;
DROP TRIGGER t1_ai;
DROP TRIGGER t1_au;
@@ -1173,6 +1176,59 @@ TRIGGER t2_bi BEFORE INSERT ON t2 FOR EA
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
DROP TABLE t1;
DROP TABLE t2;
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+SET @save_sql_mode=@@sql_mode;
+SET sql_mode='TRADITIONAL'|
+create table t1 (id int(10) not null primary key, v int(10) )|
+create table t2 (id int(10) not null primary key, v int(10) )|
+create table t3 (id int(10) not null primary key, v int(10) )|
+create table t4 (c int)|
+create trigger t4_bi before insert on t4 for each row set @t4_bi_called:=1|
+create trigger t4_bu before update on t4 for each row set @t4_bu_called:=1|
+insert into t1 values(10, 10)|
+set @a:=1/0|
+Warnings:
+Error 1365 Division by 0
+select 1/0 from t1|
+1/0
+NULL
+Warnings:
+Error 1365 Division by 0
+create trigger t1_bi before insert on t1 for each row set @a:=1/0|
+insert into t1 values(20, 20)|
+Warnings:
+Error 1365 Division by 0
+drop trigger t1_bi|
+create trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values (new.id, new.v);
+update t2 set v=v+1 where id= new.id;
+replace t3 values (new.id, 0);
+update t2, t3 set t2.v=new.v, t3.v=new.v where t2.id=t3.id;
+create temporary table t5 select * from t1;
+delete from t5;
+insert into t5 select * from t1;
+insert into t4 values (0);
+set @check= (select count(*) from t5);
+update t4 set c= @check;
+drop temporary table t5;
+set @a:=1/0;
+end|
+set @check=0, @t4_bi_called=0, @t4_bu_called=0|
+insert into t1 values(30, 30)|
+Warnings:
+Error 1365 Division by 0
+select @check, @t4_bi_called, @t4_bu_called|
+@check @t4_bi_called @t4_bu_called
+2 1 1
+SET @@sql_mode=@save_sql_mode;
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
drop table if exists t1;
create table t1 (i int, j int key);
insert into t1 values (1,1), (2,2), (3,3);
--- 1.54/mysql-test/t/trigger.test 2006-10-23 12:36:11 +04:00
+++ 1.55/mysql-test/t/trigger.test 2006-10-23 12:36:11 +04:00
@@ -1274,7 +1274,6 @@ INSERT INTO t1 VALUES (@x);
SELECT @x;
SET @x=2;
---error ER_DIVISION_BY_ZERO
UPDATE t1 SET i1 = @x;
SELECT @x;
@@ -1285,7 +1284,6 @@ INSERT INTO t1 VALUES (@x);
SELECT @x;
SET @x=4;
---error ER_DIVISION_BY_ZERO
UPDATE t1 SET i1 = @x;
SELECT @x;
@@ -1420,6 +1418,67 @@ CREATE DEFINER=some_user_name@1234567890
DROP TABLE t1;
DROP TABLE t2;
+#
+# Bug#20028 Function with select return no data
+#
+
+--disable_warnings
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+--enable_warnings
+
+SET @save_sql_mode=@@sql_mode;
+
+delimiter |;
+SET sql_mode='TRADITIONAL'|
+create table t1 (id int(10) not null primary key, v int(10) )|
+create table t2 (id int(10) not null primary key, v int(10) )|
+create table t3 (id int(10) not null primary key, v int(10) )|
+create table t4 (c int)|
+
+create trigger t4_bi before insert on t4 for each row set @t4_bi_called:=1|
+create trigger t4_bu before update on t4 for each row set @t4_bu_called:=1|
+
+insert into t1 values(10, 10)|
+set @a:=1/0|
+select 1/0 from t1|
+
+create trigger t1_bi before insert on t1 for each row set @a:=1/0|
+
+insert into t1 values(20, 20)|
+
+drop trigger t1_bi|
+create trigger t1_bi before insert on t1 for each row
+begin
+ insert into t2 values (new.id, new.v);
+ update t2 set v=v+1 where id= new.id;
+ replace t3 values (new.id, 0);
+ update t2, t3 set t2.v=new.v, t3.v=new.v where t2.id=t3.id;
+ create temporary table t5 select * from t1;
+ delete from t5;
+ insert into t5 select * from t1;
+ insert into t4 values (0);
+ set @check= (select count(*) from t5);
+ update t4 set c= @check;
+ drop temporary table t5;
+
+ set @a:=1/0;
+end|
+
+set @check=0, @t4_bi_called=0, @t4_bu_called=0|
+insert into t1 values(30, 30)|
+select @check, @t4_bi_called, @t4_bu_called|
+
+delimiter ;|
+
+SET @@sql_mode=@save_sql_mode;
+
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
#
# Bug#20670 "UPDATE using key and invoking trigger that modifies
--- 1.191/mysql-test/mysql-test-run.pl 2006-10-23 12:36:11 +04:00
+++ 1.192/mysql-test/mysql-test-run.pl 2006-10-23 12:36:11 +04:00
@@ -1425,6 +1425,7 @@ sub environment_setup () {
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV{'MYSQL_TCP_PORT'}= 3306;
+ $ENV{'EXE_MYSQL'}= $exe_mysql;
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
# ----------------------------------------------------
@@ -1456,6 +1457,9 @@ sub environment_setup () {
$ENV{'IM_PORT'}= $instance_manager->{port};
$ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file};
$ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file};
+ $ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
+ $ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
+ $ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
$ENV{'IM_MYSQLD1_SOCK'}= $instance_manager->{instances}->[0]->{path_sock};
$ENV{'IM_MYSQLD1_PORT'}= $instance_manager->{instances}->[0]->{port};
@@ -1464,9 +1468,9 @@ sub environment_setup () {
$ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port};
$ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid};
- # ----------------------------------------------------
- # Setup env so childs can execute mysqlcheck
- # ----------------------------------------------------
+# ----------------------------------------------------
+# Setup env so childs can execute mysqlcheck
+# ----------------------------------------------------
my $cmdline_mysqlcheck=
"$exe_mysqlcheck --no-defaults -uroot " .
"--port=$master->[0]->{'port'} " .
@@ -1630,9 +1634,9 @@ sub environment_setup () {
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
- # ----------------------------------------------------
- # We are nice and report a bit about our settings
- # ----------------------------------------------------
+# ----------------------------------------------------
+# We are nice and report a bit about our settings
+# ----------------------------------------------------
if (!$opt_extern)
{
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
--- 1.29/server-tools/instance-manager/listener.cc 2006-10-23 12:36:11 +04:00
+++ 1.30/server-tools/instance-manager/listener.cc 2006-10-23 12:36:11 +04:00
@@ -283,7 +283,7 @@ int Listener_thread::create_tcp_socket()
FD_SET(ip_socket, &read_fds);
sockets[num_sockets++]= ip_socket;
- log_info("accepting connections on ip socket");
+ log_info("accepting connections on ip socket (port: %d)", (int) im_port);
return 0;
}
@@ -337,7 +337,7 @@ create_unix_socket(struct sockaddr_un &u
/* make sure that instances won't be listening our sockets */
set_no_inherit(unix_socket);
- log_info("accepting connections on unix socket %s",
+ log_info("accepting connections on unix socket '%s'",
unix_socket_address.sun_path);
sockets[num_sockets++]= unix_socket;
FD_SET(unix_socket, &read_fds);
--- 1.35/server-tools/instance-manager/manager.cc 2006-10-23 12:36:11 +04:00
+++ 1.36/server-tools/instance-manager/manager.cc 2006-10-23 12:36:11 +04:00
@@ -120,6 +120,19 @@ int my_sigwait(const sigset_t *set, int
#endif
+void stop_all(Guardian_thread *guardian, Thread_registry *registry)
+{
+ /*
+ Let guardian thread know that it should break it's processing cycle,
+ once it wakes up.
+ */
+ guardian->request_shutdown();
+ /* wake guardian */
+ pthread_cond_signal(&guardian->COND_guardian);
+ /* stop all threads */
+ registry->deliver_shutdown();
+}
+
/*
manager - entry point to the main instance manager process: start
listener thread, write pid file and enter into signal handling.
@@ -251,7 +264,6 @@ void manager()
/* Load instances. */
-
{
instance_map.guardian->lock();
instance_map.lock();
@@ -266,7 +278,8 @@ void manager()
log_error("Cannot init instances repository. This might be caused by "
"the wrong config file options. For instance, missing mysqld "
"binary. Aborting.");
- return;
+ stop_all(&guardian_thread, &thread_registry);
+ goto err;
}
}
@@ -284,6 +297,7 @@ void manager()
if (rc)
{
log_error("manager(): set_stacksize_n_create_thread(listener) failed");
+ stop_all(&guardian_thread, &thread_registry);
goto err;
}
}
@@ -302,6 +316,7 @@ void manager()
if ((status= my_sigwait(&mask, &signo)) != 0)
{
log_error("sigwait() failed");
+ stop_all(&guardian_thread, &thread_registry);
goto err;
}
@@ -323,8 +338,7 @@ void manager()
{
if (!guardian_thread.is_stopped())
{
- bool stop_instances= TRUE;
- guardian_thread.request_shutdown(stop_instances);
+ guardian_thread.request_shutdown();
pthread_cond_signal(&guardian_thread.COND_guardian);
}
else
--- 1.36/server-tools/instance-manager/options.cc 2006-10-23 12:36:11 +04:00
+++ 1.37/server-tools/instance-manager/options.cc 2006-10-23 12:36:11 +04:00
@@ -41,7 +41,6 @@
static char win_dflt_config_file_name[FN_REFLEN];
static char win_dflt_password_file_name[FN_REFLEN];
static char win_dflt_pid_file_name[FN_REFLEN];
-static char win_dflt_socket_file_name[FN_REFLEN];
static char win_dflt_mysqld_path[FN_REFLEN];
@@ -54,7 +53,6 @@ my_bool Options::Service::stand_alone;
const char *Options::Main::config_file= win_dflt_config_file_name;
const char *Options::Main::password_file_name= win_dflt_password_file_name;
const char *Options::Main::pid_file_name= win_dflt_pid_file_name;
-const char *Options::Main::socket_file_name= win_dflt_socket_file_name;
const char *Options::Main::default_mysqld_path= win_dflt_mysqld_path;
@@ -262,10 +260,12 @@ static struct my_option my_long_options[
0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
#endif
+#ifndef __WIN__
{ "socket", OPT_SOCKET, "Socket file to use for connection.",
(gptr *) &Options::Main::socket_file_name,
(gptr *) &Options::Main::socket_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+#endif
#ifdef __WIN__
{ "standalone", OPT_STAND_ALONE, "Run the application in stand alone mode.",
@@ -550,8 +550,6 @@ static int setup_windows_defaults()
strxmov(win_dflt_password_file_name, dir_name, im_name, DFLT_PASSWD_FILE_EXT,
NullS);
strxmov(win_dflt_pid_file_name, dir_name, im_name, DFLT_PID_FILE_EXT, NullS);
- strxmov(win_dflt_socket_file_name, dir_name, im_name, DFLT_SOCKET_FILE_EXT,
- NullS);
return 0;
}
--- 1.17/server-tools/instance-manager/options.h 2006-10-23 12:36:11 +04:00
+++ 1.18/server-tools/instance-manager/options.h 2006-10-23 12:36:11 +04:00
@@ -50,7 +50,9 @@ struct Options
static bool is_forced_default_file;
static const char *pid_file_name;
+#ifndef __WIN__
static const char *socket_file_name;
+#endif
static const char *password_file_name;
static const char *default_mysqld_path;
static uint monitoring_interval;
--- 1.114/mysql-test/t/sp-error.test 2006-10-23 12:36:12 +04:00
+++ 1.115/mysql-test/t/sp-error.test 2006-10-23 12:36:12 +04:00
@@ -1748,6 +1748,8 @@ drop function if exists bug16896;
--error ER_SP_NO_AGGREGATE
create aggregate function bug16896() returns int return 1;
+#
+#
# BUG#14702: misleading error message when syntax error in CREATE
# PROCEDURE
#
--- 1.209/mysql-test/t/sp.test 2006-10-23 12:36:12 +04:00
+++ 1.210/mysql-test/t/sp.test 2006-10-23 12:36:12 +04:00
@@ -6419,6 +6419,170 @@ SELECT bug21493(Member_ID) FROM t3|
DROP FUNCTION bug21493|
DROP TABLE t3,t4|
+#
+# Bug#20028 Function with select return no data
+#
+
+--disable_warnings
+drop function if exists func_20028_a|
+drop function if exists func_20028_b|
+drop function if exists func_20028_c|
+drop procedure if exists proc_20028_a|
+drop procedure if exists proc_20028_b|
+drop procedure if exists proc_20028_c|
+drop table if exists table_20028|
+--enable_warnings
+
+create table table_20028 (i int)|
+
+SET @save_sql_mode=@@sql_mode|
+
+SET sql_mode=''|
+
+create function func_20028_a() returns integer
+begin
+ declare temp integer;
+ select i into temp from table_20028 limit 1;
+ return ifnull(temp, 0);
+end|
+
+create function func_20028_b() returns integer
+begin
+ return func_20028_a();
+end|
+
+create function func_20028_c() returns integer
+begin
+ declare div_zero integer;
+ set SQL_MODE='TRADITIONAL';
+ select 1/0 into div_zero;
+ return div_zero;
+end|
+
+create procedure proc_20028_a()
+begin
+ declare temp integer;
+ select i into temp from table_20028 limit 1;
+end|
+
+create procedure proc_20028_b()
+begin
+ call proc_20028_a();
+end|
+
+create procedure proc_20028_c()
+begin
+ declare div_zero integer;
+ set SQL_MODE='TRADITIONAL';
+ select 1/0 into div_zero;
+end|
+
+select func_20028_a()|
+select func_20028_b()|
+--error ER_DIVISION_BY_ZERO
+select func_20028_c()|
+call proc_20028_a()|
+call proc_20028_b()|
+--error ER_DIVISION_BY_ZERO
+call proc_20028_c()|
+
+SET sql_mode='TRADITIONAL'|
+
+drop function func_20028_a|
+drop function func_20028_b|
+drop function func_20028_c|
+drop procedure proc_20028_a|
+drop procedure proc_20028_b|
+drop procedure proc_20028_c|
+
+create function func_20028_a() returns integer
+begin
+ declare temp integer;
+ select i into temp from table_20028 limit 1;
+ return ifnull(temp, 0);
+end|
+
+create function func_20028_b() returns integer
+begin
+ return func_20028_a();
+end|
+
+create function func_20028_c() returns integer
+begin
+ declare div_zero integer;
+ set SQL_MODE='';
+ select 1/0 into div_zero;
+ return div_zero;
+end|
+
+create procedure proc_20028_a()
+begin
+ declare temp integer;
+ select i into temp from table_20028 limit 1;
+end|
+
+create procedure proc_20028_b()
+begin
+ call proc_20028_a();
+end|
+
+create procedure proc_20028_c()
+begin
+ declare div_zero integer;
+ set SQL_MODE='';
+ select 1/0 into div_zero;
+end|
+
+select func_20028_a()|
+select func_20028_b()|
+select func_20028_c()|
+call proc_20028_a()|
+call proc_20028_b()|
+call proc_20028_c()|
+
+SET @@sql_mode=@save_sql_mode|
+
+drop function func_20028_a|
+drop function func_20028_b|
+drop function func_20028_c|
+drop procedure proc_20028_a|
+drop procedure proc_20028_b|
+drop procedure proc_20028_c|
+drop table table_20028|
+
+#
+# Bug#21462 Stored procedures with no arguments require parenthesis
+#
+
+--disable_warnings
+drop procedure if exists proc_21462_a|
+drop procedure if exists proc_21462_b|
+--enable_warnings
+
+create procedure proc_21462_a()
+begin
+ select "Called A";
+end|
+
+create procedure proc_21462_b(x int)
+begin
+ select "Called B";
+end|
+
+call proc_21462_a|
+call proc_21462_a()|
+-- error ER_SP_WRONG_NO_OF_ARGS
+call proc_21462_a(1)|
+
+-- error ER_SP_WRONG_NO_OF_ARGS
+call proc_21462_b|
+-- error ER_SP_WRONG_NO_OF_ARGS
+call proc_21462_b()|
+call proc_21462_b(1)|
+
+drop procedure proc_21462_a|
+drop procedure proc_21462_b|
+
--echo End of 5.0 tests
--- 1.240/sql/sp_head.cc 2006-10-23 12:36:12 +04:00
+++ 1.241/sql/sp_head.cc 2006-10-23 12:36:12 +04:00
@@ -1029,8 +1029,7 @@ sp_head::execute(THD *thd)
save_sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode= m_sql_mode;
save_abort_on_warning= thd->abort_on_warning;
- thd->abort_on_warning=
- (m_sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
+ thd->abort_on_warning= 0;
/*
It is also more efficient to save/restore current thd->lex once when
--- 1.25/server-tools/instance-manager/guardian.cc 2006-10-23 12:36:12 +04:00
+++ 1.26/server-tools/instance-manager/guardian.cc 2006-10-23 12:36:12 +04:00
@@ -95,11 +95,11 @@ Guardian_thread::~Guardian_thread()
}
-void Guardian_thread::request_shutdown(bool stop_instances_arg)
+void Guardian_thread::request_shutdown()
{
pthread_mutex_lock(&LOCK_guardian);
/* stop instances or just clean up Guardian repository */
- stop_instances(stop_instances_arg);
+ stop_instances();
shutdown_requested= TRUE;
pthread_mutex_unlock(&LOCK_guardian);
}
@@ -154,11 +154,11 @@ void Guardian_thread::process_instance(I
{
/* Pid file not created yet, don't go to STARTED state yet */
}
- else
+ else if (current_node->state != STARTED)
{
/* clear status fields */
- log_info("guardian: instance %s is running, set state to STARTED",
- instance->options.instance_name);
+ log_info("guardian: instance '%s' is running, set state to STARTED.",
+ (const char *) instance->options.instance_name);
current_node->restart_counter= 0;
current_node->crash_moment= 0;
current_node->state= STARTED;
@@ -168,8 +168,8 @@ void Guardian_thread::process_instance(I
{
switch (current_node->state) {
case NOT_STARTED:
- log_info("guardian: starting instance %s",
- instance->options.instance_name);
+ log_info("guardian: starting instance '%s'...",
+ (const char *) instance->options.instance_name);
/* NOTE, set state to STARTING _before_ start() is called */
current_node->state= STARTING;
@@ -193,8 +193,8 @@ void Guardian_thread::process_instance(I
if (instance->is_crashed())
{
instance->start();
- log_info("guardian: starting instance %s",
- instance->options.instance_name);
+ log_info("guardian: starting instance '%s'...",
+ (const char *) instance->options.instance_name);
}
}
else
@@ -211,8 +211,8 @@ void Guardian_thread::process_instance(I
instance->start();
current_node->last_checked= current_time;
current_node->restart_counter++;
- log_info("guardian: restarting instance %s",
- instance->options.instance_name);
+ log_info("guardian: restarting instance '%s'...",
+ (const char *) instance->options.instance_name);
}
}
else
@@ -414,12 +414,11 @@ int Guardian_thread::stop_guard(Instance
SYNOPSYS
stop_instances()
- stop_instances_arg whether we should stop instances at shutdown
DESCRIPTION
Loops through the guarded_instances list and prepares them for shutdown.
- If stop_instances was requested, we need to issue a stop command and change
- the state accordingly. Otherwise we simply delete an entry.
+ For each instance we issue a stop command and change the state
+ accordingly.
NOTE
Guardian object should be locked by the calling function.
@@ -429,42 +428,29 @@ int Guardian_thread::stop_guard(Instance
1 - error occured
*/
-int Guardian_thread::stop_instances(bool stop_instances_arg)
+int Guardian_thread::stop_instances()
{
LIST *node;
node= guarded_instances;
while (node != NULL)
{
- if (!stop_instances_arg)
+ GUARD_NODE *current_node= (GUARD_NODE *) node->data;
+ /*
+ If instance is running or was running (and now probably hanging),
+ request stop.
+ */
+ if (current_node->instance->is_running() ||
+ (current_node->state == STARTED))
{
- /* just forget about an instance */
- guarded_instances= list_delete(guarded_instances, node);
- /*
- This should still work fine, as we have only removed the
- node from the list. The pointer to the next one is still valid
- */
- node= node->next;
+ current_node->state= STOPPING;
+ current_node->last_checked= time(NULL);
}
else
- {
- GUARD_NODE *current_node= (GUARD_NODE *) node->data;
- /*
- If instance is running or was running (and now probably hanging),
- request stop.
- */
- if (current_node->instance->is_running() ||
- (current_node->state == STARTED))
- {
- current_node->state= STOPPING;
- current_node->last_checked= time(NULL);
- }
- else
- /* otherwise remove it from the list */
- guarded_instances= list_delete(guarded_instances, node);
- /* But try to kill it anyway. Just in case */
- current_node->instance->kill_instance(SIGTERM);
- node= node->next;
- }
+ /* otherwise remove it from the list */
+ guarded_instances= list_delete(guarded_instances, node);
+ /* But try to kill it anyway. Just in case */
+ current_node->instance->kill_instance(SIGTERM);
+ node= node->next;
}
return 0;
}
--- 1.13/server-tools/instance-manager/guardian.h 2006-10-23 12:36:12 +04:00
+++ 1.14/server-tools/instance-manager/guardian.h 2006-10-23 12:36:12 +04:00
@@ -91,7 +91,7 @@ public:
/* Initialize or refresh the list of guarded instances */
int init();
/* Request guardian shutdown. Stop instances if needed */
- void request_shutdown(bool stop_instances);
+ void request_shutdown();
/* Start instance protection */
int guard(Instance *instance, bool nolock= FALSE);
/* Stop instance protection */
@@ -123,7 +123,7 @@ public:
private:
/* Prepares Guardian shutdown. Stops instances is needed */
- int stop_instances(bool stop_instances_arg);
+ int stop_instances();
/* check instance state and act accordingly */
void process_instance(Instance *instance, GUARD_NODE *current_node,
LIST **guarded_instances, LIST *elem);
--- 1.38/server-tools/instance-manager/instance.cc 2006-10-23 12:36:12 +04:00
+++ 1.39/server-tools/instance-manager/instance.cc 2006-10-23 12:36:12 +04:00
@@ -165,8 +165,8 @@ static int start_process(Instance_option
/* exec never returns */
exit(1);
case -1:
- log_info("cannot create a new process to start instance %s",
- instance_options->instance_name);
+ log_info("cannot create a new process to start instance '%s'.",
+ (const char *) instance_options->instance_name);
return 1;
}
return 0;
@@ -256,7 +256,8 @@ static void start_and_monitor_instance(I
are using is destroyed. (E.g. by "FLUSH INSTANCES")
*/
- log_info("starting instance %s", (const char *) instance_name.get_c_str());
+ log_info("starting instance %s...",
+ (const char *) instance_name.get_c_str());
if (start_process(old_instance_options, &process_info))
{
@@ -311,9 +312,9 @@ void Instance::remove_pid()
int pid;
if ((pid= options.get_pid()) != 0) /* check the pidfile */
if (options.unlink_pidfile()) /* remove stalled pidfile */
- log_error("cannot remove pidfile for instance %i, this might be \
+ log_error("cannot remove pidfile for instance '%s', this might be \
since IM lacks permmissions or hasn't found the pidifle",
- options.instance_name);
+ (const char *) options.instance_name);
}
@@ -467,9 +468,9 @@ bool Instance::is_running()
We have successfully connected to the server using fake
username/password. Write a warning to the logfile.
*/
- log_info("The Instance Manager was able to log into you server \
- with faked compiled-in password while checking server status. \
- Looks like something is wrong.");
+ log_info("The Instance Manager was able to log into you server "
+ "with faked compiled-in password while checking server status. "
+ "Looks like something is wrong.");
pthread_mutex_unlock(&LOCK_instance);
return_val= TRUE; /* server is alive */
}
@@ -616,10 +617,10 @@ void Instance::kill_instance(int signum)
/* Kill suceeded */
if (signum == SIGKILL) /* really killed instance with SIGKILL */
{
- log_error("The instance %s is being stopped forcibly. Normally" \
- "it should not happen. Probably the instance has been" \
+ log_error("The instance '%s' is being stopped forcibly. Normally"
+ "it should not happen. Probably the instance has been"
"hanging. You should also check your IM setup",
- options.instance_name);
+ (const char *) options.instance_name);
/* After sucessful hard kill the pidfile need to be removed */
options.unlink_pidfile();
}
--- 1.29/server-tools/instance-manager/instance_map.cc 2006-10-23 12:36:12 +04:00
+++ 1.30/server-tools/instance-manager/instance_map.cc 2006-10-23 12:36:12 +04:00
@@ -293,7 +293,9 @@ int Instance_map::flush_instances()
get_instance_key, delete_instance, 0);
rc= load();
- guardian->init(); // TODO: check error status.
+ /* don't init guardian if we failed to load instances */
+ if (!rc)
+ guardian->init(); // TODO: check error status.
return rc;
}
--- 1.77/mysql-test/t/ps.test 2006-10-23 12:36:12 +04:00
+++ 1.78/mysql-test/t/ps.test 2006-10-23 12:36:12 +04:00
@@ -988,6 +988,7 @@ execute stmt;
drop temporary table t1;
deallocate prepare stmt;
+
#
# BUG#22085: Crash on the execution of a prepared statement that
# uses an IN subquery with aggregate functions in HAVING
@@ -1112,6 +1113,7 @@ DROP TABLE t1;
--echo End of 4.1 tests.
+
############################# 5.0 tests start ################################
| Thread |
|---|
| • bk commit into 5.1 tree (kostja:1.2322) | konstantin | 23 Oct |