Below is the list of changes that have just been committed into a local
5.1 repository of joerg. When joerg 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, 2007-06-06 19:59:18+02:00, joerg@trift2. +7 -0
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
MERGE: 1.2500.1.32
BitKeeper/deleted/.del-CMakeLists.txt~1@stripped, 2007-06-06 19:59:06+02:00, joerg@trift2. +0 -1
Auto merged
MERGE: 1.18.1.1
CMakeLists.txt@stripped, 2007-06-06 19:59:06+02:00, joerg@trift2. +0 -1
Auto merged
MERGE: 1.30.1.1
mysql-test/extra/binlog_tests/ctype_cp932_binlog.test@stripped, 2007-06-06 19:59:07+02:00, joerg@trift2. +0 -0
Auto merged
MERGE: 1.9.1.2
mysql-test/mysql-test-run.pl@stripped, 2007-06-06 19:59:07+02:00, joerg@trift2. +0 -0
Auto merged
MERGE: 1.303.1.9
mysql-test/t/mysqltest.test@stripped, 2007-06-06 19:59:07+02:00, joerg@trift2. +0 -0
Auto merged
MERGE: 1.73.1.4
mysql-test/t/ps.test@stripped, 2007-06-06 19:59:07+02:00, joerg@trift2. +0 -0
Auto merged
MERGE: 1.114.1.2
sql/sql_parse.cc@stripped, 2007-06-06 19:59:08+02:00, joerg@trift2. +0 -0
Auto merged
MERGE: 1.675.1.2
# 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: joerg
# Host: trift2.
# Root: /MySQL/M51/push-5.1/RESYNC
--- 1.676/sql/sql_parse.cc 2007-06-04 11:24:37 +02:00
+++ 1.677/sql/sql_parse.cc 2007-06-06 19:59:08 +02:00
@@ -623,7 +623,7 @@
the client, the connection is closed or "net_wait_timeout"
number of seconds has passed
*/
- net_set_read_timeout(net, thd->variables.net_wait_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
thd->clear_error(); // Clear error message
@@ -655,7 +655,7 @@
}
/* Restore read timeout value */
- net_set_read_timeout(net, thd->variables.net_read_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_read_timeout);
/*
packet_length contains length of data, as it was stored in packet
--- 1.309/mysql-test/mysql-test-run.pl 2007-06-06 16:47:53 +02:00
+++ 1.310/mysql-test/mysql-test-run.pl 2007-06-06 19:59:07 +02:00
@@ -104,8 +104,6 @@
our $glob_hostname= undef;
our $glob_scriptname= undef;
our $glob_timers= undef;
-our $glob_use_running_ndbcluster= 0;
-our $glob_use_running_ndbcluster_slave= 0;
our $glob_use_embedded_server= 0;
our @glob_test_mode;
@@ -930,40 +928,6 @@
}
# --------------------------------------------------------------------------
- # Ndb cluster flags
- # --------------------------------------------------------------------------
-
- if ( $opt_ndbconnectstring )
- {
- $glob_use_running_ndbcluster= 1;
- mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
- if $opt_skip_ndbcluster;
- mtr_error("Can't specify --ndb-connectstring and --ndbcluster-port")
- if $opt_ndbcluster_port;
- }
- else
- {
- # Set default connect string
- $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
- }
-
- if ( $opt_ndbconnectstring_slave )
- {
- $glob_use_running_ndbcluster_slave= 1;
- mtr_error("Can't specify ndb-connectstring_slave and " .
- "--skip-ndbcluster-slave")
- if $opt_skip_ndbcluster;
- mtr_error("Can't specify --ndb-connectstring-slave and " .
- "--ndbcluster-port-slave")
- if $opt_ndbcluster_port_slave;
- }
- else
- {
- # Set default connect string
- $opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave";
- }
-
- # --------------------------------------------------------------------------
# Bench flags
# --------------------------------------------------------------------------
if ( $opt_small_bench )
@@ -1206,7 +1170,7 @@
nodes => 2,
port => "$opt_ndbcluster_port",
data_dir => "$data_dir",
- connect_string => "$opt_ndbconnectstring",
+ connect_string => "host=localhost:$opt_ndbcluster_port",
path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
installed_ok => 0,
@@ -1219,7 +1183,7 @@
nodes => 1,
port => "$opt_ndbcluster_port_slave",
data_dir => "$data_dir",
- connect_string => "$opt_ndbconnectstring_slave",
+ connect_string => "host=localhost:$opt_ndbcluster_port_slave",
path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
installed_ok => 0,
@@ -1241,6 +1205,9 @@
}
}
+ # --------------------------------------------------------------------------
+ # extern
+ # --------------------------------------------------------------------------
if ( $opt_extern )
{
# Turn off features not supported when running with extern server
@@ -1257,6 +1224,38 @@
if $opt_socket;
}
+
+ # --------------------------------------------------------------------------
+ # ndbconnectstring and ndbconnectstring_slave
+ # --------------------------------------------------------------------------
+ if ( $opt_ndbconnectstring )
+ {
+ # ndbconnectstring was supplied by user, the tests shoudl be run
+ # against an already started cluster, change settings
+ my $cluster= $clusters->[0]; # Master cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
+ if $opt_skip_ndbcluster;
+ }
+ $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
+
+
+ if ( $opt_ndbconnectstring_slave )
+ {
+ # ndbconnectstring-slave was supplied by user, the tests should be run
+ # agains an already started slave cluster, change settings
+ my $cluster= $clusters->[1]; # Slave cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify ndb-connectstring_slave and " .
+ "--skip-ndbcluster-slave")
+ if $opt_skip_ndbcluster_slave;
+ }
+
+
$path_timefile= "$opt_vardir/log/mysqltest-time";
$path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
$path_current_test_log= "$opt_vardir/log/current_test";
@@ -1867,7 +1866,6 @@
$ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
$ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
- $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
if ( $mysql_version_id >= 50000 )
{
@@ -2346,16 +2344,23 @@
close FILE;
}
- chmod(oct("0755"), $test_file);
- unlink($test_file);
+ # Some filesystems( for example CIFS) allows reading a file
+ # although mode was set to 0000, but in that case a stat on
+ # the file will not return 0000
+ my $file_mode= (stat($test_file))[2] & 07777;
$ENV{'MYSQL_TEST_ROOT'}= "NO";
- if ($result eq "MySQL")
+ mtr_verbose("result: $result, file_mode: $file_mode");
+ if ($result eq "MySQL" && $file_mode == 0)
{
mtr_warning("running this script as _root_ will cause some " .
"tests to be skipped");
$ENV{'MYSQL_TEST_ROOT'}= "YES";
}
+
+ chmod(oct("0755"), $test_file);
+ unlink($test_file);
+
}
@@ -2692,7 +2697,7 @@
mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
- if ( $glob_use_running_ndbcluster )
+ if ( $cluster->{'use_running'} )
{
return 0;
}
@@ -2909,30 +2914,34 @@
my $cluster_started_ok= 1; # Assume it can be started
- if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster ||
- $clusters->[0]->{executable_setup_failed})
+ my $cluster= $clusters->[0]; # Master cluster
+ if ($opt_skip_ndbcluster ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
{
# Don't install master cluster
}
- elsif (ndbcluster_start_install($clusters->[0]))
+ elsif (ndbcluster_start_install($cluster))
{
- mtr_warning("Failed to start install of $clusters->[0]->{name}");
+ mtr_warning("Failed to start install of $cluster->{name}");
$cluster_started_ok= 0;
}
+ $cluster= $clusters->[1]; # Slave cluster
if ($max_slave_num == 0 ||
- $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave ||
- $clusters->[1]->{executable_setup_failed})
+ $opt_skip_ndbcluster_slave ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
{
# Don't install slave cluster
}
- elsif (ndbcluster_start_install($clusters->[1]))
+ elsif (ndbcluster_start_install($cluster))
{
- mtr_warning("Failed to start install of $clusters->[1]->{name}");
+ mtr_warning("Failed to start install of $cluster->{name}");
$cluster_started_ok= 0;
}
- foreach my $cluster (@{$clusters})
+ foreach $cluster (@{$clusters})
{
next if !$cluster->{'pid'};
@@ -3207,9 +3216,16 @@
{
foreach my $cluster (@{$clusters})
{
+ # Slave cluster is skipped and thus not
+ # installed, no need to perform checks
last if ($opt_skip_ndbcluster_slave and
$cluster->{'name'} eq 'Slave');
+ # Using running cluster - no need
+ # to check if test should be skipped
+ # will be done by test itself
+ last if ($cluster->{'use_running'});
+
# If test needs this cluster, check binaries was found ok
if ( $cluster->{'executable_setup_failed'} )
{
@@ -3662,6 +3678,9 @@
# FIXME what about second master.....
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
{
unlink($bin);
@@ -3684,6 +3703,9 @@
my $tname= $tinfo->{'name'};
my $init_script= $tinfo->{'master_sh'};
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
{
unlink($bin);
@@ -3816,12 +3838,8 @@
}
my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $opt_skip_ndbcluster ||
- !$cluster->{'pid'})
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
- else
+ if ( $cluster->{'pid'} || # Cluster is started
+ $cluster->{'use_running'} ) # Using running cluster
{
mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
@@ -3831,6 +3849,10 @@
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
}
else
{
@@ -3888,23 +3910,24 @@
mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
}
- if ( $opt_skip_ndbcluster_slave ||
- $mysqld->{'cluster'} == -1 ||
- !$clusters->[$mysqld->{'cluster'}]->{'pid'} )
- {
- mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
- }
- else
+ my $cluster= $clusters->[$mysqld->{'cluster'}];
+ if ( $cluster->{'pid'} || # Slave cluster is started
+ $cluster->{'use_running'} ) # Using running slave cluster
{
mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $clusters->[$mysqld->{'cluster'}]->{'connect_string'});
+ $cluster->{'connect_string'});
if ( $mysql_version_id >= 50100 )
{
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
+
} # end slave
if ( $opt_debug )
@@ -4453,7 +4476,8 @@
}
- if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
+ if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
+ and ! $master->[1]->{'pid'} and
$tinfo->{'master_num'} > 1 )
{
# Test needs cluster, start an extra mysqld connected to cluster
--- 1.78/mysql-test/t/mysqltest.test 2007-06-06 16:47:53 +02:00
+++ 1.79/mysql-test/t/mysqltest.test 2007-06-06 19:59:07 +02:00
@@ -1224,11 +1224,9 @@
# Test sync_with_master
# ----------------------------------------------------------------------------
--error 1
---exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master 10!;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test connect
@@ -1873,5 +1871,127 @@
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
--enable_abort_on_error
+--enable_query_log
+
+# ----------------------------------------------------------------------------
+# test for query_get_value
+# ----------------------------------------------------------------------------
+
+CREATE TABLE t1(
+ a int, b varchar(255), c datetime
+);
+SHOW COLUMNS FROM t1;
+
+#------------ Positive tests ------------
+# 1. constant parameters
+# value is simple string without spaces
+let $value= query_get_value(SHOW COLUMNS FROM t1, Type, 1);
+--echo statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=$value
+let $value= query_get_value("SHOW COLUMNS FROM t1", Type, 1);
+--echo statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=$value
+#
+# 2. $variables as parameters
+# value IS NULL
+let $my_show= SHOW COLUMNS FROM t1;
+let $column_name= Default;
+let $row_number= 1;
+let $value= query_get_value($my_show, $column_name, $row_number);
+--echo statement=$my_show row_number=$row_number, column_name=$column_name, Value=$value
+#
+# 3. result set of a SELECT (not recommended, because projection and
+# selection could be done much better by pure SELECT functionality)
+# value is string with space in the middle
+let $value= query_get_value(SELECT 'A B' AS "MyColumn", MyColumn, 1);
+--echo value= ->$value<-
+#
+# 4. column name with space
+let $value= query_get_value(SELECT 1 AS "My Column", My Column, 1);
+--echo value= $value
+#
+#------------ Negative tests ------------
+# 5. Incomplete statement including missing parameters
+# 5.1 incomplete statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW;" | $MYSQL_TEST 2>&1
+# 5.2 missing query
+--error 1
+--exec echo "let \$value= query_get_value;" | $MYSQL_TEST 2>&1
+# 5.3 missing column name
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1);" | $MYSQL_TEST 2>&1
+# 5.4 missing row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field);" | $MYSQL_TEST 2>&1
+#
+# 6. Somehow "wrong" value of parameters
+# 6.1 row parameter
+# 6.1.1 non sense number 0
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 0);
+--echo value= $value
+# 6.1.2 after the last row
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 10);
+--echo value= $value
+# 6.1.3 invalid row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field, notnumber);" | $MYSQL_TEST 2>&1
+# 6.2 column name parameter, name of not existing column
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, column_not_exists, 1);" | $MYSQL_TEST 2>&1
+# 6.3. statement which never gives a result set
+--error 1
+--exec echo "let \$value= query_get_value(SET @A = 1, Field, 1);" | $MYSQL_TEST 2>&1
+# 6.4. statement contains a ","
+# Note: There is no need to improve this, because we need query_get_value
+# for SHOW commands only.
+--error 1
+--exec echo "let \$value= query_get_value(SELECT 1 AS "A", 1 AS "B", 1);" | $MYSQL_TEST 2>&1
+#
+# 7. empty result set
+let $value= initialized;
+let $value= query_get_value(SELECT a FROM t1, a, 1);
+--echo value= $value
+#
+# 9. failing statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLNS FROM t1, Field, 1);" | $MYSQL_TEST 2>&1
+#
+# 10. Artificial example how to process a complete SHOW result set:
+let $show_statement= SHOW COLUMNS FROM t1;
+let $rowno= 1;
+let $run=1;
+let $count= 0;
+--echo
+--echo Field Type Null Key Default Extra
+while ($run)
+{
+ let $Field= query_get_value($show_statement, Field, $rowno);
+ if (`SELECT '$Field' = 'No such row'`)
+ {
+ let $run= 0;
+ }
+ if (`SELECT '$Field' <> 'No such row'`)
+ {
+ let $Type= query_get_value($show_statement, Type, $rowno);
+ let $Null= query_get_value($show_statement, Null, $rowno);
+ if (`SELECT '$Null' = 'YES'`)
+ {
+ inc $count;
+ }
+ let $Key= query_get_value($show_statement, Key, $rowno);
+ let $Default= query_get_value($show_statement, Default, $rowno);
+ let $Extra= query_get_value($show_statement, Extra, $rowno);
+ --echo $Field $Type $Null ->$Key<- $Default $Extra
+ inc $rowno;
+ }
+}
+--echo
+--echo Number of columns with Default NULL: $count
+--echo
+eval $show_statement;
+
+drop table t1;
--echo End of tests
+
--- 1.117/mysql-test/t/ps.test 2007-06-05 17:31:39 +02:00
+++ 1.118/mysql-test/t/ps.test 2007-06-06 19:59:07 +02:00
@@ -1,4 +1,5 @@
-- source include/not_embedded.inc
+-- source include/have_log_bin.inc
#
# SQL Syntax for Prepared Statements test
#
| Thread |
|---|
| • bk commit into 5.1 tree (joerg:1.2545) | Joerg Bruehe | 6 Jun |