Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl

into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge


mysql-test/t/disabled.def:
  Auto merged
sql/sql_insert.cc:
  Auto merged
This commit is contained in:
unknown 2006-06-21 13:51:28 +02:00
commit cffb1699bf
65 changed files with 762 additions and 326 deletions

View File

@ -6,7 +6,7 @@
# tree can then be picked up by "make dist" to create the "pristine source # tree can then be picked up by "make dist" to create the "pristine source
# package" that is used as the basis for all other binary builds. # package" that is used as the basis for all other binary builds.
# #
make distclean test -f Makefile && make distclean
(cd storage/bdb/dist && sh s_all) (cd storage/bdb/dist && sh s_all)
(cd storage/innobase && aclocal && autoheader && \ (cd storage/innobase && aclocal && autoheader && \
libtoolize --automake --force --copy && \ libtoolize --automake --force --copy && \

View File

@ -256,6 +256,6 @@ typedef struct
} LEX_STRING; } LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1)) #define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1))
#define C_STRING_WITH_SIZE(X) ((char *) (X)), ((uint) (sizeof(X) - 1)) #define C_STRING_WITH_LEN(X) ((char *) (X)), ((uint) (sizeof(X) - 1))
#endif #endif

View File

@ -797,6 +797,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define DBL_MAX 1.79769313486231470e+308 #define DBL_MAX 1.79769313486231470e+308
#define FLT_MAX ((float)3.40282346638528860e+38) #define FLT_MAX ((float)3.40282346638528860e+38)
#endif #endif
#ifndef SSIZE_MAX
#define SSIZE_MAX ((~((size_t) 0)) / 2)
#endif
#if !defined(HAVE_ISINF) && !defined(isinf) #if !defined(HAVE_ISINF) && !defined(isinf)
#define isinf(X) 0 #define isinf(X) 0

View File

