Commit 7dacf466 authored by unknown's avatar unknown

Portability fixes (mostly test suite)

Make ENGINE= an alias for TYPE= (Compabiltiy with 4.1)
Fix when using symlinked data files and realpath() is not working


client/mysqltest.c:
  Copied mysqltest from 4.1 and modified this to compile in 4.0
  This was needed to get replace_columns to work.
include/my_sys.h:
  Stop compiler warnings about alloca on freebsd
myisam/mi_check.c:
  Fix when using symlinked data files and realpath() is not working
mysql-test/r/handler.result:
  test engine=
mysql-test/r/rpl_max_relay_size.result:
  Use replace_columns to replace some 'not constant' columns
mysql-test/r/rpl_rotate_logs.result:
  Use replace_columns to replace some 'not constant' columns
mysql-test/r/rpl_trunc_binlog.result:
  Use replace_columns to replace some 'not constant' columns
mysql-test/t/handler.test:
  test engine=
mysql-test/t/rpl_log_pos.test:
  Use replace_columns to replace some 'not constant' columns
mysql-test/t/rpl_max_relay_size.test:
  Use replace_columns to replace some 'not constant' columns
mysql-test/t/rpl_rotate_logs.test:
  Use replace_columns to replace some 'not constant' columns
mysql-test/t/rpl_trunc_binlog.test:
  Use replace_columns to replace some 'not constant' columns
mysys/my_symlink.c:
  More debugging
sql/lex.h:
  Make ENGINE= an alias for TYPE=
sql/mysqld.cc:
  Code cleanup
strings/strto.c:
  Fix for True64
strings/strtoll.c:
  Fix for True64
strings/strtoull.c:
  Remove not needed include file
