mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
After merge fixes
Added more DBUG statements Ensure that we are comparing end space with BINARY strings Use 'any_db' instead of '' to mean any database. (For HANDLER command) Only strip ' ' when comparing CHAR, not other space-like characters (like \t) BitKeeper/deleted/.del-ctype_tis620.result-old~3578ceb0b8284685: Delete: mysql-test/r/ctype_tis620.result-old BitKeeper/deleted/.del-ctype_tis620.test-old~ffb1bbd2935d1aba: Delete: mysql-test/t/ctype_tis620.test-old client/mysqlbinlog.cc: Added DBUG statements Added call of my_end() to free all used memory on exit heap/hp_info.c: After merge fixes heap/hp_open.c: After merge fixes include/heap.h: After merge fixes include/m_ctype.h: Use pchar instead of 'int' for character parameters. Added 'my_binary_compare()' include/m_string.h: Fixed wrong define innobase/ibuf/ibuf0ibuf.c: After merge fixes innobase/srv/srv0start.c: After merge fixes mysql-test/r/alter_table.result: Fixed results after merge mysql-test/r/auto_increment.result: Fixed results after merge mysql-test/r/bdb.result: Fixed results after merge mysql-test/r/binary.result: Fixed results after merge mysql-test/r/create.result: Fixed results after merge mysql-test/r/ctype_mb.result: Fixed results after merge mysql-test/r/ctype_tis620.result: Fixed results after merge mysql-test/r/ctype_utf8.result: Fixed results after merge mysql-test/r/delete.result: Fixed results after merge mysql-test/r/func_compress.result: Fixed results after merge mysql-test/r/func_gconcat.result: Fixed results after merge mysql-test/r/func_group.result: Fixed results after merge mysql-test/r/func_str.result: Fixed results after merge mysql-test/r/innodb.result: Fixed results after merge mysql-test/r/insert.result: Fixed results after merge mysql-test/r/insert_select.result: Fixed results after merge mysql-test/r/key.result: Fixed results after merge mysql-test/r/loaddata.result: Fixed results after merge mysql-test/r/lock.result: Fixed results after merge mysql-test/r/myisam.result: Fixed results after merge mysql-test/r/null.result: Fixed results after merge mysql-test/r/null_key.result: Fixed results after merge mysql-test/r/order_by.result: Fixed results after merge mysql-test/r/query_cache.result: Fixed results after merge mysql-test/r/range.result: Fixed results after merge mysql-test/r/rpl_multi_delete.result: Fixed results after merge mysql-test/r/rpl_until.result: Fixed results after merge mysql-test/r/subselect.result: Fixed results after merge mysql-test/r/subselect_innodb.result: Fixed results after merge mysql-test/r/type_blob.result: Fixed results after merge mysql-test/r/type_datetime.result: Fixed results after merge mysql-test/r/type_decimal.result: Fixed results after merge mysql-test/r/type_enum.result: Fixed results after merge mysql-test/r/type_float.result: Fixed results after merge mysql-test/r/type_ranges.result: Fixed results after merge mysql-test/r/type_time.result: Fixed results after merge mysql-test/r/type_timestamp.result: Fixed results after merge mysql-test/r/type_uint.result: Fixed results after merge mysql-test/r/type_year.result: Fixed results after merge mysql-test/r/variables.result: Fixed results after merge mysql-test/r/warnings.result: Fixed results after merge mysql-test/t/case.test: Fixed shifted error messages mysql-test/t/create.test: Fixed shifted error messages mysql-test/t/ctype_collate.test: Fixed shifted error messages mysql-test/t/ctype_tis620.test: Merge with 4.0 ctype_tis620 test mysql-test/t/delete.test: Fixed shifted error messages mysql-test/t/derived.test: Fixed shifted error messages mysql-test/t/fulltext.test: Fixed shifted error messages mysql-test/t/func_in.test: Fixed shifted error messages mysql-test/t/func_str.test: Fixed shifted error messages mysql-test/t/func_test.test: Fixed shifted error messages mysql-test/t/grant.test: Fixed shifted error messages mysql-test/t/innodb.test: Change to 4.1 syntax mysql-test/t/key_cache.test: Fixed shifted error messages mysql-test/t/myisam.test: New test of blob and end space mysql-test/t/row.test: Fixed shifted error messages mysql-test/t/rpl_until.test: Fixed shifted error messages mysql-test/t/subselect.test: Fixed shifted error messages mysql-test/t/subselect_innodb.test: Fix test to take into account foreign key constraints mysql-test/t/union.test: Fixed shifted error messages mysql-test/t/user_var.test: Fixed shifted error messages mysql-test/t/variables.test: Fixed shifted error messages mysys/my_handler.c: Merge with 4.0 code sql/ha_heap.cc: After merge fixes sql/handler.cc: After merge fixes sql/item.cc: After merge fixes sql/item_cmpfunc.cc: Ensure that we are comparing end space with BINARY strings sql/item_cmpfunc.h: Ensure that we are comparing end space with BINARY strings sql/log_event.cc: More DBUG statements Ensure that we use all options to LOAD DATA in replication sql/opt_range.cc: After merge fixes sql/sql_db.cc: After merge fixes sql/sql_handler.cc: After merge fixes Use 'any_db' instead of '' to mean 'no database comparison' sql/sql_parse.cc: After merge fixes sql/sql_select.cc: After merge fixes Added function comment for setup_group() sql/sql_string.cc: Added stringcmp() for binary comparison. Added function comments for sortcmp() and stringcmp() sql/sql_string.h: Added stringcmp() sql/sql_table.cc: After merge fixes sql/sql_update.cc: After merge fixes sql/sql_yacc.yy: Use 'any_db' instead of '' to mean any database. Using "" causes a 'wrong db name' error. strings/ctype-big5.c: Strip only end space, not other space characters. strings/ctype-bin.c: Removed some not needed functions. Added function comments Don't remove end space in comparisons Change my_wildcmp_bin() to be 'identical' with other similar code strings/ctype-czech.c: Strip only end space, not other space characters. strings/ctype-gbk.c: Strip only end space, not other space characters. strings/ctype-latin1.c: Strip only end space, not other space characters. strings/ctype-mb.c: Strip only end space, not other space characters. strings/ctype-simple.c: Strip only end space, not other space characters. strings/ctype-sjis.c: Strip only end space, not other space characters. strings/ctype-tis620.c: Added usage of my_instr_simple. This needs to be cleaned up! strings/ctype-utf8.c: Strip only end space, not other space characters. strings/ctype-win1250ch.c: Strip only end space, not other space characters. Fixed indentation strings/strto.c: Code cleanup
This commit is contained in:
@@ -233,15 +233,16 @@ int Load_log_processor::process(Create_file_log_event *ce)
|
||||
int error= 0;
|
||||
char *fname, *ptr;
|
||||
File file;
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
|
||||
if (set_dynamic(&file_names,(gptr)&ce,ce->file_id))
|
||||
{
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name,bname);
|
||||
return -1;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (!(fname= my_malloc(full_len,MYF(MY_WME))))
|
||||
return -1;
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
memcpy(fname, target_dir_name, target_dir_name_len);
|
||||
ptr= fname + target_dir_name_len;
|
||||
@@ -253,20 +254,21 @@ int Load_log_processor::process(Create_file_log_event *ce)
|
||||
{
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name,bname);
|
||||
return -1;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
ce->set_fname_outside_temp_buf(fname,strlen(fname));
|
||||
|
||||
if (my_write(file,(byte*) ce->block,ce->block_len,MYF(MY_WME|MY_NABP)))
|
||||
error= -1;
|
||||
if (my_close(file,MYF(MY_WME)))
|
||||
if (my_close(file, MYF(MY_WME)))
|
||||
error= -1;
|
||||
return error;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Append_block_log_event *ae)
|
||||
{
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
Create_file_log_event* ce= ((ae->file_id < file_names.elements) ?
|
||||
*((Create_file_log_event**)file_names.buffer +
|
||||
ae->file_id) :
|
||||
@@ -278,12 +280,12 @@ int Load_log_processor::process(Append_block_log_event *ae)
|
||||
int error= 0;
|
||||
if (((file= my_open(ce->fname,
|
||||
O_APPEND|O_BINARY|O_WRONLY,MYF(MY_WME))) < 0))
|
||||
return -1;
|
||||
DBUG_RETURN(-1);
|
||||
if (my_write(file,(byte*)ae->block,ae->block_len,MYF(MY_WME|MY_NABP)))
|
||||
error= -1;
|
||||
if (my_close(file,MYF(MY_WME)))
|
||||
error= -1;
|
||||
return error;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -293,7 +295,7 @@ int Load_log_processor::process(Append_block_log_event *ae)
|
||||
*/
|
||||
fprintf(stderr,"Warning: ignoring Append_block as there is no \
|
||||
Create_file event for file_id: %u\n",ae->file_id);
|
||||
return -1;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -304,6 +306,8 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
|
||||
my_off_t pos, int old_format)
|
||||
{
|
||||
char ll_buff[21];
|
||||
DBUG_ENTER("process_event");
|
||||
|
||||
if ((*rec_count) >= offset)
|
||||
{
|
||||
if (!short_form)
|
||||
@@ -315,11 +319,7 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
|
||||
{
|
||||
const char * log_dbname = ((Query_log_event*)ev)->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
{
|
||||
(*rec_count)++;
|
||||
delete ev;
|
||||
return 0; // Time for next event
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
ev->print(result_file, short_form, last_db);
|
||||
break;
|
||||
@@ -336,11 +336,7 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
|
||||
*/
|
||||
const char * log_dbname = ce->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
{
|
||||
(*rec_count)++;
|
||||
delete ev;
|
||||
return 0; // next
|
||||
}
|
||||
goto end; // Next event
|
||||
}
|
||||
/*
|
||||
We print the event, but with a leading '#': this is just to inform
|
||||
@@ -388,10 +384,12 @@ Create_file event for file_id: %u\n",exv->file_id);
|
||||
ev->print(result_file, short_form, last_db);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
(*rec_count)++;
|
||||
if (ev)
|
||||
delete ev;
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -472,6 +470,7 @@ static void die(const char* fmt, ...)
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
cleanup();
|
||||
my_end(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -645,6 +644,8 @@ static int dump_remote_log_entries(const char* logname)
|
||||
uint len;
|
||||
NET* net = &mysql->net;
|
||||
int old_format;
|
||||
DBUG_ENTER("dump_remote_log_entries");
|
||||
|
||||
old_format = check_master_version(mysql);
|
||||
|
||||
if (!position)
|
||||
@@ -663,7 +664,7 @@ static int dump_remote_log_entries(const char* logname)
|
||||
if (simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
|
||||
{
|
||||
fprintf(stderr,"Got fatal error sending the log dump command\n");
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
my_off_t old_off= 0;
|
||||
@@ -678,7 +679,7 @@ static int dump_remote_log_entries(const char* logname)
|
||||
{
|
||||
fprintf(stderr, "Got error reading packet from server: %s\n",
|
||||
mysql_error(mysql));
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (len < 8 && net->read_pos[0] == 254)
|
||||
break; // end of data
|
||||
@@ -689,14 +690,14 @@ static int dump_remote_log_entries(const char* logname)
|
||||
if (!ev)
|
||||
{
|
||||
fprintf(stderr, "Could not construct log event object\n");
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
Log_event_type type= ev->get_type_code();
|
||||
if (!old_format || ( type != LOAD_EVENT && type != CREATE_FILE_EVENT))
|
||||
{
|
||||
if (process_event(&rec_count,last_db,ev,old_off,old_format))
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -706,16 +707,17 @@ static int dump_remote_log_entries(const char* logname)
|
||||
File file;
|
||||
|
||||
if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0)
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
|
||||
if (process_event(&rec_count,last_db,ev,old_off,old_format))
|
||||
{
|
||||
my_close(file,MYF(MY_WME));
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (load_processor.load_old_format_file(net,old_fname,old_len,file))
|
||||
{
|
||||
my_close(file,MYF(MY_WME));
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
my_close(file,MYF(MY_WME));
|
||||
}
|
||||
@@ -729,7 +731,7 @@ static int dump_remote_log_entries(const char* logname)
|
||||
else
|
||||
old_off= BIN_LOG_HEADER_SIZE;
|
||||
}
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -738,6 +740,7 @@ static int check_header(IO_CACHE* file)
|
||||
byte header[BIN_LOG_HEADER_SIZE];
|
||||
byte buf[PROBE_HEADER_LEN];
|
||||
int old_format=0;
|
||||
DBUG_ENTER("check_header");
|
||||
|
||||
my_off_t pos = my_b_tell(file);
|
||||
my_b_seek(file, (my_off_t)0);
|
||||
@@ -755,7 +758,7 @@ static int check_header(IO_CACHE* file)
|
||||
}
|
||||
}
|
||||
my_b_seek(file, pos);
|
||||
return old_format;
|
||||
DBUG_RETURN(old_format);
|
||||
}
|
||||
|
||||
|
||||
@@ -857,6 +860,8 @@ int main(int argc, char** argv)
|
||||
static char **defaults_argv;
|
||||
int exit_value;
|
||||
MY_INIT(argv[0]);
|
||||
DBUG_ENTER("main");
|
||||
DBUG_PROCESS(argv[0]);
|
||||
|
||||
parse_args(&argc, (char***)&argv);
|
||||
defaults_argv=argv;
|
||||
@@ -905,7 +910,7 @@ int main(int argc, char** argv)
|
||||
free_defaults(defaults_argv);
|
||||
my_end(0);
|
||||
exit(exit_value);
|
||||
return exit_value; // Keep compilers happy
|
||||
DBUG_RETURN(exit_value); // Keep compilers happy
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user