@ -880,19 +880,28 @@ sub mtr_kill_processes ($) {
sub mtr_kill_process ($$$$) { sub mtr_kill_process ($$$$) {
my $pid= shift; my $pid= shift;
my $signal= shift; my $signal= shift;
my $retries= shift; my $total_retries= shift;
my $timeout= shift; my $timeout= shift;
while (1) for (my $cur_attempt= 1; $cur_attempt <= $total_retries; ++$cur_attempt)
{ {
mtr_debug("Sending $signal to $pid...");
kill($signal, $pid); kill($signal, $pid);
last unless kill (0, $pid) and $retries--; unless (kill (0, $pid))
{
mtr_debug("Process $pid died.");
return;
}
mtr_debug("Sleep $timeout second waiting for processes to die"); mtr_debug("Sleeping $timeout second(s) waiting for processes to die...");
sleep($timeout); sleep($timeout);
} }
mtr_debug("Process $pid is still alive after $total_retries " .
"of sending signal $signal.");
} }
############################################################################## ##############################################################################

View File

@ -290,7 +290,7 @@ our $opt_user_test;
our $opt_valgrind= 0; our $opt_valgrind= 0;
our $opt_valgrind_mysqld= 0; our $opt_valgrind_mysqld= 0;
our $opt_valgrind_mysqltest= 0; our $opt_valgrind_mysqltest= 0;
our $opt_valgrind_all= 0; our $default_valgrind_options= "-v --show-reachable=yes";
our $opt_valgrind_options; our $opt_valgrind_options;
our $opt_valgrind_path; our $opt_valgrind_path;
@ -629,10 +629,9 @@ sub command_line_setup () {
# Coverage, profiling etc # Coverage, profiling etc
'gcov' => \$opt_gcov, 'gcov' => \$opt_gcov,
'gprof' => \$opt_gprof, 'gprof' => \$opt_gprof,
'valgrind' => \$opt_valgrind, 'valgrind|valgrind-all' => \$opt_valgrind,
'valgrind-mysqltest' => \$opt_valgrind_mysqltest, 'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
'valgrind-mysqld' => \$opt_valgrind_mysqld, 'valgrind-mysqld' => \$opt_valgrind_mysqld,
'valgrind-all' => \$opt_valgrind_all,
'valgrind-options=s' => \$opt_valgrind_options, 'valgrind-options=s' => \$opt_valgrind_options,
'valgrind-path=s' => \$opt_valgrind_path, 'valgrind-path=s' => \$opt_valgrind_path,
@ -816,20 +815,32 @@ sub command_line_setup () {
} }
} }
# Turn on valgrinding of all executables if "valgrind" or "valgrind-all" # Check valgrind arguments
if ( $opt_valgrind or $opt_valgrind_all ) if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options)
{ {
mtr_report("Turning on valgrind for all executables"); mtr_report("Turning on valgrind for all executables");
$opt_valgrind= 1; $opt_valgrind= 1;
$opt_valgrind_mysqld= 1; $opt_valgrind_mysqld= 1;
$opt_valgrind_mysqltest= 1; $opt_valgrind_mysqltest= 1;
} }
elsif ( $opt_valgrind_mysqld or $opt_valgrind_mysqltest ) elsif ( $opt_valgrind_mysqld )
{ {
# If test's are run for a specific executable, turn on mtr_report("Turning on valgrind for mysqld(s) only");
# verbose and show-reachable
$opt_valgrind= 1; $opt_valgrind= 1;
$opt_valgrind_all= 1; }
elsif ( $opt_valgrind_mysqltest )
{
mtr_report("Turning on valgrind for mysqltest only");
$opt_valgrind= 1;
}
if ( $opt_valgrind )
{
# Set valgrind_options to default unless already defined
$opt_valgrind_options=$default_valgrind_options
unless defined $opt_valgrind_options;
mtr_report("Running valgrind with options \"$opt_valgrind_options\"");
} }
if ( ! $opt_testcase_timeout ) if ( ! $opt_testcase_timeout )
@ -3109,22 +3120,58 @@ sub im_stop($) {
# Try graceful shutdown. # Try graceful shutdown.
mtr_debug("IM-main pid: $instance_manager->{'pid'}");
mtr_debug("Stopping IM-main...");
mtr_kill_process($instance_manager->{'pid'}, 'TERM', 10, 1); mtr_kill_process($instance_manager->{'pid'}, 'TERM', 10, 1);
# If necessary, wait for angel process to die.
if (defined $instance_manager->{'angel_pid'})
{
mtr_debug("IM-angel pid: $instance_manager->{'angel_pid'}");
mtr_debug("Waiting for IM-angel to die...");
my $total_attempts= 10;
for (my $cur_attempt=1; $cur_attempt <= $total_attempts; ++$cur_attempt)
{
unless (kill (0, $instance_manager->{'angel_pid'}))
{
mtr_debug("IM-angel died.");
last;
}
sleep(1);
}
}
# Check that all processes died. # Check that all processes died.
my $clean_shutdown= 0; my $clean_shutdown= 0;
while (1) while (1)
{ {
last if kill (0, $instance_manager->{'pid'}); if (kill (0, $instance_manager->{'pid'}))
{
mtr_debug("IM-main is still alive.");
last;
}
last if (defined $instance_manager->{'angel_pid'}) && if (defined $instance_manager->{'angel_pid'} &&
kill (0, $instance_manager->{'angel_pid'}); kill (0, $instance_manager->{'angel_pid'}))
{
mtr_debug("IM-angel is still alive.");
last;
}
foreach my $pid (@mysqld_pids) foreach my $pid (@mysqld_pids)
{ {
last if kill (0, $pid); if (kill (0, $pid))
{
mtr_debug("Guarded mysqld ($pid) is still alive.");
last;
}
} }
$clean_shutdown= 1; $clean_shutdown= 1;
@ -3135,15 +3182,21 @@ sub im_stop($) {
unless ($clean_shutdown) unless ($clean_shutdown)
{ {
mtr_kill_process($instance_manager->{'angel_pid'}, 'KILL', 10, 1)
if defined $instance_manager->{'angel_pid'}; if (defined $instance_manager->{'angel_pid'})
{
mtr_debug("Killing IM-angel...");
mtr_kill_process($instance_manager->{'angel_pid'}, 'KILL', 10, 1)
}
mtr_debug("Killing IM-main...");
mtr_kill_process($instance_manager->{'pid'}, 'KILL', 10, 1); mtr_kill_process($instance_manager->{'pid'}, 'KILL', 10, 1);
# Shutdown managed mysqld-processes. Some of them may be nonguarded, so IM # Shutdown managed mysqld-processes. Some of them may be nonguarded, so IM
# will not stop them on shutdown. So, we should firstly try to end them # will not stop them on shutdown. So, we should firstly try to end them
# legally. # legally.
mtr_debug("Killing guarded mysqld(s)...");
mtr_kill_processes(\@mysqld_pids); mtr_kill_processes(\@mysqld_pids);
# Complain in error log so that a warning will be shown. # Complain in error log so that a warning will be shown.
@ -3694,17 +3747,8 @@ sub valgrind_arguments {
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
if -f "$glob_mysql_test_dir/valgrind.supp"; if -f "$glob_mysql_test_dir/valgrind.supp";
if ( $opt_valgrind_all ) # Add valgrind options, can be overriden by user
{ mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--show-reachable=yes");
}
if ( $opt_valgrind_options )
{
mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
}
mtr_add_arg($args, $$exe); mtr_add_arg($args, $$exe);
@ -3816,12 +3860,11 @@ Options for coverage, profiling etc
gcov FIXME gcov FIXME
gprof FIXME gprof FIXME
valgrind Run the "mysqltest" and "mysqld" executables using valgrind Run the "mysqltest" and "mysqld" executables using
valgrind valgrind with options($default_valgrind_options)
valgrind-all Same as "valgrind" but will also add "verbose" and valgrind-all Synonym for --valgrind
"--show-reachable" flags to valgrind
valgrind-mysqltest Run the "mysqltest" executable with valgrind valgrind-mysqltest Run the "mysqltest" executable with valgrind
valgrind-mysqld Run the "mysqld" executable with valgrind valgrind-mysqld Run the "mysqld" executable with valgrind
valgrind-options=ARGS Extra options to give valgrind valgrind-options=ARGS Options to give valgrind, replaces default options
valgrind-path=[EXE] Path to the valgrind executable valgrind-path=[EXE] Path to the valgrind executable
Misc options Misc options

View File

@ -241,3 +241,11 @@ select * from t1 where match a against('ab c' in boolean mode);
a a
drop table t1; drop table t1;
set names latin1; set names latin1;
SET NAMES utf8;
CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES('„MySQL“');
SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE);
a
„MySQL“
DROP TABLE t1;
SET NAMES latin1;

View File

@ -1,3 +1,4 @@
Success: the process has been started.
SHOW INSTANCES; SHOW INSTANCES;
instance_name state instance_name state
mysqld1 online mysqld1 online

View File

@ -2,6 +2,7 @@
-------------------------------------------------------------------- --------------------------------------------------------------------
-- 1.1.1. -- 1.1.1.
-------------------------------------------------------------------- --------------------------------------------------------------------
Success: the process has been started.
SHOW INSTANCES; SHOW INSTANCES;
instance_name state instance_name state
mysqld1 online mysqld1 online
@ -11,10 +12,7 @@ mysqld2 offline
-- 1.1.2. -- 1.1.2.
-------------------------------------------------------------------- --------------------------------------------------------------------
START INSTANCE mysqld2; START INSTANCE mysqld2;
SHOW INSTANCES; Success: the process has been started.
instance_name state
mysqld1 online
mysqld2 online
SHOW VARIABLES LIKE 'port'; SHOW VARIABLES LIKE 'port';
Variable_name Value Variable_name Value
port IM_MYSQLD2_PORT port IM_MYSQLD2_PORT
@ -23,16 +21,7 @@ port IM_MYSQLD2_PORT
-- 1.1.3. -- 1.1.3.
-------------------------------------------------------------------- --------------------------------------------------------------------
STOP INSTANCE mysqld2; STOP INSTANCE mysqld2;
SHOW INSTANCES; Success: the process has been stopped.
instance_name state
mysqld1 online
mysqld2 offline
SHOW INSTANCE STATUS mysqld1;
instance_name state version_number version mysqld_compatible
mysqld1 online VERSION_NUMBER VERSION no
SHOW INSTANCE STATUS mysqld2;
instance_name state version_number version mysqld_compatible
mysqld2 offline VERSION_NUMBER VERSION no
-------------------------------------------------------------------- --------------------------------------------------------------------
-- 1.1.4. -- 1.1.4.
@ -58,26 +47,19 @@ mysqld2 offline
Killing the process... Killing the process...
Sleeping... Sleeping...
Success: the process was restarted. Success: the process was restarted.
SHOW INSTANCES;
instance_name state
mysqld1 online
mysqld2 offline
-------------------------------------------------------------------- --------------------------------------------------------------------
-- 1.1.7. -- 1.1.7.
-------------------------------------------------------------------- --------------------------------------------------------------------
SHOW INSTANCES;
instance_name state
mysqld1 online
mysqld2 offline
START INSTANCE mysqld2; START INSTANCE mysqld2;
SHOW INSTANCES; Success: the process has been started.
instance_name state
mysqld1 online
mysqld2 online
Killing the process... Killing the process...
Sleeping... Sleeping...
Success: the process was killed. Success: the process was killed.
SHOW INSTANCES;
instance_name state
mysqld1 online
mysqld2 offline
-------------------------------------------------------------------- --------------------------------------------------------------------
-- 1.1.8. -- 1.1.8.

View File

@ -1,3 +1,4 @@
Success: the process has been started.
SHOW INSTANCES; SHOW INSTANCES;
instance_name state instance_name state
mysqld1 online mysqld1 online
@ -42,7 +43,9 @@ skip-ndbcluster VALUE
nonguarded VALUE nonguarded VALUE
log-output VALUE log-output VALUE
START INSTANCE mysqld2; START INSTANCE mysqld2;
Success: the process has been started.
STOP INSTANCE mysqld2; STOP INSTANCE mysqld2;
Success: the process has been stopped.
SHOW mysqld1 LOG FILES; SHOW mysqld1 LOG FILES;
Logfile Path File size Logfile Path File size
ERROR LOG PATH FILE_SIZE ERROR LOG PATH FILE_SIZE

View File

@ -321,3 +321,35 @@ ERROR 42000: Column 'b' specified twice
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a); INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
ERROR 42000: Column 'b' specified twice ERROR 42000: Column 'b' specified twice
drop table t1; drop table t1;
create table t1 (n int);
create view v1 as select * from t1;
insert delayed into v1 values (1);
ERROR HY000: 'test.v1' is not BASE TABLE
drop table t1;
drop view v1;
create table t1 (id int primary key, data int);
insert into t1 values (1, 1), (2, 2), (3, 3);
select row_count();
row_count()
3
insert ignore into t1 values (1, 1);
select row_count();
row_count()
0
replace into t1 values (1, 11);
select row_count();
row_count()
2
replace into t1 values (4, 4);
select row_count();
row_count()
1
insert into t1 values (2, 2) on duplicate key update data= data + 10;
select row_count();
row_count()
2
insert into t1 values (5, 5) on duplicate key update data= data + 10;
select row_count();
row_count()
1
drop table t1;

View File

@ -747,6 +747,14 @@ select count(id1) from t1 where id2 = 10;
count(id1) count(id1)
5 5
drop table t1; drop table t1;
CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
SELECT * FROM t1;
a b
xxxxxxxxx bbbbbb
xxxxxxxxx bbbbbb
DROP TABLE t1;
set storage_engine=MyISAM; set storage_engine=MyISAM;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
--- Testing varchar --- --- Testing varchar ---

View File

@ -172,7 +172,7 @@ INITIAL_SIZE,
ENGINE ENGINE
FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME; FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
lg1 undofile_lg1_01.dat 1048576 2097152 ndbcluster lg1 undofile_lg1_01.dat 524288 2097152 ndbcluster
lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
SELECT DISTINCT SELECT DISTINCT
TABLESPACE_NAME, TABLESPACE_NAME,

View File

@ -1,4 +1,4 @@
drop table if exists t1; drop table if exists t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL, gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL, benutzer_id int(11) DEFAULT '0' NOT NULL,
@ -31,3 +31,24 @@ SELECT * from t1 ORDER BY i;
i j k i j k
3 1 42 3 1 42
17 2 NULL 17 2 NULL
CREATE TABLE t2 (a INT(11) NOT NULL,
b INT(11) NOT NULL,
c INT(11) NOT NULL,
x TEXT,
y TEXT,
z TEXT,
id INT(10) unsigned NOT NULL AUTO_INCREMENT,
i INT(11) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY a (a,b,c)
) ENGINE=ndbcluster;
REPLACE INTO t2 (a,b,c,x,y,z,i) VALUES (1,1,1,'a','a','a',1),(1,1,1,'b','b','b',2), (1,1,1,'c','c','c',3);
SELECT * FROM t2 ORDER BY id;
a b c x y z id i
1 1 1 c c c 3 3
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'a','a','a',1);
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'b','b','b',2);
SELECT * FROM t2 ORDER BY id;
a b c x y z id i
1 1 1 b b b 5 2
DROP TABLE t2;

View File

@ -132,3 +132,19 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Table_map 2 # table_id: 30 (test.t1)
slave-bin.000001 # Write_rows 2 # table_id: 30 flags: STMT_END_F
select * from t1;
a b
1 1
5 1
6 1
drop table t1;

View File

@ -100,3 +100,19 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Table_map 2 # table_id: 21 (test.t1)
slave-bin.000001 # Write_rows 2 # table_id: 21 flags: STMT_END_F
select * from t1;
a b
1 1
5 1
6 1
drop table t1;

View File

@ -108,3 +108,19 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Table_map 2 # table_id: 21 (test.t1)
slave-bin.000001 # Write_rows 2 # table_id: 21 flags: STMT_END_F
select * from t1;
a b
1 1
5 1
6 1
drop table t1;

View File

@ -169,21 +169,22 @@ select @log;
@log @log
(BEFORE_INSERT: new=(id=1, data=2)) (BEFORE_INSERT: new=(id=1, data=2))
set @log:= ""; set @log:= "";
replace t1 values (1, 3), (2, 2); insert into t1 (id, data) values (1, 3), (2, 2) on duplicate key update data= data + 1;
select @log; select @log;
@log @log
(BEFORE_INSERT: new=(id=1, data=3))(BEFORE_UPDATE: old=(id=1, data=1) new=(id=1, data=3))(AFTER_UPDATE: old=(id=1, data=1) new=(id=1, data=3))(BEFORE_INSERT: new=(id=2, data=2))(AFTER_INSERT: new=(id=2, data=2)) (BEFORE_INSERT: new=(id=1, data=3))(BEFORE_UPDATE: old=(id=1, data=1) new=(id=1, data=2))(AFTER_UPDATE: old=(id=1, data=1) new=(id=1, data=2))(BEFORE_INSERT: new=(id=2, data=2))(AFTER_INSERT: new=(id=2, data=2))
alter table t1 add ts timestamp default now();
set @log:= ""; set @log:= "";
replace t1 (id, data) values (1, 4); replace t1 values (1, 4), (3, 3);
select @log; select @log;
@log @log
(BEFORE_INSERT: new=(id=1, data=4))(BEFORE_DELETE: old=(id=1, data=3))(AFTER_DELETE: old=(id=1, data=3))(AFTER_INSERT: new=(id=1, data=4)) (BEFORE_INSERT: new=(id=1, data=4))(BEFORE_DELETE: old=(id=1, data=2))(AFTER_DELETE: old=(id=1, data=2))(AFTER_INSERT: new=(id=1, data=4))(BEFORE_INSERT: new=(id=3, data=3))(AFTER_INSERT: new=(id=3, data=3))
drop trigger t1_bd;
drop trigger t1_ad;
set @log:= ""; set @log:= "";
insert into t1 (id, data) values (1, 5), (3, 3) on duplicate key update data= data + 2; replace t1 values (1, 5);
select @log; select @log;
@log @log
(BEFORE_INSERT: new=(id=1, data=5))(BEFORE_UPDATE: old=(id=1, data=4) new=(id=1, data=6))(AFTER_UPDATE: old=(id=1, data=4) new=(id=1, data=6))(BEFORE_INSERT: new=(id=3, data=3))(AFTER_INSERT: new=(id=3, data=3)) (BEFORE_INSERT: new=(id=1, data=5))(AFTER_INSERT: new=(id=1, data=5))
drop table t1; drop table t1;
create table t1 (id int primary key, data varchar(10), fk int); create table t1 (id int primary key, data varchar(10), fk int);
create table t2 (event varchar(100)); create table t2 (event varchar(100));
@ -493,15 +494,9 @@ select * from t1;
i k i k
3 13 3 13
replace into t1 values (3, 3); replace into t1 values (3, 3);
ERROR 42S22: Unknown column 'at' in 'NEW'
select * from t1;
i k
3 3
alter table t1 add ts timestamp default now();
replace into t1 (i, k) values (3, 13);
ERROR 42S22: Unknown column 'at' in 'OLD' ERROR 42S22: Unknown column 'at' in 'OLD'
select * from t1; select * from t1;
i k ts i k
drop table t1, t2; drop table t1, t2;
create table t1 (i int, bt int, k int, key(k)) engine=myisam; create table t1 (i int, bt int, k int, key(k)) engine=myisam;
create table t2 (i int); create table t2 (i int);
@ -574,18 +569,11 @@ i k
1 1 1 1
2 2 2 2
replace into t1 values (2, 4); replace into t1 values (2, 4);
ERROR 42S22: Unknown column 'bt' in 'NEW' ERROR 42S22: Unknown column 'bt' in 'OLD'
select * from t1; select * from t1;
i k i k
1 1 1 1
2 2 2 2
alter table t1 add ts timestamp default now();
replace into t1 (i, k) values (2, 11);
ERROR 42S22: Unknown column 'bt' in 'OLD'
select * from t1;
i k ts
1 1 0000-00-00 00:00:00
2 2 0000-00-00 00:00:00
drop table t1, t2; drop table t1, t2;
drop function if exists bug5893; drop function if exists bug5893;
create table t1 (col1 int, col2 int); create table t1 (col1 int, col2 int);

View File

@ -13,9 +13,9 @@
#events_stress : BUG#17619 2006-02-21 andrey Race conditions #events_stress : BUG#17619 2006-02-21 andrey Race conditions
#events : BUG#17619 2006-02-21 andrey Race conditions #events : BUG#17619 2006-02-21 andrey Race conditions
#events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked. #events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked.
im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
#ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown #ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown

View File

@ -221,3 +221,13 @@ drop table t1;
set names latin1; set names latin1;
# End of 4.1 tests # End of 4.1 tests
#
# BUG#19580 - FULLTEXT search produces wrong results on UTF-8 columns
#
SET NAMES utf8;
CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES('„MySQL“');
SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE);
DROP TABLE t1;
SET NAMES latin1;

View File

@ -26,7 +26,7 @@
--echo --echo
--echo --> Printing out line for 'testuser'... --echo --> Printing out line for 'testuser'...
--exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --passwd --username=testuser --password=abc | tail -1 --exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=abc | tail -1
--echo --echo
--echo --> Listing users... --echo --> Listing users...
@ -45,7 +45,7 @@
--echo --echo
--echo --> Printing out line for 'testuser'... --echo --> Printing out line for 'testuser'...
--exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --passwd --username=testuser --password=xyz | tail -1 --exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=xyz | tail -1
--echo --echo
--echo --> Listing users... --echo --> Listing users...

View File

@ -10,9 +10,22 @@
########################################################################### ###########################################################################
# Wait for mysqld1 (guarded instance) to start.
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD1_PATH_PID 30 started
# Let IM detect that mysqld1 is online. This delay should be longer than
# monitoring interval.
--sleep 3 --sleep 3
# should be longer than monitoring interval and enough to start instance.
# Check that start conditions are as expected.
SHOW INSTANCES; SHOW INSTANCES;
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted ###########################################################################
# Kill the IM main process and check that the IM Angel will restart the main
# process.
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30

View File

@ -22,8 +22,16 @@
--echo -- 1.1.1. --echo -- 1.1.1.
--echo -------------------------------------------------------------------- --echo --------------------------------------------------------------------
# Wait for mysqld1 (guarded instance) to start.
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD1_PATH_PID 30 started
# Let IM detect that mysqld1 is online. This delay should be longer than
# monitoring interval.
--sleep 3 --sleep 3
# should be longer than monitoring interval and enough to start instance.
# Check that start conditions are as expected.
SHOW INSTANCES; SHOW INSTANCES;
@ -44,10 +52,12 @@ SHOW INSTANCES;
START INSTANCE mysqld2; START INSTANCE mysqld2;
# FIXME: START INSTANCE should be synchronous. # FIXME: START INSTANCE should be synchronous.
--sleep 3 --exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started
# should be longer than monitoring interval and enough to start instance.
SHOW INSTANCES; # FIXME: SHOW INSTANCES is not deterministic unless START INSTANCE is
# synchronous. Even waiting for mysqld to start by looking at its pid file is
# not enough, because IM may not detect that mysqld has started.
# SHOW INSTANCES;
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD2_PORT,$IM_MYSQLD2_SOCK) --connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD2_PORT,$IM_MYSQLD2_SOCK)
--connection mysql_con --connection mysql_con
@ -74,14 +84,12 @@ SHOW VARIABLES LIKE 'port';
STOP INSTANCE mysqld2; STOP INSTANCE mysqld2;
# FIXME: STOP INSTANCE should be synchronous. # FIXME: STOP INSTANCE should be synchronous.
--sleep 3 --exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped
# should be longer than monitoring interval and enough to stop instance.
SHOW INSTANCES; # FIXME: SHOW INSTANCES is not deterministic unless START INSTANCE is
--replace_column 3 VERSION_NUMBER 4 VERSION # synchronous. Even waiting for mysqld to start by looking at its pid file is
SHOW INSTANCE STATUS mysqld1; # not enough, because IM may not detect that mysqld has started.
--replace_column 3 VERSION_NUMBER 4 VERSION # SHOW INSTANCES;
SHOW INSTANCE STATUS mysqld2;
########################################################################### ###########################################################################
# #
@ -140,10 +148,14 @@ STOP INSTANCE mysqld3;
SHOW INSTANCES; SHOW INSTANCES;
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted --exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30
# Give some time to IM to detect that mysqld was restarted. It should be longer
# than monitoring interval.
--sleep 3 --sleep 3
# should be longer than monitoring interval and enough to start instance.
SHOW INSTANCES;
########################################################################### ###########################################################################
# #
@ -156,18 +168,21 @@ SHOW INSTANCES;
--echo -- 1.1.7. --echo -- 1.1.7.
--echo -------------------------------------------------------------------- --echo --------------------------------------------------------------------
SHOW INSTANCES;
START INSTANCE mysqld2; START INSTANCE mysqld2;
# FIXME: START INSTANCE should be synchronous. # FIXME: START INSTANCE should be synchronous.
--sleep 3 --exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started
# should be longer than monitoring interval and enough to start instance.
SHOW INSTANCES; # FIXME: SHOW INSTANCES is not deterministic unless START INSTANCE is
# synchronous. Even waiting for mysqld to start by looking at its pid file is
# not enough, because IM may not detect that mysqld has started.
# SHOW INSTANCES;
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed --exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10
SHOW INSTANCES; # FIXME: SHOW INSTANCES is not deterministic unless START INSTANCE is
# synchronous. Even waiting for mysqld to start by looking at its pid file is
# not enough, because IM may not detect that mysqld has started.
# SHOW INSTANCES;
########################################################################### ###########################################################################
# #

View File

@ -17,8 +17,16 @@
# - the second instance is offline; # - the second instance is offline;
# #
# Wait for mysqld1 (guarded instance) to start.
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD1_PATH_PID 30 started
# Let IM detect that mysqld1 is online. This delay should be longer than
# monitoring interval.
--sleep 3 --sleep 3
# should be longer than monitoring interval and enough to start instance.
# Check that start conditions are as expected.
SHOW INSTANCES; SHOW INSTANCES;
@ -43,12 +51,10 @@ SHOW INSTANCE OPTIONS mysqld2;
# #
START INSTANCE mysqld2; START INSTANCE mysqld2;
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started
# FIXME: START INSTANCE should be synchronous.
--sleep 3
# should be longer than monitoring interval and enough to start instance.
STOP INSTANCE mysqld2; STOP INSTANCE mysqld2;
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped
# #
# Check 'SHOW LOG FILES' command: # Check 'SHOW LOG FILES' command:

View File

@ -201,3 +201,36 @@ insert into t1 (b,b) select 1,2;
--error 1110 --error 1110
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a); INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
drop table t1; drop table t1;
# Test for INSERT DELAYED INTO a <view>
# BUG#13683: INSERT DELAYED into a view creates an infinite loop
#
create table t1 (n int);
create view v1 as select * from t1;
--error 1347
insert delayed into v1 values (1);
drop table t1;
drop view v1;
#
# Test for values returned by ROW_COUNT() function
# (and thus for values returned by mysql_affected_rows())
# for various forms of INSERT
#
create table t1 (id int primary key, data int);
insert into t1 values (1, 1), (2, 2), (3, 3);
select row_count();
insert ignore into t1 values (1, 1);
select row_count();
# Reports that 2 rows are affected (1 deleted + 1 inserted)
replace into t1 values (1, 11);
select row_count();
replace into t1 values (4, 4);
select row_count();
# Reports that 2 rows are affected. This conforms to documentation.
# (Useful for differentiating inserts from updates).
insert into t1 values (2, 2) on duplicate key update data= data + 10;
select row_count();
insert into t1 values (5, 5) on duplicate key update data= data + 10;
select row_count();
drop table t1;

View File

@ -1,66 +1,115 @@
#!/bin/sh #!/bin/sh
if [ $# -ne 2 ]; then ###########################################################################
echo "Usage: kill_n_check.sh <pid file path> killed|restarted"
# NOTE: this script returns 0 (success) even in case of failure. This is
# because this script is executed under mysql-test-run[.pl] and it's better to
# examine particular problem in log file, than just having said that the test
# case has failed.
###########################################################################
check_restart()
{
if [ ! -r "$pid_path" ]; then
user_msg='the process was killed'
return 1
fi
new_pid=`cat "$pid_path" 2>/dev/null`
if [ $? -eq 0 -a "$original_pid" = "$new_pid" ]; then
user_msg='the process was not restarted'
return 1
fi
user_msg='the process was restarted'
return 0
}
###########################################################################
if [ $# -ne 3 ]; then
echo "Usage: kill_n_check.sh <pid file path> killed|restarted <timeout>"
exit 0 exit 0
fi fi
pid_path="$1" pid_path="$1"
expected_result="$2" expected_result="$2"
total_timeout="$3"
if [ -z "$pid_path" -o ! -r "$pid_path" ]; then if [ "$expected_result" != 'killed' -a \
echo "Error: invalid PID path ($pid_path) or PID file does not exist." "$expected_result" != 'restarted' ]; then
echo "Error: invalid second argument ('killed' or 'restarted' expected)."
exit 0 exit 0
fi fi
if [ "$expected_result" != "killed" -a \ if [ -z "$pid_path" ]; then
"$expected_result" != "restarted" ]; then echo "Error: invalid PID path ($pid_path)."
echo "Error: expected result must be either 'killed' or 'restarted'."
exit 0 exit 0
fi fi
# echo "PID path: '$pid_path'" if [ $expected_result = 'killed' -a ! -r "$pid_path" ]; then
echo "Error: PID file ($pid_path) does not exist."
exit 0
fi
if [ -z "$total_timeout" ]; then
echo "Error: timeout is not specified."
exit 0
fi
###########################################################################
original_pid=`cat "$pid_path"` original_pid=`cat "$pid_path"`
# echo "Original PID: $original_pid"
echo "Killing the process..." echo "Killing the process..."
kill -9 $original_pid kill -9 $original_pid
###########################################################################
echo "Sleeping..." echo "Sleeping..."
sleep 3
new_pid=""
[ -r "$pid_path" ] && new_pid=`cat "$pid_path"`
# echo "New PID: $new_pid"
if [ "$expected_result" = "restarted" ]; then if [ "$expected_result" = "restarted" ]; then
if [ -z "$new_pid" ]; then # Wait for the process to restart.
echo "Error: the process was killed."
exit 0
fi
if [ "$original_pid" -eq "$new_pid" ]; then cur_attempt=1
echo "Error: the process was not restarted."
exit 0 while true; do
fi
if check_restart; then
echo "Success: the process was restarted." echo "Success: $user_msg."
exit 0
fi
[ $cur_attempt -ge $total_timeout ] && break
sleep 1
cur_attempt=`expr $cur_attempt + 1`
done
echo "Error: $user_msg."
exit 0 exit 0
else # $expected_result = killed else # $expected_result == killed
# Here we have to sleep for some long time to ensure that the process will
# not be restarted.
sleep $total_timeout
new_pid=`cat "$pid_path" 2>/dev/null`
if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then
echo "Error: the process was restarted." echo "Error: the process was restarted."
exit 0 else
echo "Success: the process was killed."
fi fi
echo "Success: the process was killed."
exit 0 exit 0
fi fi

View File

@ -697,6 +697,15 @@ select count(*) from t1 where id2 = 10;
select count(id1) from t1 where id2 = 10; select count(id1) from t1 where id2 = 10;
drop table t1; drop table t1;
#
# BUG#18036 - update of table joined to self reports table as crashed
#
CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
SELECT * FROM t1;
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# #
@ -869,4 +878,3 @@ drop table t1;
create table t1 (a int not null, key key_block_size=1024 (a)); create table t1 (a int not null, key key_block_size=1024 (a));
--error 1064 --error 1064
create table t1 (a int not null, key `a` key_block_size=1024 (a)); create table t1 (a int not null, key `a` key_block_size=1024 (a));

View File

@ -6,7 +6,7 @@
# #
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1,t2;
--enable_warnings --enable_warnings
CREATE TABLE t1 ( CREATE TABLE t1 (
@ -27,6 +27,8 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr; select * from t1 order by gesuchnr;
drop table t1; drop table t1;
# End of 4.1 tests
# bug#17431 # bug#17431
CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
j INT, j INT,
@ -38,4 +40,28 @@ REPLACE INTO t1 (j,k) VALUES (1,42);
REPLACE INTO t1 (i,j) VALUES (17,2); REPLACE INTO t1 (i,j) VALUES (17,2);
SELECT * from t1 ORDER BY i; SELECT * from t1 ORDER BY i;
# End of 4.1 tests # bug#19906
CREATE TABLE t2 (a INT(11) NOT NULL,
b INT(11) NOT NULL,
c INT(11) NOT NULL,
x TEXT,
y TEXT,
z TEXT,
id INT(10) unsigned NOT NULL AUTO_INCREMENT,
i INT(11) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY a (a,b,c)
) ENGINE=ndbcluster;
REPLACE INTO t2 (a,b,c,x,y,z,i) VALUES (1,1,1,'a','a','a',1),(1,1,1,'b','b','b',2), (1,1,1,'c','c','c',3);
SELECT * FROM t2 ORDER BY id;
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'a','a','a',1);
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'b','b','b',2);
SELECT * FROM t2 ORDER BY id;
DROP TABLE t2;

View File

@ -185,24 +185,26 @@ select @log;
set @log:= ""; set @log:= "";
insert ignore t1 values (1, 2); insert ignore t1 values (1, 2);
select @log; select @log;
# REPLACE: before insert trigger should be called for both records, # INSERT ... ON DUPLICATE KEY UPDATE ...
# but then for first one update will be executed (and both update
# triggers should fire). For second after insert trigger will be
# called as for usual insert
set @log:= ""; set @log:= "";
replace t1 values (1, 3), (2, 2); insert into t1 (id, data) values (1, 3), (2, 2) on duplicate key update data= data + 1;
select @log; select @log;
# Now let us change table in such way that REPLACE on won't be executed # REPLACE (also test for bug#13479 "REPLACE activates UPDATE trigger,
# using update. # not the DELETE and INSERT triggers")
alter table t1 add ts timestamp default now(); # We define REPLACE as INSERT which DELETEs old rows which conflict with
# row being inserted. So for the first record in statement below we will
# call before insert trigger, then delete will be executed (and both delete
# triggers should fire). Finally after insert trigger will be called.
# For the second record we will just call both on insert triggers.
set @log:= ""; set @log:= "";
# This REPLACE should be executed via DELETE and INSERT so proper replace t1 values (1, 4), (3, 3);
# triggers should be invoked.
replace t1 (id, data) values (1, 4);
select @log; select @log;
# Finally let us test INSERT ... ON DUPLICATE KEY UPDATE ... # Now we will drop ON DELETE triggers to test REPLACE which is internally
# executed via update
drop trigger t1_bd;
drop trigger t1_ad;
set @log:= ""; set @log:= "";
insert into t1 (id, data) values (1, 5), (3, 3) on duplicate key update data= data + 2; replace t1 values (1, 5);
select @log; select @log;
# This also drops associated triggers # This also drops associated triggers
@ -531,14 +533,11 @@ alter table t1 add primary key (i);
--error 1054 --error 1054
insert into t1 values (3, 4) on duplicate key update k= k + 10; insert into t1 values (3, 4) on duplicate key update k= k + 10;
select * from t1; select * from t1;
# The following statement will delete old row and won't
# insert new one since after delete trigger will fail.
--error 1054 --error 1054
replace into t1 values (3, 3); replace into t1 values (3, 3);
select * from t1; select * from t1;
# Change table in such way that REPLACE will delete row
alter table t1 add ts timestamp default now();
--error 1054
replace into t1 (i, k) values (3, 13);
select * from t1;
# Also drops all triggers # Also drops all triggers
drop table t1, t2; drop table t1, t2;
@ -594,11 +593,6 @@ select * from t1;
--error 1054 --error 1054
replace into t1 values (2, 4); replace into t1 values (2, 4);
select * from t1; select * from t1;
# Change table in such way that REPLACE will delete row
alter table t1 add ts timestamp default now();
--error 1054
replace into t1 (i, k) values (2, 11);
select * from t1;
# Also drops all triggers # Also drops all triggers
drop table t1, t2; drop table t1, t2;

View File

@ -0,0 +1,66 @@
#!/bin/sh
###########################################################################
pid_path="$1"
total_attempts="$2"
event="$3"
case "$3" in
started)
check_fn='check_started';
;;
stopped)
check_fn='check_stopped';
;;
*)
echo "Error: invalid third argument ('started' or 'stopped' expected)."
exit 0
esac
###########################################################################
check_started()
{
[ ! -r "$pid_path" ] && return 1
new_pid=`cat "$pid_path" 2>/dev/null`
[ $? -eq 0 -a "$original_pid" = "$new_pid" ] && return 1
return 0
}
###########################################################################
check_stopped()
{
[ -r "$pid_path" ] && return 1
return 0
}
###########################################################################
cur_attempt=1
while true; do
if ( eval $check_fn ); then
echo "Success: the process has been $event."
exit 0
fi
[ $cur_attempt -ge $total_attempts ] && break
sleep 1
cur_attempt=`expr $cur_attempt + 1`
done
echo "Error: the process has not been $event in $total_attempts secs."
exit 0

View File

@ -21,10 +21,6 @@ rm -rf Makefile.in.bk
# run auto tools # run auto tools
. $path/compile-AUTOTOOLS . $path/compile-AUTOTOOLS
# For NetWare there is no comp_err but comp_err.linux
sed -e "s/comp_err\$(EXEEXT)/comp_err.linux/g" extra/Makefile.am > extra/Makefile.am.$$
mv extra/Makefile.am.$$ extra/Makefile.am
# configure # configure
./configure $base_configs $extra_configs ./configure $base_configs $extra_configs

View File

@ -31,7 +31,7 @@ netware_build_files = client/mysql.def client/mysqladmin.def \
client/mysqlshow.def client/mysqltest.def \ client/mysqlshow.def client/mysqltest.def \
client/mysqlslap.def \ client/mysqlslap.def \
sql/mysqld.def extra/mysql_waitpid.def \ sql/mysqld.def extra/mysql_waitpid.def \
extra/mysql_install.def extra/my_print_defaults.def \ extra/my_print_defaults.def \
extra/perror.def extra/replace.def \ extra/perror.def extra/replace.def \
extra/resolveip.def extra/comp_err.def \ extra/resolveip.def extra/comp_err.def \
extra/resolve_stack_dump.def \ extra/resolve_stack_dump.def \
@ -54,7 +54,7 @@ EXTRA_DIST= comp_err.def init_db.sql install_test_db.ncf \
libmysqlmain.c my_manage.c my_manage.h \ libmysqlmain.c my_manage.c my_manage.h \
my_print_defaults.def myisam_ftdump.def myisamchk.def \ my_print_defaults.def myisam_ftdump.def myisamchk.def \
myisamlog.def myisampack.def mysql.def mysql.xdc \ myisamlog.def myisampack.def mysql.def mysql.xdc \
mysql_fix_privilege_tables.pl mysql_install.def \ mysql_fix_privilege_tables.pl \
mysql_install_db.c mysql_install_db.def \ mysql_install_db.c mysql_install_db.def \
mysql_secure_installation.pl mysql_test_run.c \ mysql_secure_installation.pl mysql_test_run.c \
mysql_test_run.def mysql_waitpid.def mysqladmin.def \ mysql_test_run.def mysql_waitpid.def mysqladmin.def \

View File

@ -1,10 +0,0 @@
#------------------------------------------------------------------------------
# My Print Defaults
#------------------------------------------------------------------------------
MODULE libc.nlm
COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Install Tool"
VERSION 4, 0
XDCDATA ../netware/mysql.xdc
#DEBUG

View File

@ -1,11 +1,14 @@
#!/bin/sh #!/bin/sh
# Terminate loudly on error, we don't want partial package
set -e
trap "echo '*** script failed ***'" 0
# #
# Script to create a Windows src package # Script to create a Windows src package
# #
version=@VERSION@ version=@VERSION@
export version
CP="cp -p" CP="cp -p"
DEBUG=0 DEBUG=0
@ -74,7 +77,7 @@ show_usage()
echo " --tmp Specify the temporary location" echo " --tmp Specify the temporary location"
echo " --suffix Suffix name for the package" echo " --suffix Suffix name for the package"
echo " --dirname Directory name to copy files (intermediate)" echo " --dirname Directory name to copy files (intermediate)"
echo " --silent Do not list verbosely files processed" echo " --silent Show no progress information"
echo " --tar Create tar.gz package" echo " --tar Create tar.gz package"
echo " --zip Create zip package" echo " --zip Create zip package"
echo " --help Show this help message" echo " --help Show this help message"
@ -140,10 +143,11 @@ unix_to_dos()
# Create a tmp dest directory to copy files # Create a tmp dest directory to copy files
# #
BASE=$TMP/my_win_dist$SUFFIX BASE=$TMP/my_win_dist$SUFFIX.$$
trap "rm -r -f $BASE; echo '*** interrupted ***'; exit 1" 1 2 3 13 15
if [ -d $BASE ] ; then if [ -d $BASE ] ; then
print_debug "Destination directory '$BASE' already exists, deleting it" echo "WARNING: Destination directory '$BASE' already exists, deleting it"
rm -r -f $BASE rm -r -f $BASE
fi fi
@ -199,7 +203,7 @@ copy_dir_files()
print_debug "Creating directory '$arg'" print_debug "Creating directory '$arg'"
mkdir $BASE/$arg mkdir $BASE/$arg
fi fi
for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp \ for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.yy \
README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \
*.inc *.test *.result *.pem Moscow_leap des_key_file \ *.inc *.test *.result *.pem Moscow_leap des_key_file \
*.vcproj *.sln *.dat *.000001 *.require *.opt *.vcproj *.sln *.dat *.000001 *.require *.opt
@ -252,7 +256,7 @@ copy_dir_dirs() {
for i in client dbug extra storage/heap include storage/archive storage/csv \ for i in client dbug extra storage/heap include storage/archive storage/csv \
include/mysql libmysql libmysqld storage/myisam storage/example \ include/mysql libmysql libmysqld storage/myisam storage/example \
storage/myisammrg mysys regex sql strings sql-common \ storage/myisammrg mysys regex sql strings sql-common \
tools vio zlib vio zlib
do do
copy_dir_files $i copy_dir_files $i
done done
@ -260,7 +264,7 @@ done
# #
# Create project files for ndb # Create project files for ndb
# #
#make -C $SOURCE/storage/ndb windoze #make -C $SOURCE/storage/ndb windoze || true
# #
# Input directories to be copied recursively # Input directories to be copied recursively
@ -334,8 +338,17 @@ done
# Fix some windows files to avoid compiler warnings # Fix some windows files to avoid compiler warnings
# #
./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new if [ -x extra/replace ] ; then
mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | \
sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' \
> $BASE/sql/sql_yacc.cpp-new
mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp
else
if [ "$SILENT" = "0" ] ; then
echo 'WARNING: "extra/replace" not built, can not filter "sql_yacc.ccp"'
echo 'WARNING: to reduce the number of warnings when building'
fi
fi
# #
# Search the tree for plain text files and adapt the line end marker # Search the tree for plain text files and adapt the line end marker
@ -356,19 +369,23 @@ mv $BASE/README $BASE/README.txt
# Clean up if we did this from a bk tree # Clean up if we did this from a bk tree
# #
if [ -d $BASE/SSL/SCCS ] find $BASE -type d \( -name SCCS -o -name .deps -o -name .libs \) -print0 | \
then xargs -0 rm -r -f
find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f
fi
find $BASE/ -type d -name .deps -printf " \"%p\"" | xargs rm -r -f
find $BASE/ -type d -name .libs -printf " \"%p\"" | xargs rm -r -f
rm -r -f "$BASE/mysql-test/var" rm -r -f "$BASE/mysql-test/var"
# #
# Initialize the initial data directory # Initialize the initial data directory
# #
if [ -f scripts/mysql_install_db ]; then if [ ! -f scripts/mysql_install_db ] ; then
if [ "$SILENT" = "0" ] ; then
echo 'WARNING: "scripts/mysql_install_db" is not built, can not initiate databases'
fi
elif [ ! -f extra/my_print_defaults ]; then
if [ "$SILENT" = "0" ] ; then
echo 'WARNING: "extra/my_print_defaults" is not built, can not initiate databases'
fi
else
print_debug "Initializing the 'data' directory" print_debug "Initializing the 'data' directory"
scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data
if test "$?" = 1 if test "$?" = 1
@ -446,21 +463,15 @@ set_tarzip_options()
if [ "$arg" = "tar" ]; then if [ "$arg" = "tar" ]; then
ZIPFILE1=gnutar ZIPFILE1=gnutar
ZIPFILE2=gtar ZIPFILE2=gtar
OPT=cvf OPT=cf
EXT=".tar" EXT=".tar"
NEED_COMPRESS=1 NEED_COMPRESS=1
if [ "$SILENT" = "1" ] ; then
OPT=cf
fi
else else
ZIPFILE1=zip ZIPFILE1=zip
ZIPFILE2="" ZIPFILE2=""
OPT="-r" OPT="-r -q"
EXT=".zip" EXT=".zip"
NEED_COMPRESS=0 NEED_COMPRESS=0
if [ "$SILENT" = "1" ] ; then
OPT="$OPT -q"
fi
fi fi
done done
} }
@ -521,4 +532,7 @@ fi
print_debug "Removing temporary directory" print_debug "Removing temporary directory"
rm -r -f $BASE rm -r -f $BASE
# No need to report anything if we got here
trap "" 0
# End of script # End of script

View File