parent ffe376cd
This diff is collapsed.
...@@ -167,7 +167,7 @@ extern char *my_strdup_with_length(const byte *from, uint length, ...@@ -167,7 +167,7 @@ extern char *my_strdup_with_length(const byte *from, uint length,
#if defined(_AIX) && !defined(__GNUC__) #if defined(_AIX) && !defined(__GNUC__)
#pragma alloca #pragma alloca
#endif /* _AIX */ #endif /* _AIX */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca #define alloca __builtin_alloca
#endif /* GNUC */ #endif /* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ)) #define my_alloca(SZ) alloca((size_t) (SZ))
......
...@@ -1188,9 +1188,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, ...@@ -1188,9 +1188,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename, if ((new_file=my_raid_create(fn_format(param->temp_filename,
param->temp_filename,"", share->data_file_name, "",
DATA_TMP_EXT, 2+4), DATA_TMP_EXT, 2+4),
0,param->tmpfile_createflag, 0,param->tmpfile_createflag,
share->base.raid_type, share->base.raid_type,
...@@ -1861,11 +1860,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, ...@@ -1861,11 +1860,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename, if ((new_file=my_raid_create(fn_format(param->temp_filename,
param->temp_filename, "", share->data_file_name, "",
DATA_TMP_EXT, DATA_TMP_EXT, 2+4),
2+4),
0,param->tmpfile_createflag, 0,param->tmpfile_createflag,
share->base.raid_type, share->base.raid_type,
share->base.raid_chunks, share->base.raid_chunks,
...@@ -2225,9 +2222,8 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -2225,9 +2222,8 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename, if ((new_file=my_raid_create(fn_format(param->temp_filename,
param->temp_filename, "", share->data_file_name, "",
DATA_TMP_EXT, DATA_TMP_EXT,
2+4), 2+4),
0,param->tmpfile_createflag, 0,param->tmpfile_createflag,
......
...@@ -142,7 +142,7 @@ insert into t1 values (17); ...@@ -142,7 +142,7 @@ insert into t1 values (17);
handler t2 read first; handler t2 read first;
Unknown table 't2' in HANDLER Unknown table 't2' in HANDLER
handler t1 open as t2; handler t1 open as t2;
alter table t1 type=MyISAM; alter table t1 engine=MyISAM;
handler t2 read first; handler t2 read first;
Unknown table 't2' in HANDLER Unknown table 't2' in HANDLER
drop table t1; drop table t1;
......
...@@ -26,7 +26,7 @@ select @@global.max_relay_log_size; ...@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave; start slave;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.004 9457 master-bin.001 Yes Yes 0 0 50477 9457 127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.004 9457 master-bin.001 Yes Yes 0 0 50477 #
stop slave; stop slave;
reset slave; reset slave;
set global max_relay_log_size=0; set global max_relay_log_size=0;
......
...@@ -16,13 +16,12 @@ create table t1 (s text); ...@@ -16,13 +16,12 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 60 master-bin.001 417 slave-relay-bin.001 458 master-bin.001 Yes Yes 0 0 417 458 127.0.0.1 root MASTER_PORT 60 master-bin.001 417 slave-relay-bin.001 458 master-bin.001 Yes Yes 0 0 417 #
select * from t1; select * from t1;
s s
Could not break slave Could not break slave
Tried hard Tried hard
flush logs; flush logs;
drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
...@@ -48,7 +47,7 @@ master-bin.003 ...@@ -48,7 +47,7 @@ master-bin.003
insert into t2 values (65); insert into t2 values (65);
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 60 master-bin.003 290 slave-relay-bin.001 1073 master-bin.003 Yes Yes 0 0 290 1073 127.0.0.1 root MASTER_PORT 60 master-bin.003 290 slave-relay-bin.001 1073 master-bin.003 Yes Yes 0 0 290 #
select * from t2; select * from t2;
m m
34 34
...@@ -58,8 +57,10 @@ m ...@@ -58,8 +57,10 @@ m
1234 1234
create temporary table temp_table (a char(80) not null); create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2"); insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3;
create table t3 (n int); create table t3 (n int);
select count(*) from t3 where n >= 4;
count(*)
100
create table t4 select * from temp_table; create table t4 select * from temp_table;
show master logs; show master logs;
Log_name Log_name
...@@ -73,7 +74,7 @@ a ...@@ -73,7 +74,7 @@ a
testing temporary tables part 2 testing temporary tables part 2
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 60 master-bin.004 2886 slave-relay-bin.001 7870 master-bin.004 Yes Yes 0 0 2886 7870 127.0.0.1 root MASTER_PORT 60 master-bin.004 2886 slave-relay-bin.001 7870 master-bin.004 Yes Yes 0 0 2886 #
lock tables t3 read; lock tables t3 read;
select count(*) from t3 where n >= 4; select count(*) from t3 where n >= 4;
count(*) count(*)
......
...@@ -10,4 +10,4 @@ reset slave; ...@@ -10,4 +10,4 @@ reset slave;
start slave; start slave;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.002 4 slave-relay-bin.002 161 master-bin.001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. Probably cause is that the master died while writing the transaction to it's binary log. 0 79 317 127.0.0.1 root MASTER_PORT 1 master-bin.002 4 slave-relay-bin.002 161 master-bin.001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. Probably cause is that the master died while writing the transaction to it's binary log. 0 79 #
...@@ -75,7 +75,7 @@ insert into t1 values (17); ...@@ -75,7 +75,7 @@ insert into t1 values (17);
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
handler t1 open as t2; handler t1 open as t2;
alter table t1 type=MyISAM; alter table t1 engine=MyISAM;
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
drop table t1; drop table t1;
......
...@@ -23,9 +23,9 @@ sleep 5; ...@@ -23,9 +23,9 @@ sleep 5;
show slave status; show slave status;
slave stop; slave stop;
change master to master_log_pos=173; change master to master_log_pos=173;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
slave start; slave start;
sleep 2; sleep 2;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
connection master; connection master;
show master status; show master status;
......
...@@ -37,6 +37,7 @@ select @@global.max_relay_log_size; ...@@ -37,6 +37,7 @@ select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_column 18 #
show slave status; show slave status;
stop slave; stop slave;
reset slave; reset slave;
......
...@@ -50,11 +50,11 @@ save_master_pos; ...@@ -50,11 +50,11 @@ save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_column 18 #
show slave status; show slave status;
select * from t1; select * from t1;
connection master; connection master;
flush logs; flush logs;
drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
...@@ -102,6 +102,7 @@ save_master_pos; ...@@ -102,6 +102,7 @@ save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_column 18 #
show slave status; show slave status;
select * from t2; select * from t2;
...@@ -113,7 +114,7 @@ connection master; ...@@ -113,7 +114,7 @@ connection master;
create temporary table temp_table (a char(80) not null); create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2"); insert into temp_table values ("testing temporary tables part 2");
let $1=100; let $1=100;
drop table if exists t3;
create table t3 (n int); create table t3 (n int);
disable_query_log; disable_query_log;
while ($1) while ($1)
...@@ -123,17 +124,17 @@ while ($1) ...@@ -123,17 +124,17 @@ while ($1)
dec $1; dec $1;
} }
enable_query_log; enable_query_log;
select count(*) from t3 where n >= 4;
create table t4 select * from temp_table; create table t4 select * from temp_table;
show master logs; show master logs;
show master status; show master status;
save_master_pos; save_master_pos;
connection slave; connection slave;
#slave stop;
#slave start;
sync_with_master; sync_with_master;
select * from t4; select * from t4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_column 18 #
show slave status; show slave status;
# because of concurrent insert, the table may not be up to date # because of concurrent insert, the table may not be up to date
# if we do not lock # if we do not lock
......
...@@ -21,4 +21,5 @@ start slave; ...@@ -21,4 +21,5 @@ start slave;
# can't sync_with_master so we must sleep # can't sync_with_master so we must sleep
sleep 3; sleep 3;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 18 #
show slave status; show slave status;
...@@ -72,6 +72,7 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags) ...@@ -72,6 +72,7 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags)
#else #else
int result; int result;
DBUG_ENTER("my_symlink"); DBUG_ENTER("my_symlink");
DBUG_PRINT("enter",("content: %s linkname: %s", content, linkname));
result= 0; result= 0;
if (symlink(content, linkname)) if (symlink(content, linkname))
......
...@@ -131,6 +131,7 @@ static SYMBOL symbols[] = { ...@@ -131,6 +131,7 @@ static SYMBOL symbols[] = {
{ "DYNAMIC", SYM(DYNAMIC_SYM),0,0}, { "DYNAMIC", SYM(DYNAMIC_SYM),0,0},
{ "END", SYM(END),0,0}, { "END", SYM(END),0,0},
{ "ELSE", SYM(ELSE),0,0}, { "ELSE", SYM(ELSE),0,0},
{ "ENGINE", SYM(TYPE_SYM),0,0}, /* Alias for TYPE= */
{ "ESCAPE", SYM(ESCAPE_SYM),0,0}, { "ESCAPE", SYM(ESCAPE_SYM),0,0},
{ "ESCAPED", SYM(ESCAPED),0,0}, { "ESCAPED", SYM(ESCAPED),0,0},
{ "ENABLE", SYM(ENABLE_SYM),0,0}, { "ENABLE", SYM(ENABLE_SYM),0,0},
......
...@@ -2593,8 +2593,8 @@ int main(int argc, char **argv) ...@@ -2593,8 +2593,8 @@ int main(int argc, char **argv)
{ {
char file_path[FN_REFLEN]; char file_path[FN_REFLEN];
my_path(file_path, argv[0], ""); /* Find name in path */ my_path(file_path, argv[0], ""); /* Find name in path */
fn_format(file_path,argv[0],file_path,"",MY_REPLACE_DIR+ fn_format(file_path,argv[0],file_path,"",
MY_UNPACK_FILENAME | MY_RESOLVE_SYMLINKS); MY_REPLACE_DIR | MY_UNPACK_FILENAME | MY_RESOLVE_SYMLINKS);
if (argc == 2) if (argc == 2)
{ {
if (!default_service_handling(argv, MYSQL_SERVICENAME, MYSQL_SERVICENAME, if (!default_service_handling(argv, MYSQL_SERVICENAME, MYSQL_SERVICENAME,
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
it can be compiled with the UNSIGNED and/or LONGLONG flag set it can be compiled with the UNSIGNED and/or LONGLONG flag set
*/ */
#define strtoll glob_strtoll /* Fix for True64 */
#include <my_global.h> #include <my_global.h>
#include "m_string.h" #include "m_string.h"
#include "m_ctype.h" #include "m_ctype.h"
......
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
/* This is defines strtoll() if neaded */ /* This is defines strtoll() if neaded */
#define strtoll glob_strtoll /* Fix for True64 */
#include <my_global.h> #include <my_global.h>
#include <m_string.h>
#if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) #if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
#define USE_LONGLONG #define USE_LONGLONG
#include "strto.c" #include "strto.c"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
/* This is defines strtoull() */ /* This is defines strtoull() */
#include <my_global.h> #include <my_global.h>
#include <m_string.h>
#if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG) #if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG)
#define USE_UNSIGNED #define USE_UNSIGNED
#define USE_LONGLONG #define USE_LONGLONG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment