Commit 21d4d7ec authored by unknown's avatar unknown

Merge paul@bk-internal.mysql.com:/home/bk/mysql-5.0

into kite-hub.kitebird.com:/src/extern/MySQL/bk/mysql-5.0

parents 4bf86d9e 8c71efbc
...@@ -73,7 +73,7 @@ LINK32=xilink6.exe ...@@ -73,7 +73,7 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "SAFEMALLOC" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /X /Fr # SUBTRACT CPP /X /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
......
...@@ -330,6 +330,16 @@ static sig_handler mysql_end(int sig); ...@@ -330,6 +330,16 @@ static sig_handler mysql_end(int sig);
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
char buff[80]; char buff[80];
char *defaults, *extra_defaults;
char *emb_argv[3];
int emb_argc= 1;
emb_argv[0]= argv[0];
get_defaults_files(argc, argv, &defaults, &extra_defaults);
if (defaults)
emb_argv[emb_argc++]= defaults;
if (extra_defaults)
emb_argv[emb_argc++]= extra_defaults;
MY_INIT(argv[0]); MY_INIT(argv[0]);
DBUG_ENTER("main"); DBUG_ENTER("main");
...@@ -375,7 +385,7 @@ int main(int argc,char *argv[]) ...@@ -375,7 +385,7 @@ int main(int argc,char *argv[])
my_end(0); my_end(0);
exit(1); exit(1);
} }
if (mysql_server_init(0, NULL, (char**) server_default_groups)) if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups))
{ {
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(0); my_end(0);
......
...@@ -769,6 +769,8 @@ extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, ...@@ -769,6 +769,8 @@ extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
extern char *strdup_root(MEM_ROOT *root,const char *str); extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
extern void get_defaults_files(int argc, char **argv,
char **defaults, char **extra_defaults);
extern int load_defaults(const char *conf_file, const char **groups, extern int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv); int *argc, char ***argv);
extern int process_default_option_files(const char *conf_file, extern int process_default_option_files(const char *conf_file,
......
...@@ -219,12 +219,13 @@ static my_bool emb_mysql_read_query_result(MYSQL *mysql) ...@@ -219,12 +219,13 @@ static my_bool emb_mysql_read_query_result(MYSQL *mysql)
static int emb_stmt_execute(MYSQL_STMT *stmt) static int emb_stmt_execute(MYSQL_STMT *stmt)
{ {
DBUG_ENTER("emb_stmt_execute"); DBUG_ENTER("emb_stmt_execute");
char header[4];
int4store(header, stmt->stmt_id);
THD *thd= (THD*)stmt->mysql->thd; THD *thd= (THD*)stmt->mysql->thd;
thd->client_param_count= stmt->param_count; thd->client_param_count= stmt->param_count;
thd->client_params= stmt->params; thd->client_params= stmt->params;
if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0, if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
(const char*)&stmt->stmt_id,sizeof(stmt->stmt_id), header, sizeof(header), 1) ||
1) ||
emb_mysql_read_query_result(stmt->mysql)) emb_mysql_read_query_result(stmt->mysql))
{ {
NET *net= &stmt->mysql->net; NET *net= &stmt->mysql->net;
......
...@@ -143,6 +143,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, ...@@ -143,6 +143,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
db ? db : "(Null)", db ? db : "(Null)",
user ? user : "(Null)")); user ? user : "(Null)"));
if (!host || !host[0])
host= mysql->options.host;
if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION || if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION ||
(mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION && (mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION &&
host && *host && strcmp(host,LOCAL_HOST))) host && *host && strcmp(host,LOCAL_HOST)))
......
...@@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM ...@@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
[ndbd] [ndbd]
HostName= CHOOSE_HOSTNAME_1 HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
[ndbd] [ndbd]
HostName= CHOOSE_HOSTNAME_2 HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
[ndb_mgmd] [ndb_mgmd]
DataDir= CHOOSE_FILESYSTEM DataDir= CHOOSE_FILESYSTEM #
PortNumber= CHOOSE_PORT_MGM PortNumber= CHOOSE_PORT_MGM
[mysqld] [mysqld]
......
...@@ -817,3 +817,15 @@ drop table t1; ...@@ -817,3 +817,15 @@ drop table t1;
select 'c' like '\_' as want0; select 'c' like '\_' as want0;
want0 want0
0 0
create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci);
insert into t1 values (1, 'Test');
select * from t1 where soundex(a) = soundex('Test');
id a
1 Test
select * from t1 where soundex(a) = soundex('TEST');
id a
1 Test
select * from t1 where soundex(a) = soundex('test');
id a
1 Test
drop table t1;
...@@ -70,7 +70,7 @@ def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 ...@@ -70,7 +70,7 @@ def test t9 t9 c18 c18 1 4 1 Y 32768 0 63
def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
def test t9 t9 c20 c20 254 1 1 Y 0 0 8 def test t9 t9 c20 c20 254 1 1 Y 0 0 8
def test t9 t9 c21 c21 254 10 10 Y 0 0 8 def test t9 t9 c21 c21 254 10 10 Y 0 0 8
def test t9 t9 c22 c22 254 30 30 Y 0 0 8 def test t9 t9 c22 c22 253 30 30 Y 0 0 8
def test t9 t9 c23 c23 252 255 8 Y 144 0 63 def test t9 t9 c23 c23 252 255 8 Y 144 0 63
def test t9 t9 c24 c24 252 255 8 Y 16 0 8 def test t9 t9 c24 c24 252 255 8 Y 16 0 8
def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
...@@ -1691,8 +1691,8 @@ affected rows: 3 ...@@ -1691,8 +1691,8 @@ affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0 info: Records: 3 Duplicates: 0 Warnings: 0
select a,b from t2 order by a ; select a,b from t2 order by a ;
a b a b
3 duplicate 3 duplicate
4 duplicate 4 duplicate
103 three 103 three
delete from t2 ; delete from t2 ;
prepare stmt1 from ' insert into t2 (b,a) prepare stmt1 from ' insert into t2 (b,a)
...@@ -1710,8 +1710,8 @@ affected rows: 3 ...@@ -1710,8 +1710,8 @@ affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0 info: Records: 3 Duplicates: 0 Warnings: 0
select a,b from t2 order by a ; select a,b from t2 order by a ;
a b a b
3 duplicate 3 duplicate
4 duplicate 4 duplicate
103 three 103 three
drop table t2; drop table t2;
drop table if exists t5 ; drop table if exists t5 ;
...@@ -1926,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8 ...@@ -1926,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63 def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8
def @arg32 253 8192 6 Y 128 31 63 def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
...@@ -2023,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8 ...@@ -2023,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63 def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8
def @arg32 253 8192 6 Y 128 31 63 def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ; set @my_key= 0 ;
...@@ -2111,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8 ...@@ -2111,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63 def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8
def @arg32 253 8192 6 Y 128 31 63 def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
...@@ -2201,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8 ...@@ -2201,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63 def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8
def @arg32 253 8192 6 Y 128 31 63 def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ; set @my_key= 0 ;
......
...@@ -818,6 +818,8 @@ ERROR 01000: Data truncated for column 'col1' at row 1 ...@@ -818,6 +818,8 @@ ERROR 01000: Data truncated for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('hellobob'); INSERT INTO t1 (col2) VALUES ('hellobob');
ERROR 01000: Data truncated for column 'col2' at row 1 ERROR 01000: Data truncated for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES ('hello '); INSERT INTO t1 (col2) VALUES ('hello ');
Warnings:
Note 1265 Data truncated for column 'col2' at row 1
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
ERROR 01000: Data truncated for column 'col1' at row 2 ERROR 01000: Data truncated for column 'col1' at row 2
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
......
...@@ -666,3 +666,12 @@ drop table t1; ...@@ -666,3 +666,12 @@ drop table t1;
# #
select 'c' like '\_' as want0; select 'c' like '\_' as want0;
#
# Bug #7730 Server crash using soundex on an utf8 table
#
create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci);
insert into t1 values (1, 'Test');
select * from t1 where soundex(a) = soundex('Test');
select * from t1 where soundex(a) = soundex('TEST');
select * from t1 where soundex(a) = soundex('test');
drop table t1;
...@@ -569,7 +569,6 @@ INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); ...@@ -569,7 +569,6 @@ INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
INSERT INTO t1 (col1) VALUES ('hellobob'); INSERT INTO t1 (col1) VALUES ('hellobob');
--error 1265 --error 1265
INSERT INTO t1 (col2) VALUES ('hellobob'); INSERT INTO t1 (col2) VALUES ('hellobob');
--error 1265
INSERT INTO t1 (col2) VALUES ('hello '); INSERT INTO t1 (col2) VALUES ('hello ');
--error 1265 --error 1265
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
......
...@@ -112,20 +112,14 @@ static int search_files(const char *conf_file, int *argc, char ***argv, ...@@ -112,20 +112,14 @@ static int search_files(const char *conf_file, int *argc, char ***argv,
DBUG_ENTER("search_files"); DBUG_ENTER("search_files");
/* Check if we want to force the use a specific default file */ /* Check if we want to force the use a specific default file */
forced_default_file= 0; get_defaults_files(*argc, *argv,
if (*argc >= 2) (char **)&forced_default_file, &defaults_extra_file);
{ if (forced_default_file)
if (is_prefix(argv[0][1],"--defaults-file=")) forced_default_file= strchr(forced_default_file,'=')+1;
{ if (defaults_extra_file)
forced_default_file= strchr(argv[0][1],'=') + 1; defaults_extra_file= strchr(defaults_extra_file,'=')+1;
(*args_used)++;
} args_used+= (forced_default_file ? 1 : 0) + (defaults_extra_file ? 1 : 0);
else if (is_prefix(argv[0][1],"--defaults-extra-file="))
{
defaults_extra_file= strchr(argv[0][1],'=') + 1;
(*args_used)++;
}
}
if (forced_default_file) if (forced_default_file)
{ {
...@@ -261,6 +255,36 @@ static int handle_default_option(void *in_ctx, const char *group_name, ...@@ -261,6 +255,36 @@ static int handle_default_option(void *in_ctx, const char *group_name,
} }
/*
Gets --defaults-file and --defaults-extra-file options from command line.
SYNOPSIS
get_defaults_files()
argc Pointer to argc of original program
argv Pointer to argv of original program
defaults --defaults-file option
extra_defaults --defaults-extra-file option
RETURN
defaults and extra_defaults will be set to appropriate items
of argv array, or to NULL if there are no such options
*/
void get_defaults_files(int argc, char **argv,
char **defaults, char **extra_defaults)
{
*defaults=0;
*extra_defaults=0;
if (argc >= 2)
{
if (is_prefix(argv[1],"--defaults-file="))
*defaults= argv[1];
else if (is_prefix(argv[1],"--defaults-extra-file="))
*extra_defaults= argv[1];
}
}
/* /*
Read options from configurations files Read options from configurations files
......
...@@ -992,7 +992,11 @@ Backup::execUTIL_SEQUENCE_CONF(Signal* signal) ...@@ -992,7 +992,11 @@ Backup::execUTIL_SEQUENCE_CONF(Signal* signal)
}//if }//if
ndbrequire(ptr.p->masterData.state.getState() == DEFINING); ndbrequire(ptr.p->masterData.state.getState() == DEFINING);
ptr.p->backupId = conf->sequenceValue[0]; {
Uint64 backupId;
memcpy(&backupId,conf->sequenceValue,8);
ptr.p->backupId= (Uint32)backupId;
}
ptr.p->backupKey[0] = (getOwnNodeId() << 16) | (ptr.p->backupId & 0xFFFF); ptr.p->backupKey[0] = (getOwnNodeId() << 16) | (ptr.p->backupId & 0xFFFF);
ptr.p->backupKey[1] = NdbTick_CurrentMillisecond(); ptr.p->backupKey[1] = NdbTick_CurrentMillisecond();
......
...@@ -27,6 +27,14 @@ ...@@ -27,6 +27,14 @@
#include <NdbThread.h> #include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp> #include <signaldata/FsOpenReq.hpp>
// use this to test broken pread code
//#define HAVE_BROKEN_PREAD
#ifdef HAVE_BROKEN_PREAD
#undef HAVE_PWRITE
#undef HAVE_PREAD
#endif
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
#else #else
// For readv and writev // For readv and writev
...@@ -379,9 +387,12 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ ...@@ -379,9 +387,12 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){
if(dwSFP != offset) { if(dwSFP != offset) {
return GetLastError(); return GetLastError();
} }
#elif defined NDB_OSE || defined NDB_SOFTOSE #elif ! defined(HAVE_PREAD)
return_value = lseek(theFd, offset, SEEK_SET); off_t seek_val;
if (return_value != offset) { while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1
&& errno == EINTR);
if(seek_val == (off_t)-1)
{
return errno; return errno;
} }
#endif #endif
...@@ -400,10 +411,10 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ ...@@ -400,10 +411,10 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){
return GetLastError(); return GetLastError();
} }
bytes_read = dwBytesRead; bytes_read = dwBytesRead;
#elif defined NDB_OSE || defined NDB_SOFTOSE #elif ! defined(HAVE_PREAD)
return_value = ::read(theFd, buf, size); return_value = ::read(theFd, buf, size);
#else // UNIX #else // UNIX
return_value = my_pread(theFd, buf, size, offset,0); return_value = ::pread(theFd, buf, size, offset);
#endif #endif
#ifndef NDB_WIN32 #ifndef NDB_WIN32
if (return_value == -1 && errno == EINTR) { if (return_value == -1 && errno == EINTR) {
...@@ -453,7 +464,7 @@ AsyncFile::readReq( Request * request) ...@@ -453,7 +464,7 @@ AsyncFile::readReq( Request * request)
void void
AsyncFile::readvReq( Request * request) AsyncFile::readvReq( Request * request)
{ {
#if defined NDB_OSE || defined NDB_SOFTOSE #if ! defined(HAVE_PREAD)
readReq(request); readReq(request);
return; return;
#elif defined NDB_WIN32 #elif defined NDB_WIN32
...@@ -483,7 +494,7 @@ AsyncFile::readvReq( Request * request) ...@@ -483,7 +494,7 @@ AsyncFile::readvReq( Request * request)
int int
AsyncFile::extendfile(Request* request) { AsyncFile::extendfile(Request* request) {
#if defined NDB_OSE || defined NDB_SOFTOSE #if ! defined(HAVE_PWRITE)
// Find max size of this file in this request // Find max size of this file in this request
int maxOffset = 0; int maxOffset = 0;
int maxSize = 0; int maxSize = 0;
...@@ -592,27 +603,13 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, ...@@ -592,27 +603,13 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset,
if(dwSFP != offset) { if(dwSFP != offset) {
return GetLastError(); return GetLastError();
} }
#elif defined NDB_OSE || defined NDB_SOFTOSE #elif ! defined(HAVE_PWRITE)
return_value = lseek(theFd, offset, SEEK_SET); off_t seek_val;
if (return_value != offset) { while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1
DEBUG(ndbout_c("AsyncFile::writeReq, err1: return_value=%d, offset=%d\n", && errno == EINTR);
return_value, chunk_offset)); if(seek_val == (off_t)-1)
PRINT_ERRORANDFLAGS(0); {
if (errno == 78) { return errno;
// Could not write beyond end of file, try to extend file
DEBUG(ndbout_c("AsyncFile::writeReq, Extend. file! filename=\"%s\" \n",
theFileName.c_str()));
return_value = extendfile(request);
if (return_value == -1) {
return errno;
}
return_value = lseek(theFd, offset, SEEK_SET);
if (return_value != offset) {
return errno;
}
} else {
return errno;
}
} }
#endif #endif
...@@ -634,10 +631,10 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, ...@@ -634,10 +631,10 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset,
DEBUG(ndbout_c("Warning partial write %d != %d", bytes_written, bytes_to_write)); DEBUG(ndbout_c("Warning partial write %d != %d", bytes_written, bytes_to_write));
} }
#elif defined NDB_OSE || defined NDB_SOFTOSE #elif ! defined(HAVE_PWRITE)
return_value = ::write(theFd, buf, bytes_to_write); return_value = ::write(theFd, buf, bytes_to_write);
#else // UNIX #else // UNIX
return_value = my_pwrite(theFd, buf, bytes_to_write, offset, 0); return_value = ::pwrite(theFd, buf, bytes_to_write, offset);
#endif #endif
#ifndef NDB_WIN32 #ifndef NDB_WIN32
if (return_value == -1 && errno == EINTR) { if (return_value == -1 && errno == EINTR) {
......
...@@ -824,7 +824,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) ...@@ -824,7 +824,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal)
return; return;
} }
Uint32 subId = conf->sequenceValue[0]; Uint64 subId;
memcpy(&subId,conf->sequenceValue,8);
Uint32 subData = conf->senderData; Uint32 subData = conf->senderData;
SubscriberPtr subbPtr; SubscriberPtr subbPtr;
...@@ -832,8 +833,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) ...@@ -832,8 +833,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal)
CreateSubscriptionIdConf * subconf = (CreateSubscriptionIdConf*)conf; CreateSubscriptionIdConf * subconf = (CreateSubscriptionIdConf*)conf;
subconf->subscriptionId = subId; subconf->subscriptionId = (Uint32)subId;
subconf->subscriptionKey =(getOwnNodeId() << 16) | (subId & 0xFFFF); subconf->subscriptionKey =(getOwnNodeId() << 16) | (Uint32)(subId & 0xFFFF);
subconf->subscriberData = subbPtr.p->m_senderData; subconf->subscriberData = subbPtr.p->m_senderData;
sendSignal(subbPtr.p->m_subscriberRef, GSN_CREATE_SUBID_CONF, signal, sendSignal(subbPtr.p->m_subscriberRef, GSN_CREATE_SUBID_CONF, signal,
......
...@@ -228,13 +228,21 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) ...@@ -228,13 +228,21 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line)
Vector<BaseString> tmp_string_split; Vector<BaseString> tmp_string_split;
if (BaseString(line).split(tmp_string_split, if (BaseString(line).split(tmp_string_split,
BaseString("=:"), "=:", 2) != 2)
2) != 2)
{ {
ctx.reportError("Parse error"); ctx.reportError("Parse error");
return false; return false;
} }
// *************************************
// Remove all after #
// *************************************
Vector<BaseString> tmp_string_split2;
tmp_string_split[1].split(tmp_string_split2,
"#", 2);
tmp_string_split[1]=tmp_string_split2[0];
// ************************************* // *************************************
// Remove leading and trailing chars // Remove leading and trailing chars
// ************************************* // *************************************
......
This diff is collapsed.
...@@ -1578,9 +1578,14 @@ void Item_func_soundex::fix_length_and_dec() ...@@ -1578,9 +1578,14 @@ void Item_func_soundex::fix_length_and_dec()
else return 0 else return 0
*/ */
static char get_scode(CHARSET_INFO *cs,char *ptr) static char soundex_toupper(char ch)
{ {
uchar ch=my_toupper(cs,*ptr); return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch;
}
static char get_scode(char *ptr)
{
uchar ch= soundex_toupper(*ptr);
if (ch < 'A' || ch > 'Z') if (ch < 'A' || ch > 'Z')
{ {
// Thread extended alfa (country spec) // Thread extended alfa (country spec)
...@@ -1610,8 +1615,8 @@ String *Item_func_soundex::val_str(String *str) ...@@ -1610,8 +1615,8 @@ String *Item_func_soundex::val_str(String *str)
from++; /* purecov: inspected */ from++; /* purecov: inspected */
if (from == end) if (from == end)
return &my_empty_string; // No alpha characters. return &my_empty_string; // No alpha characters.
*to++ = my_toupper(cs,*from); // Copy first letter *to++ = soundex_toupper(*from); // Copy first letter
last_ch = get_scode(cs,from); // code of the first letter last_ch = get_scode(from); // code of the first letter
// for the first 'double-letter check. // for the first 'double-letter check.
// Loop on input letters until // Loop on input letters until
// end of input (null) or output // end of input (null) or output
...@@ -1620,7 +1625,7 @@ String *Item_func_soundex::val_str(String *str) ...@@ -1620,7 +1625,7 @@ String *Item_func_soundex::val_str(String *str)
{ {
if (!my_isalpha(cs,*from)) if (!my_isalpha(cs,*from))
continue; continue;
ch=get_scode(cs,from); ch=get_scode(from);
if ((ch != '0') && (ch != last_ch)) // if not skipped or double if ((ch != '0') && (ch != last_ch)) // if not skipped or double
{ {
*to++ = ch; // letter, copy to output *to++ = ch; // letter, copy to output
......
...@@ -292,7 +292,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -292,7 +292,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
error=0; error=0;
id=0; id=0;
thd->proc_info="update"; thd->proc_info="update";
if (duplic != DUP_ERROR) if (duplic != DUP_ERROR || ignore)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
/* /*
let's *try* to start bulk inserts. It won't necessary let's *try* to start bulk inserts. It won't necessary
...@@ -471,7 +471,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -471,7 +471,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table->next_number_field=0; table->next_number_field=0;
thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->count_cuted_fields= CHECK_FIELD_IGNORE;
thd->next_insert_id=0; // Reset this if wrongly used thd->next_insert_id=0; // Reset this if wrongly used
if (duplic != DUP_ERROR) if (duplic != DUP_ERROR || ignore)
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
/* Reset value of LAST_INSERT_ID if no rows where inserted */ /* Reset value of LAST_INSERT_ID if no rows where inserted */
...@@ -1606,7 +1606,7 @@ bool delayed_insert::handle_inserts(void) ...@@ -1606,7 +1606,7 @@ bool delayed_insert::handle_inserts(void)
info.ignore= row->ignore; info.ignore= row->ignore;
info.handle_duplicates= row->dup; info.handle_duplicates= row->dup;
if (info.ignore || if (info.ignore ||
info.handle_duplicates == DUP_REPLACE) info.handle_duplicates != DUP_ERROR)
{ {
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
using_ignore=1; using_ignore=1;
...@@ -1806,7 +1806,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -1806,7 +1806,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
restore_record(table,s->default_values); // Get empty record restore_record(table,s->default_values); // Get empty record
table->next_number_field=table->found_next_number_field; table->next_number_field=table->found_next_number_field;
thd->cuted_fields=0; thd->cuted_fields=0;
if (info.ignore || info.handle_duplicates == DUP_REPLACE) if (info.ignore || info.handle_duplicates != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
table->file->start_bulk_insert((ha_rows) 0); table->file->start_bulk_insert((ha_rows) 0);
thd->no_trans_update= 0; thd->no_trans_update= 0;
...@@ -2008,7 +2008,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -2008,7 +2008,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
restore_record(table,s->default_values); // Get empty record restore_record(table,s->default_values); // Get empty record
thd->cuted_fields=0; thd->cuted_fields=0;
if (info.ignore || info.handle_duplicates == DUP_REPLACE) if (info.ignore || info.handle_duplicates != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
table->file->start_bulk_insert((ha_rows) 0); table->file->start_bulk_insert((ha_rows) 0);
thd->no_trans_update= 0; thd->no_trans_update= 0;
......
...@@ -147,7 +147,7 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) ...@@ -147,7 +147,7 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match)
uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs)
{ {
int find,pos,findpos; int find,pos;
const char *j; const char *j;
DBUG_ENTER("find_type2"); DBUG_ENTER("find_type2");
DBUG_PRINT("enter",("x: '%.*s' lib: 0x%lx", length, x, typelib)); DBUG_PRINT("enter",("x: '%.*s' lib: 0x%lx", length, x, typelib));
...@@ -157,7 +157,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) ...@@ -157,7 +157,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs)
DBUG_PRINT("exit",("no count")); DBUG_PRINT("exit",("no count"));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
LINT_INIT(findpos);
for (find=0, pos=0 ; (j=typelib->type_names[pos]) ; pos++) for (find=0, pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{ {
if (!my_strnncoll(cs, (const uchar*) x, length, if (!my_strnncoll(cs, (const uchar*) x, length,
......
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