@ -695,7 +695,7 @@ bool Create_instance::parse_args(const char **text)
if (!option_value_str) if (!option_value_str)
{ {
LEX_STRING empty_str= { C_STRING_WITH_SIZE("") }; LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
if (!(option_value_str= Named_value::alloc_str(&empty_str))) if (!(option_value_str= Named_value::alloc_str(&empty_str)))
return TRUE; /* out of memory during parsing. */ return TRUE; /* out of memory during parsing. */
@ -1511,7 +1511,7 @@ bool Set_option::parse_args(const char **text)
if (!option_value_str) if (!option_value_str)
{ {
LEX_STRING empty_str= { C_STRING_WITH_SIZE("") }; LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
if (!(option_value_str= Named_value::alloc_str(&empty_str))) if (!(option_value_str= Named_value::alloc_str(&empty_str)))
return TRUE; /* out of memory during parsing. */ return TRUE; /* out of memory during parsing. */
@ -1650,7 +1650,7 @@ bool Unset_option::parse_args(const char **text)
return TRUE; /* out of memory during parsing. */ return TRUE; /* out of memory during parsing. */
{ {
LEX_STRING empty_str= { C_STRING_WITH_SIZE("") }; LEX_STRING empty_str= { C_STRING_WITH_LEN("") };
if (!(option_value_str= Named_value::alloc_str(&empty_str))) if (!(option_value_str= Named_value::alloc_str(&empty_str)))
{ {

View File

@ -37,7 +37,7 @@
const LEX_STRING const LEX_STRING
Instance::DFLT_INSTANCE_NAME= { C_STRING_WITH_SIZE("mysqld") }; Instance::DFLT_INSTANCE_NAME= { C_STRING_WITH_LEN("mysqld") };
static const char * const INSTANCE_NAME_PREFIX= Instance::DFLT_INSTANCE_NAME.str; static const char * const INSTANCE_NAME_PREFIX= Instance::DFLT_INSTANCE_NAME.str;
static const int INSTANCE_NAME_PREFIX_LEN= Instance::DFLT_INSTANCE_NAME.length; static const int INSTANCE_NAME_PREFIX_LEN= Instance::DFLT_INSTANCE_NAME.length;

View File

@ -293,7 +293,7 @@ int Instance_map::flush_instances()
get_instance_key, delete_instance, 0); get_instance_key, delete_instance, 0);
rc= load(); rc= load();
guardian->init(); guardian->init(); // TODO: check error status.
return rc; return rc;
} }

View File

@ -120,7 +120,7 @@ int Instance_options::get_default_option(char *result, size_t result_len,
{ {
int rc= 1; int rc= 1;
LEX_STRING verbose_option= LEX_STRING verbose_option=
{ C_STRING_WITH_SIZE(" --no-defaults --verbose --help") }; { C_STRING_WITH_LEN(" --no-defaults --verbose --help") };
/* reserve space for the path + option + final '\0' */ /* reserve space for the path + option + final '\0' */
Buffer cmd(mysqld_path.length + verbose_option.length + 1); Buffer cmd(mysqld_path.length + verbose_option.length + 1);
@ -155,7 +155,7 @@ int Instance_options::fill_instance_version()
{ {
char result[MAX_VERSION_LENGTH]; char result[MAX_VERSION_LENGTH];
LEX_STRING version_option= LEX_STRING version_option=
{ C_STRING_WITH_SIZE(" --no-defaults --version") }; { C_STRING_WITH_LEN(" --no-defaults --version") };
int rc= 1; int rc= 1;
Buffer cmd(mysqld_path.length + version_option.length + 1); Buffer cmd(mysqld_path.length + version_option.length + 1);
@ -210,7 +210,7 @@ int Instance_options::fill_mysqld_real_path()
{ {
char result[FN_REFLEN]; char result[FN_REFLEN];
LEX_STRING help_option= LEX_STRING help_option=
{ C_STRING_WITH_SIZE(" --no-defaults --help") }; { C_STRING_WITH_LEN(" --no-defaults --help") };
int rc= 1; int rc= 1;
Buffer cmd(mysqld_path.length + help_option.length); Buffer cmd(mysqld_path.length + help_option.length);

View File

@ -198,6 +198,25 @@ void manager()
if (create_pid_file(Options::Main::pid_file_name, manager_pid)) if (create_pid_file(Options::Main::pid_file_name, manager_pid))
return; /* necessary logging has been already done. */ return; /* necessary logging has been already done. */
/*
Initialize signals and alarm-infrastructure.
NOTE: To work nicely with LinuxThreads, the signal thread is the first
thread in the process.
NOTE:
After init_thr_alarm() call it's possible to call thr_alarm() (from
different threads), that results in sending ALARM signal to the alarm
thread (which can be the main thread). That signal can interrupt
blocking calls.
In other words, a blocking call can be interrupted in the main thread
after init_thr_alarm().
*/
sigset_t mask;
set_signals(&mask);
/* create guardian thread */ /* create guardian thread */
{ {
pthread_t guardian_thd_id; pthread_t guardian_thd_id;
@ -205,9 +224,16 @@ void manager()
int rc; int rc;
/* /*
NOTE: Guardian should be shutdown first. Only then all other threads NOTE: Guardian should be shutdown first. Only then all other threads
need to be stopped. This should be done, as guardian is responsible for need to be stopped. This should be done, as guardian is responsible
shutting down the instances, and this is a long operation. for shutting down the instances, and this is a long operation.
NOTE: Guardian uses thr_alarm() when detects current state of
instances (is_running()), but it is not interfere with
flush_instances() later in the code, because until flush_instances()
complete in the main thread, Guardian thread is not permitted to
process instances. And before flush_instances() there is no instances
to proceed.
*/ */
pthread_attr_init(&guardian_thd_attr); pthread_attr_init(&guardian_thd_attr);
@ -223,10 +249,8 @@ void manager()
} }
/* /* Load instances. */
To work nicely with LinuxThreads, the signal thread is the first thread
in the process.
*/
{ {
instance_map.guardian->lock(); instance_map.guardian->lock();
@ -246,11 +270,6 @@ void manager()
} }
} }
/* Initialize signals and alarm-infrastructure. */
sigset_t mask;
set_signals(&mask);
/* create the listener */ /* create the listener */
{ {
pthread_t listener_thd_id; pthread_t listener_thd_id;

View File

@ -114,7 +114,6 @@ static const int ANGEL_PID_FILE_SUFFIX_LEN= strlen(ANGEL_PID_FILE_SUFFIX);
*/ */
enum options { enum options {
OPT_PASSWD= 'P',
OPT_USERNAME= 'u', OPT_USERNAME= 'u',
OPT_PASSWORD= 'p', OPT_PASSWORD= 'p',
OPT_LOG= 256, OPT_LOG= 256,
@ -135,6 +134,7 @@ enum options {
OPT_PORT, OPT_PORT,
OPT_WAIT_TIMEOUT, OPT_WAIT_TIMEOUT,
OPT_BIND_ADDRESS, OPT_BIND_ADDRESS,
OPT_PRINT_PASSWORD_LINE,
OPT_ADD_USER, OPT_ADD_USER,
OPT_DROP_USER, OPT_DROP_USER,
OPT_EDIT_USER, OPT_EDIT_USER,
@ -225,8 +225,8 @@ static struct my_option my_long_options[] =
(gptr *) &Options::Main::mysqld_safe_compatible, (gptr *) &Options::Main::mysqld_safe_compatible,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
{ "passwd", OPT_PASSWD, { "print-password-line", OPT_PRINT_PASSWORD_LINE,
"Prepare an entry for the password file and exit.", "Print out a user entry as a line for the password file and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "password", OPT_PASSWORD, "Password to update the password file", { "password", OPT_PASSWORD, "Password to update the password file",
@ -339,7 +339,7 @@ get_one_option(int optid,
case 'V': case 'V':
version(); version();
exit(0); exit(0);
case OPT_PASSWD: case OPT_PRINT_PASSWORD_LINE:
case OPT_ADD_USER: case OPT_ADD_USER:
case OPT_DROP_USER: case OPT_DROP_USER:
case OPT_EDIT_USER: case OPT_EDIT_USER:
@ -354,8 +354,8 @@ get_one_option(int optid,
} }
switch (optid) { switch (optid) {
case OPT_PASSWD: case OPT_PRINT_PASSWORD_LINE:
Options::User_management::cmd= new Passwd_cmd(); Options::User_management::cmd= new Print_password_line_cmd();
break; break;
case OPT_ADD_USER: case OPT_ADD_USER:
Options::User_management::cmd= new Add_user_cmd(); Options::User_management::cmd= new Add_user_cmd();

View File

@ -43,7 +43,7 @@ bool linuxthreads;
The following string must be less then 80 characters, as The following string must be less then 80 characters, as
mysql_connection.cc relies on it mysql_connection.cc relies on it
*/ */
const LEX_STRING mysqlmanager_version= { C_STRING_WITH_SIZE("1.0-beta") }; const LEX_STRING mysqlmanager_version= { C_STRING_WITH_LEN("1.0-beta") };
const unsigned char protocol_version= PROTOCOL_VERSION; const unsigned char protocol_version= PROTOCOL_VERSION;

View File

@ -180,10 +180,10 @@ static int save_password_file(User_map *user_map)
} }
/************************************************************************* /*************************************************************************
Passwd_cmd Print_password_line_cmd
*************************************************************************/ *************************************************************************/
int Passwd_cmd::execute() int Print_password_line_cmd::execute()
{ {
LEX_STRING user_name; LEX_STRING user_name;
const char *password; const char *password;

View File

@ -61,13 +61,14 @@ public:
/************************************************************************* /*************************************************************************
Passwd_cmd: support for --passwd command-line option. Print_password_line_cmd: support for --print-password-line command-line
option.
*************************************************************************/ *************************************************************************/
class Passwd_cmd : public User_management_cmd class Print_password_line_cmd : public User_management_cmd
{ {
public: public:
Passwd_cmd() Print_password_line_cmd()
{ } { }
public: public:

View File

@ -735,7 +735,7 @@ int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg)
ha_ndbcluster *ha= (ha_ndbcluster *)arg; ha_ndbcluster *ha= (ha_ndbcluster *)arg;
int ret= get_ndb_blobs_value(ha->table, ha->m_value, int ret= get_ndb_blobs_value(ha->table, ha->m_value,
ha->m_blobs_buffer, ha->m_blobs_buffer_size, ha->m_blobs_buffer, ha->m_blobs_buffer_size,
0); ha->m_blobs_offset);
DBUG_RETURN(ret); DBUG_RETURN(ret);
} }
@ -864,6 +864,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
if (ndb_blob != NULL) if (ndb_blob != NULL)
{ {
// Set callback // Set callback
m_blobs_offset= buf - (byte*) table->record[0];
void *arg= (void *)this; void *arg= (void *)this;
DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0); DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0);
} }
@ -5477,6 +5478,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
m_ops_pending(0), m_ops_pending(0),
m_skip_auto_increment(TRUE), m_skip_auto_increment(TRUE),
m_blobs_pending(0), m_blobs_pending(0),
m_blobs_offset(0),
m_blobs_buffer(0), m_blobs_buffer(0),
m_blobs_buffer_size(0), m_blobs_buffer_size(0),
m_dupkey((uint) -1), m_dupkey((uint) -1),
@ -10364,7 +10366,7 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // DELETED_ROWS table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS
table->field[c++]->store(lfg.getUndoBufferSize()); // TOTAL_EXTENTS table->field[c++]->store(uf.getSize()/4); // TOTAL_EXTENTS
table->field[c++]->store(4); // EXTENT_SIZE table->field[c++]->store(4); // EXTENT_SIZE
table->field[c++]->store(uf.getSize()); // INITIAL_SIZE table->field[c++]->store(uf.getSize()); // INITIAL_SIZE
@ -10394,8 +10396,8 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->store("NORMAL", 6, system_charset_info); table->field[c++]->store("NORMAL", 6, system_charset_info);
char extra[30]; char extra[100];
int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u",id); int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
table->field[c]->store(extra, len, system_charset_info); table->field[c]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table); schema_table_store_record(thd, table);
} }

View File

@ -798,7 +798,6 @@ private:
int get_ndb_value(NdbOperation*, Field *field, uint fieldnr, byte*); int get_ndb_value(NdbOperation*, Field *field, uint fieldnr, byte*);
int get_ndb_partition_id(NdbOperation *); int get_ndb_partition_id(NdbOperation *);
friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg); friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg);
int get_ndb_blobs_value(NdbBlob *last_ndb_blob);
int set_primary_key(NdbOperation *op, const byte *key); int set_primary_key(NdbOperation *op, const byte *key);
int set_primary_key_from_record(NdbOperation *op, const byte *record); int set_primary_key_from_record(NdbOperation *op, const byte *record);
int set_index_key_from_record(NdbOperation *op, const byte *record, int set_index_key_from_record(NdbOperation *op, const byte *record,
@ -883,6 +882,7 @@ private:
ha_rows m_ops_pending; ha_rows m_ops_pending;
bool m_skip_auto_increment; bool m_skip_auto_increment;
bool m_blobs_pending; bool m_blobs_pending;
my_ptrdiff_t m_blobs_offset;
// memory for blobs in one tuple // memory for blobs in one tuple
char *m_blobs_buffer; char *m_blobs_buffer;
uint32 m_blobs_buffer_size; uint32 m_blobs_buffer_size;

View File

@ -6156,7 +6156,8 @@ The minimum value for this variable is 4096.",
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
(gptr*) &global_system_variables.read_buff_size, (gptr*) &global_system_variables.read_buff_size,
(gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE,
0},
{"read_only", OPT_READONLY, {"read_only", OPT_READONLY,
"Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege", "Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege",
(gptr*) &opt_readonly, (gptr*) &opt_readonly,
@ -6167,12 +6168,12 @@ The minimum value for this variable is 4096.",
(gptr*) &global_system_variables.read_rnd_buff_size, (gptr*) &global_system_variables.read_rnd_buff_size,
(gptr*) &max_system_variables.read_rnd_buff_size, 0, (gptr*) &max_system_variables.read_rnd_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
{"record_buffer", OPT_RECORD_BUFFER, {"record_buffer", OPT_RECORD_BUFFER,
"Alias for read_buffer_size", "Alias for read_buffer_size",
(gptr*) &global_system_variables.read_buff_size, (gptr*) &global_system_variables.read_buff_size,
(gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
{"relay_log_purge", OPT_RELAY_LOG_PURGE, {"relay_log_purge", OPT_RELAY_LOG_PURGE,
"0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.", "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.",

View File

@ -1083,16 +1083,19 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
to convert the latter operation internally to an UPDATE. to convert the latter operation internally to an UPDATE.
We also should not perform this conversion if we have We also should not perform this conversion if we have
timestamp field with ON UPDATE which is different from DEFAULT. timestamp field with ON UPDATE which is different from DEFAULT.
Another case when conversion should not be performed is when
we have ON DELETE trigger on table so user may notice that
we cheat here. Note that it is ok to do such conversion for
tables which have ON UPDATE but have no ON DELETE triggers,
we just should not expose this fact to users by invoking
ON UPDATE triggers.
*/ */
if (last_uniq_key(table,key_nr) && if (last_uniq_key(table,key_nr) &&
!table->file->referenced_by_foreign_key() && !table->file->referenced_by_foreign_key() &&
(table->timestamp_field_type == TIMESTAMP_NO_AUTO_SET || (table->timestamp_field_type == TIMESTAMP_NO_AUTO_SET ||
table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH)) table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH) &&
(!table->triggers || !table->triggers->has_delete_triggers()))
{ {
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_BEFORE, TRUE))
goto before_trg_err;
if (thd->clear_next_insert_id) if (thd->clear_next_insert_id)
{ {
/* Reset auto-increment cacheing if we do an update */ /* Reset auto-increment cacheing if we do an update */
@ -1103,13 +1106,11 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
table->record[0]))) table->record[0])))
goto err; goto err;
info->deleted++; info->deleted++;
trg_error= (table->triggers && /*
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, Since we pretend that we have done insert we should call
TRG_ACTION_AFTER, its after triggers.
TRUE)); */
/* Update logfile and count */ goto after_trg_n_copied_inc;
info->copied++;
goto ok_or_after_trg_err;
} }
else else
{ {
@ -1133,10 +1134,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
} }
} }
} }
info->copied++;
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_INSERT,
TRG_ACTION_AFTER, TRUE));
/* /*
Restore column maps if they where replaced during an duplicate key Restore column maps if they where replaced during an duplicate key
problem. problem.
@ -1151,14 +1148,14 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
(error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)) (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE))
goto err; goto err;
table->file->restore_auto_increment(); table->file->restore_auto_increment();
goto ok_or_after_trg_err;
} }
else
{ after_trg_n_copied_inc:
info->copied++; info->copied++;
trg_error= (table->triggers && trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_INSERT, table->triggers->process_triggers(thd, TRG_EVENT_INSERT,
TRG_ACTION_AFTER, TRUE)); TRG_ACTION_AFTER, TRUE));
}
ok_or_after_trg_err: ok_or_after_trg_err:
if (key) if (key)

View File

@ -438,6 +438,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
uint col_access=thd->col_access; uint col_access=thd->col_access;
#endif #endif
TABLE_LIST table_list; TABLE_LIST table_list;
char tbbuff[FN_REFLEN];
DBUG_ENTER("mysql_find_files"); DBUG_ENTER("mysql_find_files");
if (wild && !wild[0]) if (wild && !wild[0])
@ -454,6 +455,8 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
VOID(tablename_to_filename(tmp_file_prefix, tbbuff, sizeof(tbbuff)));
for (i=0 ; i < (uint) dirp->number_off_files ; i++) for (i=0 ; i < (uint) dirp->number_off_files ; i++)
{ {
char uname[NAME_LEN*3+1]; /* Unencoded name */ char uname[NAME_LEN*3+1]; /* Unencoded name */
@ -491,7 +494,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
{ {
// Return only .frm files which aren't temp files. // Return only .frm files which aren't temp files.
if (my_strcasecmp(system_charset_info, ext=fn_rext(file->name),reg_ext) || if (my_strcasecmp(system_charset_info, ext=fn_rext(file->name),reg_ext) ||
is_prefix(file->name,tmp_file_prefix)) is_prefix(file->name,tbbuff))
continue; continue;
*ext=0; *ext=0;
VOID(filename_to_tablename(file->name, uname, sizeof(uname))); VOID(filename_to_tablename(file->name, uname, sizeof(uname)));

View File

@ -985,7 +985,12 @@ reopen_tables:
} }
} }
} }
/*
Set exclude_from_table_unique_test value back to FALSE. It is needed for
further check in multi_update::prepare whether to use record cache.
*/
lex->select_lex.exclude_from_table_unique_test= FALSE;
if (thd->fill_derived_tables() && if (thd->fill_derived_tables() &&
mysql_handle_derived(lex, &mysql_derived_filling)) mysql_handle_derived(lex, &mysql_derived_filling))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
@ -1164,7 +1169,7 @@ int multi_update::prepare(List<Item> &not_used_values,
for (table_ref= leaves; table_ref; table_ref= table_ref->next_leaf) for (table_ref= leaves; table_ref; table_ref= table_ref->next_leaf)
{ {
TABLE *table=table_ref->table; TABLE *table=table_ref->table;
if (!(tables_to_update & table->map) && if ((tables_to_update & table->map) &&
unique_table(thd, table_ref, update_tables)) unique_table(thd, table_ref, update_tables))
table->no_cache= 1; // Disable row cache table->no_cache= 1; // Disable row cache
} }

View File

@ -111,6 +111,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param) FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
{ {
byte *doc=*start; byte *doc=*start;
int ctype;
uint mwc, length, mbl; uint mwc, length, mbl;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0); param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
@ -119,9 +120,11 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
while (doc<end) while (doc<end)
{ {
for (;doc<end;doc++) for (; doc < end; doc+= (mbl > 0 ? mbl : 1))
{ {
if (true_word_char(cs,*doc)) break; mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
if (*doc == FTB_RQUOT && param->quot) if (*doc == FTB_RQUOT && param->quot)
{ {
param->quot=doc; param->quot=doc;
@ -155,14 +158,16 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
} }
mwc=length=0; mwc=length=0;
for (word->pos=doc; doc<end; length++, mbl=my_mbcharlen(cs, *(uchar *)doc), doc+=(mbl ? mbl : 1)) for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
if (true_word_char(cs,*doc)) {
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
mwc=0; mwc=0;
else if (!misc_word_char(*doc) || mwc) else if (!misc_word_char(*doc) || mwc)
break; break;
else else
mwc++; mwc++;
}
param->prev='A'; /* be sure *prev is true_word_char */ param->prev='A'; /* be sure *prev is true_word_char */
word->len= (uint)(doc-word->pos) - mwc; word->len= (uint)(doc-word->pos) - mwc;
if ((param->trunc=(doc<end && *doc == FTB_TRUNC))) if ((param->trunc=(doc<end && *doc == FTB_TRUNC)))
@ -197,24 +202,31 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
{ {
byte *doc= *start; byte *doc= *start;
uint mwc, length, mbl; uint mwc, length, mbl;
int ctype;
DBUG_ENTER("ft_simple_get_word"); DBUG_ENTER("ft_simple_get_word");
do do
{ {
for (;; doc++) for (;; doc+= (mbl > 0 ? mbl : 1))
{ {
if (doc >= end) DBUG_RETURN(0); if (doc >= end)
if (true_word_char(cs, *doc)) break; DBUG_RETURN(0);
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
} }
mwc= length= 0; mwc= length= 0;
for (word->pos=doc; doc<end; length++, mbl=my_mbcharlen(cs, *(uchar *)doc), doc+=(mbl ? mbl : 1)) for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
if (true_word_char(cs,*doc)) {
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
mwc= 0; mwc= 0;
else if (!misc_word_char(*doc) || mwc) else if (!misc_word_char(*doc) || mwc)
break; break;
else else
mwc++; mwc++;
}
word->len= (uint)(doc-word->pos) - mwc; word->len= (uint)(doc-word->pos) - mwc;

View File

@ -174,11 +174,6 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
FT_SEG_ITERATOR ftsi1, ftsi2; FT_SEG_ITERATOR ftsi1, ftsi2;
CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset; CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset;
DBUG_ENTER("_mi_ft_cmp"); DBUG_ENTER("_mi_ft_cmp");
#ifndef MYSQL_HAS_TRUE_CTYPE_IMPLEMENTATION
if (cs->mbmaxlen > 1)
DBUG_RETURN(THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT);
#endif
_mi_ft_segiterator_init(info, keynr, rec1, &ftsi1); _mi_ft_segiterator_init(info, keynr, rec1, &ftsi1);
_mi_ft_segiterator_init(info, keynr, rec2, &ftsi2); _mi_ft_segiterator_init(info, keynr, rec2, &ftsi2);

View File

@ -24,9 +24,10 @@
#include <queues.h> #include <queues.h>
#include <mysql/plugin.h> #include <mysql/plugin.h>
#define true_word_char(s,X) (my_isalnum(s,X) || (X)=='_') #define true_word_char(ctype, character) \
((ctype) & (_MY_U | _MY_L | _MY_NMR) || \
(character) == '_')
#define misc_word_char(X) 0 #define misc_word_char(X) 0
#define word_char(s,X) (true_word_char(s,X) || misc_word_char(X))
#define FT_MAX_WORD_LEN_FOR_SORT 31 #define FT_MAX_WORD_LEN_FOR_SORT 31

View File

@ -20,7 +20,8 @@ dist-hook:
done done
windoze: windoze:
for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done for i in `find . -name 'old_dirs' -prune -o -name 'Makefile.am' -print`; \
do make -C `dirname $$i` windoze-dsp; done
windoze-dsp: windoze-dsp:

View File

@ -77,6 +77,7 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_SR_RESTARTCONFLICT 2311 #define NDBD_EXIT_SR_RESTARTCONFLICT 2311
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312 #define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313 #define NDBD_EXIT_SR_UNDOLOG 2313
#define NDBD_EXIT_SR_SCHEMAFILE 2310
#define NDBD_EXIT_MEMALLOC 2327 #define NDBD_EXIT_MEMALLOC 2327
#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334 #define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334
#define NDBD_EXIT_TIME_QUEUE_SHORT 2335 #define NDBD_EXIT_TIME_QUEUE_SHORT 2335
@ -91,6 +92,9 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_INVALID_CONFIG 2350 #define NDBD_EXIT_INVALID_CONFIG 2350
#define NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY 2351 #define NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY 2351
/* Errorcodes for fatal resource errors */
#define NDBD_EXIT_RESOURCE_ALLOC_ERROR 2500
#define NDBD_EXIT_OS_SIGNAL_RECEIVED 6000 #define NDBD_EXIT_OS_SIGNAL_RECEIVED 6000
/* VM 6050-> */ /* VM 6050-> */

View File

@ -96,6 +96,7 @@ public:
public: public:
ConfigValuesFactory(Uint32 keys = 50, Uint32 data = 10); // Initial ConfigValuesFactory(Uint32 keys = 50, Uint32 data = 10); // Initial
ConfigValuesFactory(ConfigValues * m_cfg); // ConfigValuesFactory(ConfigValues * m_cfg); //
~ConfigValuesFactory();
ConfigValues * m_cfg; ConfigValues * m_cfg;
ConfigValues * getConfigValues(); ConfigValues * getConfigValues();

View File

@ -1319,7 +1319,7 @@ TransporterRegistry::start_clients_thread()
else else
{ {
ndbout_c("Management server closed connection early. " ndbout_c("Management server closed connection early. "
"It is probably being shut down (or has crashed). " "It is probably being shut down (or has problems). "
"We will retry the connection."); "We will retry the connection.");
} }
} }

View File

@ -294,6 +294,12 @@ ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
} }
} }
ConfigValuesFactory::~ConfigValuesFactory()
{
if(m_cfg)
free(m_cfg);
}
ConfigValues * ConfigValues *
ConfigValuesFactory::create(Uint32 keys, Uint32 data){ ConfigValuesFactory::create(Uint32 keys, Uint32 data){
Uint32 sz = sizeof(ConfigValues); Uint32 sz = sizeof(ConfigValues);
@ -528,7 +534,7 @@ ConfigValuesFactory::extractCurrentSection(const ConfigValues::ConstIterator & c
} }
} }
ConfigValues * ret = fac->m_cfg; ConfigValues * ret = fac->getConfigValues();
delete fac; delete fac;
return ret; return ret;
} }

View File

@ -1355,10 +1355,11 @@ void Dbdict::readSchemaConf(Signal* signal,
sf->FileSize == sf0->FileSize && sf->FileSize == sf0->FileSize &&
sf->PageNumber == n && sf->PageNumber == n &&
computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0; computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0;
ndbrequire(ok || !crashInd); ndbrequireErr(ok || !crashInd, NDBD_EXIT_SR_SCHEMAFILE);
if (! ok) { if (! ok) {
jam(); jam();
ndbrequire(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1); ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
NDBD_EXIT_SR_SCHEMAFILE);
readSchemaRef(signal, fsPtr); readSchemaRef(signal, fsPtr);
return; return;
} }

View File

@ -8606,7 +8606,7 @@ Dbdih::resetReplicaSr(TabRecordPtr tabPtr){
*--------_----------------------------------------------------- */ *--------_----------------------------------------------------- */
const Uint32 nextCrashed = noCrashedReplicas + 1; const Uint32 nextCrashed = noCrashedReplicas + 1;
replicaPtr.p->noCrashedReplicas = nextCrashed; replicaPtr.p->noCrashedReplicas = nextCrashed;
arrGuard(nextCrashed, 8); arrGuardErr(nextCrashed, 8, NDBD_EXIT_MAX_CRASHED_REPLICAS);
replicaPtr.p->createGci[nextCrashed] = newestRestorableGCI + 1; replicaPtr.p->createGci[nextCrashed] = newestRestorableGCI + 1;
ndbrequire(newestRestorableGCI + 1 != 0xF1F1F1F1); ndbrequire(newestRestorableGCI + 1 != 0xF1F1F1F1);
replicaPtr.p->replicaLastGci[nextCrashed] = (Uint32)-1; replicaPtr.p->replicaLastGci[nextCrashed] = (Uint32)-1;

View File

@ -17839,7 +17839,8 @@ void Dblqh::stepAhead(Signal* signal, Uint32 stepAheadWords)
logFilePtr.p->currentLogpage = logPagePtr.p->logPageWord[ZNEXT_PAGE]; logFilePtr.p->currentLogpage = logPagePtr.p->logPageWord[ZNEXT_PAGE];
logPagePtr.i = logPagePtr.p->logPageWord[ZNEXT_PAGE]; logPagePtr.i = logPagePtr.p->logPageWord[ZNEXT_PAGE];
logFilePtr.p->currentFilepage++; logFilePtr.p->currentFilepage++;
ptrCheckGuard(logPagePtr, clogPageFileSize, logPageRecord); ptrCheckGuardErr(logPagePtr, clogPageFileSize, logPageRecord,
NDBD_EXIT_SR_REDOLOG);
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = ZPAGE_HEADER_SIZE; logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = ZPAGE_HEADER_SIZE;
logPartPtr.p->execSrPagesRead--; logPartPtr.p->execSrPagesRead--;
logPartPtr.p->execSrPagesExecuted++; logPartPtr.p->execSrPagesExecuted++;

View File

@ -410,7 +410,22 @@ Suma::createSequenceReply(Signal* signal,
jam(); jam();
if (ref != NULL) if (ref != NULL)
{
switch ((UtilSequenceRef::ErrorCode)ref->errorCode)
{
case UtilSequenceRef::NoSuchSequence:
ndbrequire(false);
case UtilSequenceRef::TCError:
{
char buf[128];
snprintf(buf, sizeof(buf),
"Startup failed during sequence creation. TC error %d",
ref->TCErrorCode);
progError(__LINE__, NDBD_EXIT_RESOURCE_ALLOC_ERROR, buf);
}
}
ndbrequire(false); ndbrequire(false);
}
sendSTTORRY(signal); sendSTTORRY(signal);
} }

View File

@ -51,14 +51,16 @@ static const ErrStruct errArray[] =
{NDBD_EXIT_SYSTEM_ERROR, XIE, {NDBD_EXIT_SYSTEM_ERROR, XIE,
"System error, node killed during node restart by other node"}, "System error, node killed during node restart by other node"},
{NDBD_EXIT_INDEX_NOTINRANGE, XIE, "Array index out of range"}, {NDBD_EXIT_INDEX_NOTINRANGE, XIE, "Array index out of range"},
{NDBD_EXIT_ARBIT_SHUTDOWN, XAE, "Arbitrator shutdown, " {NDBD_EXIT_ARBIT_SHUTDOWN, XAE, "Node lost connection to other nodes and "
"please investigate error(s) on other node(s)"}, "can not form a unpartitioned cluster, please investigate if there are "
"error(s) on other node(s)"},
{NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"}, {NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"},
{NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system " {NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system "
"restart, please investigate error(s) on other node(s)"}, "restart, please investigate error(s) on other node(s)"},
{NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, " {NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, "
"most probably resolved by restarting node again"}, "most probably resolved by restarting node again"},
{NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"}, {NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"},
{NDBD_EXIT_SR_SCHEMAFILE, XFI, "Error while reading the schema file"},
/* Currently unused? */ /* Currently unused? */
{2311, XIE, "Conflict when selecting restart type"}, {2311, XIE, "Conflict when selecting restart type"},
{NDBD_EXIT_NO_MORE_UNDOLOG, XCR, {NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
@ -80,6 +82,10 @@ static const ErrStruct errArray[] =
/* this error message is complemented by additional info when generated */ /* this error message is complemented by additional info when generated */
{NDBD_EXIT_INVALID_CONFIG, XCE, {NDBD_EXIT_INVALID_CONFIG, XCE,
"Invalid configuration received from Management Server"}, "Invalid configuration received from Management Server"},
{NDBD_EXIT_RESOURCE_ALLOC_ERROR, XCE,
"Resource allocation error, please review the configuration"},
/* this error message is complemented by additional info when /* this error message is complemented by additional info when
generated, such as signal, and text generated, such as signal, and text
*/ */
@ -94,7 +100,7 @@ static const ErrStruct errArray[] =
{NDBD_EXIT_WATCHDOG_TERMINATE, XIE, "WatchDog terminate, internal error " {NDBD_EXIT_WATCHDOG_TERMINATE, XIE, "WatchDog terminate, internal error "
"or massive overload on the machine running this node"}, "or massive overload on the machine running this node"},
{NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, XCR, {NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, XCR,
"Signal lost, out of send buffer memory, please increase SendBufferMemory"}, "Signal lost, out of send buffer memory, please increase SendBufferMemory or lower the load"},
{NDBD_EXIT_SIGNAL_LOST, XIE, "Signal lost (unknown reason)"}, {NDBD_EXIT_SIGNAL_LOST, XIE, "Signal lost (unknown reason)"},
{NDBD_EXIT_ILLEGAL_SIGNAL, XIE, {NDBD_EXIT_ILLEGAL_SIGNAL, XIE,
"Illegal signal (version mismatch a possibility)"}, "Illegal signal (version mismatch a possibility)"},

View File

@ -1924,7 +1924,7 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
} }
delete prop; delete prop;
return (ndb_mgm_configuration*)cvf.m_cfg; return (ndb_mgm_configuration*)cvf.getConfigValues();
} while(0); } while(0);
delete prop; delete prop;

