Skip to content

Commit

Permalink
rename debug variable to debug_dbug, to make test pass in release builds
Browse files Browse the repository at this point in the history
(and to follow the naming conventons).
keep old debug variable, but mark it as deprecated.
  • Loading branch information
Sergei Golubchik committed Dec 15, 2011
1 parent b86ba75 commit 1efdd5a
Show file tree
Hide file tree
Showing 147 changed files with 1,039 additions and 985 deletions.
6 changes: 3 additions & 3 deletions INSTALL-SOURCE
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ shell> ./configure --with-debug
(http:https://forge.mysql.com/wiki/MySQL_Internals_Porting).
As of MySQL 5.1.12, using --with-debug to configure MySQL with
debugging support enables you to use the
--debug="d,parser_debug" option when you start the server.
--debug-dbug="d,parser_debug" option when you start the server.
This causes the Bison parser that is used to process SQL
statements to dump a parser trace to the server's standard
error output. Typically, this output is written to the error
Expand Down Expand Up @@ -4725,7 +4725,7 @@ Note
the screen that may help solve the problem.

The last option is to start mysqld with the --standalone and
--debug options. In this case, mysqld writes a log file
--debug-dbug options. In this case, mysqld writes a log file
C:\mysqld.trace that should contain the reason why mysqld doesn't
start. See MySQL Internals: Porting
(http:https://forge.mysql.com/wiki/MySQL_Internals_Porting).
Expand Down Expand Up @@ -7716,7 +7716,7 @@ Can't start server: Bind on unix socket...
MIT-pthreads.

If you cannot get mysqld to start, you can try to make a trace
file to find the problem by using the --debug option. See MySQL
file to find the problem by using the --debug-dbug option. See MySQL
Internals: Porting
(http:https://forge.mysql.com/wiki/MySQL_Internals_Porting).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (!$debug_sync_action)
# Restart slave
--source include/stop_slave.inc

eval SET @@global.debug= "+d,$dbug_sync_point";
eval SET @@global.debug_dbug= "+d,$dbug_sync_point";

--source include/start_slave.inc
--echo slave is going to hang in get_master_version_and_clock
Expand Down Expand Up @@ -71,7 +71,7 @@ source include/wait_for_slave_io_error.inc;
# now to avoid restarting IO-thread to re-enter it.
# There will be a new IO thread forked out with its @@session.debug
# unset.
eval set @@global.debug = "-d,$dbug_sync_point";
eval set @@global.debug_dbug= "-d,$dbug_sync_point";

--let $rpl_server_number= 1
--source include/rpl_start_server.inc
Expand Down
16 changes: 8 additions & 8 deletions mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ create table tm (a int auto_increment primary key) engine=myisam;
create table ti (a int auto_increment primary key) engine=innodb;

sync_slave_with_master;
set @@global.debug="+d,stop_slave_middle_group";
set @@global.debug_dbug="+d,stop_slave_middle_group";

connection master;

Expand Down Expand Up @@ -43,7 +43,7 @@ eval SELECT "NO$error" AS Last_SQL_Error, @check as `true`;
select count(*) as one from tm;
select count(*) as one from ti;

set @@global.debug="-d";
set @@global.debug_dbug="-d";

#
# bug#45940 issues around rli->last_event_start_time
Expand All @@ -67,8 +67,8 @@ truncate table ti;
#connection slave;
sync_slave_with_master;

set @@global.debug="+d,stop_slave_middle_group";
set @@global.debug="+d,incomplete_group_in_relay_log";
set @@global.debug_dbug="+d,stop_slave_middle_group";
set @@global.debug_dbug="+d,incomplete_group_in_relay_log";

connection master;

Expand Down Expand Up @@ -96,7 +96,7 @@ eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
select count(*) as one from tm;
select count(*) as zero from ti;

set @@global.debug="-d";
set @@global.debug_dbug="-d";

#
# The mixed multi-table update
Expand All @@ -109,8 +109,8 @@ connection master;

#connection slave;
sync_slave_with_master;
set @@global.debug="+d,stop_slave_middle_group";
set @@global.debug="+d,incomplete_group_in_relay_log";
set @@global.debug_dbug="+d,stop_slave_middle_group";
set @@global.debug_dbug="+d,incomplete_group_in_relay_log";

connection master;
update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
Expand All @@ -135,7 +135,7 @@ eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
select max(a) as two from tm;
select max(a) as one from ti;

set @@global.debug="-d";
set @@global.debug_dbug="-d";

#
# clean-up
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/include/binlog_inject_error.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# source include/binlog_inject_error.inc;
#

SET GLOBAL debug='d,injecting_fault_writing';
SET GLOBAL debug_dbug='d,injecting_fault_writing';
--echo $query;
--replace_regex /(errno: .*)/(errno: #)/
--error ER_ERROR_ON_WRITE
--eval $query
SET GLOBAL debug='';
SET GLOBAL debug_dbug='';
2 changes: 1 addition & 1 deletion mysql-test/include/check-warnings.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set SQL_LOG_BIN=0;
# Turn off any debug crashes, allow the variable to be
# non existent in release builds
--error 0,1193
set debug="";
set debug_dbug="";


use mtr;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/include/io_thd_fault_injection.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ SET @old_debug=@@global.debug;
-- disable_warnings
-- source include/stop_slave.inc
-- enable_warnings
-- eval SET GLOBAL debug="+d,$io_thd_injection_fault_flag"
-- eval SET GLOBAL debug_dbug="+d,$io_thd_injection_fault_flag"

START SLAVE io_thread;
-- source include/wait_for_slave_io_error.inc

-- eval SET GLOBAL debug="-d,$io_thd_injection_fault_flag"
SET GLOBAL debug=@old_debug;
-- eval SET GLOBAL debug_dbug="-d,$io_thd_injection_fault_flag"
SET GLOBAL debug_dbug=@old_debug;

# restart because slave is in bad shape
--let $rpl_server_number= 2
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/include/maria_verify_recovery.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.exp
# but that would implicitely commit all work, which the tester may
# not want (tester may want to observe rollback happening).

eval SET SESSION debug=$mvr_debug_option;
eval SET SESSION debug_dbug=$mvr_debug_option;
--echo * crashing mysqld intentionally
--error 2013
eval $mvr_crash_statement; # this will crash (DBUG magic)
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ END
my $opt_view_protocol;

our $opt_debug;
my $debug_d= "d";
my $debug_d= "d,*";
my $opt_debug_common;
our $opt_debug_server;
our @opt_cases; # The test cases names in argv
Expand Down Expand Up @@ -3471,7 +3471,7 @@ sub mysql_install_db {

if ( $opt_debug )
{
mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/bootstrap.trace",
mtr_add_arg($args, "--debug-dbug=$debug_d:t:i:A,%s/log/bootstrap.trace",
$path_vardir_trace);
}

Expand Down Expand Up @@ -5383,7 +5383,7 @@ ($$)

if ( $opt_debug )
{
mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/%s.trace",
mtr_add_arg($args, "--debug-dbug=$debug_d:t:i:A,%s/log/%s.trace",
$path_vardir_trace, $mysqld->name());
}

Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/archive_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
INSERT INTO t1 VALUES(1);
SET SESSION debug='d,simulate_archive_open_failure';
SET SESSION debug_dbug='d,simulate_archive_open_failure';
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check error Corrupt
SET SESSION debug=DEFAULT;
SET SESSION debug_dbug=DEFAULT;
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/r/crash_commit_before.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE t1(a int) engine=innodb;
START TRANSACTION;
insert into t1 values(9);
SET GLOBAL debug="d,crash_commit_before";
SET GLOBAL debug_dbug="d,crash_commit_before";
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
SHOW CREATE TABLE t1;
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/drop_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ CREATE TABLE mysql_test.t1(a INT);
CREATE TABLE mysql_test.t2(b INT);
CREATE TABLE mysql_test.t3(c INT);

SET SESSION DEBUG = "+d,bug43138";
SET SESSION debug_dbug= "+d,bug43138";

DROP DATABASE mysql_test;
Warnings:
Error 1051 Unknown table 't1'
Error 1051 Unknown table 't2'
Error 1051 Unknown table 't3'

SET SESSION DEBUG = "-d,bug43138";
SET SESSION debug_dbug= "-d,bug43138";

# --
# -- End of Bug#43138.
Expand Down
14 changes: 7 additions & 7 deletions mysql-test/r/error_simulation.result
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ INSERT INTO t1 VALUES
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
set session debug="d,raise_error";
set session debug_dbug="d,raise_error";
SELECT MAX(a) FROM t1 GROUP BY a,b;
ERROR 23000: Can't write; duplicate key in table 'tmp_table'
set tmp_table_size=default;
Expand All @@ -23,9 +23,9 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug='+d,alter_table_only_index_change';
SET SESSION debug_dbug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
SET SESSION debug=DEFAULT;
SET SESSION debug_dbug=DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
Expand All @@ -42,10 +42,10 @@ DROP TABLE t1;
# Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string
#
CREATE TABLE t1(a BLOB);
SET SESSION debug="+d,bug42064_simulate_oom";
SET SESSION debug_dbug="+d,bug42064_simulate_oom";
INSERT INTO t1 VALUES("");
Got one of the listed errors
SET SESSION debug=DEFAULT;
SET SESSION debug_dbug=DEFAULT;
DROP TABLE t1;
#
# Bug#41660: Sort-index_merge for non-first join table may require
Expand All @@ -62,7 +62,7 @@ INSERT INTO t2 VALUES (1, 1, 'data');
# re-scanned for every record in the outer table. if we used inner join,
# we would need to have thousands of records and/or more columns in both
# tables so that the join buffer is filled and re-scans are triggered).
SET SESSION debug = '+d,only_one_Unique_may_be_created';
SET SESSION debug_dbug= '+d,only_one_Unique_may_be_created';
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
id select_type table type possible_keys key key_len ref rows Extra
Expand All @@ -80,7 +80,7 @@ a a b filler
7 1 1 data
8 1 1 data
9 1 1 data
SET SESSION debug = DEFAULT;
SET SESSION debug_dbug= DEFAULT;
DROP TABLE t1, t2;
#
# End of 5.1 tests
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/filesort_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ SET @old_debug= @@session.debug;
#
CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
SET session debug= '+d,make_char_array_fail';
SET session debug_dbug= '+d,make_char_array_fail';
CALL mtr.add_suppression("Out of sort memory");
SELECT * FROM t1 ORDER BY f1 ASC, f0;
ERROR HY001: Out of sort memory, consider increasing server sort buffer size
SET session debug= @old_debug;
SET session debug_dbug= @old_debug;
CREATE FUNCTION f1() RETURNS INT RETURN 1;
DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
Expand Down

0 comments on commit 1efdd5a

Please sign in to comment.