View File

@ -2289,11 +2289,11 @@ ConfigInfo::ConfigInfo()
if (!m_info.getCopy(param._section, &section)) { if (!m_info.getCopy(param._section, &section)) {
Properties newsection(true); Properties newsection(true);
m_info.put(param._section, &newsection); m_info.put(param._section, &newsection);
// Get copy of section
m_info.getCopy(param._section, &section);
} }
// Get copy of section
m_info.getCopy(param._section, &section);
// Create pinfo (parameter info) entry // Create pinfo (parameter info) entry
Properties pinfo(true); Properties pinfo(true);
pinfo.put("Id", param._paramId); pinfo.put("Id", param._paramId);
@ -2347,6 +2347,7 @@ ConfigInfo::ConfigInfo()
// Replace section with modified section // Replace section with modified section
m_info.put(param._section, section, true); m_info.put(param._section, section, true);
delete section;
if(param._type != ConfigInfo::CI_SECTION){ if(param._type != ConfigInfo::CI_SECTION){
Properties * p; Properties * p;

View File

@ -284,6 +284,7 @@ ErrorBundle ErrorCodes[] = {
/** /**
* Application error * Application error
*/ */
{ 763, DMEC, AE, "Alter table requires cluster nodes to have exact same version" },
{ 823, DMEC, AE, "Too much attrinfo from application in tuple manager" }, { 823, DMEC, AE, "Too much attrinfo from application in tuple manager" },
{ 831, DMEC, AE, "Too many nullable/bitfields in table definition" }, { 831, DMEC, AE, "Too many nullable/bitfields in table definition" },
{ 876, DMEC, AE, "876" }, { 876, DMEC, AE, "876" },
@ -344,6 +345,7 @@ ErrorBundle ErrorCodes[] = {
/** /**
* SchemaError * SchemaError
*/ */
{ 311, DMEC, AE, "Undefined partition used in setPartitionId" },
{ 703, DMEC, SE, "Invalid table format" }, { 703, DMEC, SE, "Invalid table format" },
{ 704, DMEC, SE, "Attribute name too long" }, { 704, DMEC, SE, "Attribute name too long" },
{ 705, DMEC, SE, "Table name too long" }, { 705, DMEC, SE, "Table name too long" },

View File

@ -221,7 +221,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--prefix=/ \ --prefix=/ \
--with-extra-charsets=all \ --with-extra-charsets=all \
%if %{YASSL_BUILD} %if %{YASSL_BUILD}
--with-yassl \ --with-ssl \
%endif %endif
--exec-prefix=%{_exec_prefix} \ --exec-prefix=%{_exec_prefix} \
--libexecdir=%{_sbindir} \ --libexecdir=%{_sbindir} \
@ -235,6 +235,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--enable-thread-safe-client \ --enable-thread-safe-client \
--with-readline \ --with-readline \
" "
make
} }
# Use our own copy of glibc # Use our own copy of glibc
@ -350,6 +351,7 @@ BuildMySQL "--enable-shared \
--with-example-storage-engine \ --with-example-storage-engine \
--with-blackhole-storage-engine \ --with-blackhole-storage-engine \
--with-federated-storage-engine \ --with-federated-storage-engine \
--with-embedded-server \
--with-big-tables \ --with-big-tables \
--with-comment=\"MySQL Community Server (GPL)\"") --with-comment=\"MySQL Community Server (GPL)\"")
@ -389,10 +391,10 @@ install -d $RBR%{_sbindir}
mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/ mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/
# install "mysqld-debug" and "mysqld-max" # install "mysqld-debug" and "mysqld-max"
./libtool --mode=execute install -m 755 \ $MBD/libtool --mode=execute install -m 755 \
$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld \ $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld \
$RBR%{_sbindir}/mysqld-debug $RBR%{_sbindir}/mysqld-debug
./libtool --mode=execute install -m 755 \ $MBD/libtool --mode=execute install -m 755 \
$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-max-%{mysql_version}/sql/mysqld \ $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-max-%{mysql_version}/sql/mysqld \
$RBR%{_sbindir}/mysqld-max $RBR%{_sbindir}/mysqld-max
@ -404,16 +406,12 @@ install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.
install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
# Install embedded server library in the build root # Install embedded server library in the build root
install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ install -m 644 $MBD/libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
# Create a symlink "rcmysql", pointing to the init.script. SuSE users # Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this. # will appreciate that, as all services usually offer this.
ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
# Create symbolic compatibility link safe_mysqld -> mysqld_safe
# (safe_mysqld will be gone in MySQL 4.1)
ln -sf ./mysqld_safe $RBR%{_bindir}/safe_mysqld
# Touch the place where the my.cnf config file and mysqlmanager.passwd # Touch the place where the my.cnf config file and mysqlmanager.passwd
# (MySQL Instance Manager password file) might be located # (MySQL Instance Manager password file) might be located
# Just to make sure it's in the file list and marked as a config file # Just to make sure it's in the file list and marked as a config file
@ -480,7 +478,7 @@ chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally. # Restart in the same way that mysqld will be started normally.
%{_sysconfdir}/init.d/mysql start %{_sysconfdir}/init.d/mysql start
# Allow safe_mysqld to start mysqld and print a message before we exit # Allow mysqld_safe to start mysqld and print a message before we exit
sleep 2 sleep 2
@ -542,7 +540,6 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1* %doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1* %doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%doc %attr(644, root, man) %{_mandir}/man1/safe_mysqld.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
%ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd %ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd
@ -571,7 +568,6 @@ fi
%attr(755, root, root) %{_bindir}/replace %attr(755, root, root) %{_bindir}/replace
%attr(755, root, root) %{_bindir}/resolve_stack_dump %attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/resolveip %attr(755, root, root) %{_bindir}/resolveip
%attr(755, root, root) %{_bindir}/safe_mysqld
%attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqld-debug