mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
Added xml patch to mysqldump.
Made innodb to compile more cleanly with debugging options enabled. Fixed a few bugs and found a few possible bugs, which I hope Heikki will check. Comments needs to be fixed too. Some while() functions should be changed to do ... until for documenting purposes, because some of them must and will be processed at least once, or a variable would be used uninitialized. Regards, Jani client/mysqldump.c: Added xml output. Patch originally from Gary Huntress, but needed a some clean up. innobase/btr/btr0btr.c: cleaner compiling innobase/btr/btr0cur.c: cleaner compiling innobase/btr/btr0sea.c: cleaner compiling / found a bug ?? innobase/buf/buf0buf.c: Fixed a bug. innobase/buf/buf0lru.c: Fixed a bug. innobase/data/data0data.c: cleaner compiling innobase/dict/dict0boot.c: cleaner compiling innobase/dict/dict0crea.c: cleaner compiling innobase/dict/dict0dict.c: cleaner compiling innobase/dict/dict0load.c: cleaner compiling innobase/eval/eval0eval.c: cleaner compiling / found a bug ?? innobase/fil/fil0fil.c: cleaner compiling innobase/fsp/fsp0fsp.c: cleaner compiling innobase/ibuf/ibuf0ibuf.c: cleaner compiling innobase/include/btr0btr.ic: cleaner compiling innobase/include/buf0buf.ic: cleaner compiling innobase/include/dict0dict.ic: cleaner compiling innobase/include/ha0ha.ic: cleaner compiling innobase/include/row0mysql.ic: cleaner compiling innobase/include/row0vers.ic: cleaner compiling innobase/include/sync0rw.ic: cleaner compiling innobase/lock/lock0lock.c: cleaner compiling innobase/mem/mem0dbg.c: cleaner compiling innobase/mtr/mtr0mtr.c: cleaner compiling innobase/odbc/odbc0odbc.c: cleaner compiling innobase/os/os0thread.c: cleaner compiling innobase/page/page0cur.c: cleaner compiling. while() should be changed to do ... until for documenting purposes. innobase/page/page0page.c: cleaner compiling innobase/pars/pars0opt.c: cleaner compiling. while() should be changed to do ... until, because it will and must be processed at least once (for documenting purposes) innobase/pars/pars0pars.c: cleaner compiling innobase/que/que0que.c: cleaner compiling innobase/rem/rem0cmp.c: cleaner compiling innobase/rem/rem0rec.c: cleaner compiling innobase/row/row0ins.c: cleaner compiling innobase/row/row0mysql.c: cleaner compiling innobase/row/row0purge.c: cleaner compiling innobase/row/row0sel.c: cleaner compiling innobase/row/row0uins.c: cleaner compiling innobase/row/row0umod.c: cleaner compiling innobase/row/row0upd.c: cleaner compiling innobase/srv/srv0srv.c: cleaner compiling innobase/srv/srv0start.c: cleaner compiling innobase/sync/sync0arr.c: cleaner compiling innobase/sync/sync0rw.c: cleaner compiling innobase/sync/sync0sync.c: cleaner compiling innobase/trx/trx0purge.c: cleaner compiling. in theory this could also be a bug, although probably not. But the logic needs to be checked, it could be that these variables may be used uninitialized. innobase/trx/trx0rec.c: cleaner compiling innobase/trx/trx0roll.c: cleaner compiling innobase/trx/trx0trx.c: cleaner compiling innobase/trx/trx0undo.c: cleaner compiling
This commit is contained in:
parent
7fe5963c44
commit
adb703943d
51 changed files with 440 additions and 347 deletions
|
@ -31,7 +31,9 @@
|
||||||
** SSL by
|
** SSL by
|
||||||
** Andrei Errapart <andreie@no.spam.ee>
|
** Andrei Errapart <andreie@no.spam.ee>
|
||||||
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
|
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
|
||||||
**/
|
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
|
||||||
|
** and adapted to mysqldump 05/11/01 by Jani Tolonen
|
||||||
|
*/
|
||||||
|
|
||||||
#define DUMP_VERSION "8.18"
|
#define DUMP_VERSION "8.18"
|
||||||
|
|
||||||
|
@ -70,7 +72,8 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0,
|
||||||
lock_tables=0,ignore_errors=0,flush_logs=0,replace=0,
|
lock_tables=0,ignore_errors=0,flush_logs=0,replace=0,
|
||||||
ignore=0,opt_drop=0,opt_keywords=0,opt_lock=0,opt_compress=0,
|
ignore=0,opt_drop=0,opt_keywords=0,opt_lock=0,opt_compress=0,
|
||||||
opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0,
|
opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0,
|
||||||
opt_alldbs=0,opt_create_db=0,opt_first_slave=0, opt_autocommit=0, opt_master_data;
|
opt_alldbs=0,opt_create_db=0,opt_first_slave=0,
|
||||||
|
opt_autocommit=0, opt_master_data, opt_xml=0;
|
||||||
static MYSQL mysql_connection,*sock=0;
|
static MYSQL mysql_connection,*sock=0;
|
||||||
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
|
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
|
||||||
*current_host=0,*path=0,*fields_terminated=0,
|
*current_host=0,*path=0,*fields_terminated=0,
|
||||||
|
@ -135,6 +138,7 @@ static struct option long_options[] =
|
||||||
{"verbose", no_argument, 0, 'v'},
|
{"verbose", no_argument, 0, 'v'},
|
||||||
{"version", no_argument, 0, 'V'},
|
{"version", no_argument, 0, 'V'},
|
||||||
{"where", required_argument, 0, 'w'},
|
{"where", required_argument, 0, 'w'},
|
||||||
|
{"xml", no_argument, 0, 'X'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -248,6 +252,7 @@ puts("\
|
||||||
-v, --verbose Print info about the various stages.\n\
|
-v, --verbose Print info about the various stages.\n\
|
||||||
-V, --version Output version information and exit.\n\
|
-V, --version Output version information and exit.\n\
|
||||||
-w, --where= dump only selected records; QUOTES mandatory!\n\
|
-w, --where= dump only selected records; QUOTES mandatory!\n\
|
||||||
|
-X, --xml dump a database as well formed XML\n\
|
||||||
-x, --first-slave Locks all tables across all databases.\n\
|
-x, --first-slave Locks all tables across all databases.\n\
|
||||||
EXAMPLES: \"--where=user=\'jimf\'\" \"-wuserid>1\" \"-wuserid<1\"\n\
|
EXAMPLES: \"--where=user=\'jimf\'\" \"-wuserid>1\" \"-wuserid<1\"\n\
|
||||||
Use -T (--tab=...) with --fields-...\n\
|
Use -T (--tab=...) with --fields-...\n\
|
||||||
|
@ -274,13 +279,18 @@ puts("\
|
||||||
|
|
||||||
static void write_heder(FILE *sql_file, char *db_name)
|
static void write_heder(FILE *sql_file, char *db_name)
|
||||||
{
|
{
|
||||||
fprintf(sql_file, "-- MySQL dump %s\n--\n", DUMP_VERSION);
|
if (opt_xml)
|
||||||
fprintf(sql_file, "-- Host: %s Database: %s\n",
|
fprintf(sql_file,"<?xml version=\"1.0\"?>\n");
|
||||||
current_host ? current_host : "localhost", db_name ? db_name : "");
|
else
|
||||||
fputs("---------------------------------------------------------\n",
|
{
|
||||||
sql_file);
|
fprintf(sql_file, "-- MySQL dump %s\n--\n", DUMP_VERSION);
|
||||||
fprintf(sql_file, "-- Server version\t%s\n",
|
fprintf(sql_file, "-- Host: %s Database: %s\n",
|
||||||
mysql_get_server_info(&mysql_connection));
|
current_host ? current_host : "localhost", db_name ? db_name : "");
|
||||||
|
fputs("---------------------------------------------------------\n",
|
||||||
|
sql_file);
|
||||||
|
fprintf(sql_file, "-- Server version\t%s\n",
|
||||||
|
mysql_get_server_info(&mysql_connection));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} /* write_heder */
|
} /* write_heder */
|
||||||
|
|
||||||
|
@ -294,7 +304,7 @@ static int get_options(int *argc,char ***argv)
|
||||||
load_defaults("my",load_default_groups,argc,argv);
|
load_defaults("my",load_default_groups,argc,argv);
|
||||||
set_all_changeable_vars(md_changeable_vars);
|
set_all_changeable_vars(md_changeable_vars);
|
||||||
while ((c=getopt_long(*argc,*argv,
|
while ((c=getopt_long(*argc,*argv,
|
||||||
"#::p::h:u:O:P:r:S:T:EBaAcCdefFlnqtvVw:?Ix",
|
"#::p::h:u:O:P:r:S:T:EBaAcCdefFlnqtvVw:?IxX",
|
||||||
long_options, &option_index)) != EOF)
|
long_options, &option_index)) != EOF)
|
||||||
{
|
{
|
||||||
switch(c) {
|
switch(c) {
|
||||||
|
@ -397,6 +407,7 @@ static int get_options(int *argc,char ***argv)
|
||||||
case 'w':
|
case 'w':
|
||||||
where=optarg;
|
where=optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'X': opt_xml = 1; break;
|
||||||
case 'x':
|
case 'x':
|
||||||
opt_first_slave=1;
|
opt_first_slave=1;
|
||||||
break;
|
break;
|
||||||
|
@ -563,7 +574,7 @@ static void unescape(FILE *file,char *pos,uint length)
|
||||||
ignore_errors=0; /* Fatal error */
|
ignore_errors=0; /* Fatal error */
|
||||||
safe_exit(EX_MYSQLERR); /* Force exit */
|
safe_exit(EX_MYSQLERR); /* Force exit */
|
||||||
}
|
}
|
||||||
mysql_real_escape_string(&mysql_connection,tmp, pos, length);
|
mysql_real_escape_string(&mysql_connection, tmp, pos, length);
|
||||||
fputc('\'', file);
|
fputc('\'', file);
|
||||||
fputs(tmp, file);
|
fputs(tmp, file);
|
||||||
fputc('\'', file);
|
fputc('\'', file);
|
||||||
|
@ -649,13 +660,16 @@ static uint getTableStructure(char *table, char* db)
|
||||||
}
|
}
|
||||||
write_heder(sql_file, db);
|
write_heder(sql_file, db);
|
||||||
}
|
}
|
||||||
fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n",table);
|
if (!opt_xml)
|
||||||
|
fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n",
|
||||||
|
table);
|
||||||
if (opt_drop)
|
if (opt_drop)
|
||||||
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
|
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
|
||||||
|
|
||||||
tableRes=mysql_store_result(sock);
|
tableRes=mysql_store_result(sock);
|
||||||
row=mysql_fetch_row(tableRes);
|
row=mysql_fetch_row(tableRes);
|
||||||
fprintf(sql_file, "%s;\n", row[1]);
|
if (!opt_xml)
|
||||||
|
fprintf(sql_file, "%s;\n", row[1]);
|
||||||
mysql_free_result(tableRes);
|
mysql_free_result(tableRes);
|
||||||
}
|
}
|
||||||
sprintf(insert_pat,"show fields from %s",table_name);
|
sprintf(insert_pat,"show fields from %s",table_name);
|
||||||
|
@ -721,7 +735,9 @@ static uint getTableStructure(char *table, char* db)
|
||||||
}
|
}
|
||||||
write_heder(sql_file, db);
|
write_heder(sql_file, db);
|
||||||
}
|
}
|
||||||
fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n",table);
|
if (!opt_xml)
|
||||||
|
fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n",
|
||||||
|
table);
|
||||||
if (opt_drop)
|
if (opt_drop)
|
||||||
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
|
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
|
||||||
fprintf(sql_file, "CREATE TABLE %s (\n", table_name);
|
fprintf(sql_file, "CREATE TABLE %s (\n", table_name);
|
||||||
|
@ -760,7 +776,7 @@ static uint getTableStructure(char *table, char* db)
|
||||||
if (row[SHOW_DEFAULT])
|
if (row[SHOW_DEFAULT])
|
||||||
{
|
{
|
||||||
fputs(" DEFAULT ", sql_file);
|
fputs(" DEFAULT ", sql_file);
|
||||||
unescape(sql_file,row[SHOW_DEFAULT],lengths[SHOW_DEFAULT]);
|
unescape(sql_file, row[SHOW_DEFAULT], lengths[SHOW_DEFAULT]);
|
||||||
}
|
}
|
||||||
if (!row[SHOW_NULL][0])
|
if (!row[SHOW_NULL][0])
|
||||||
fputs(" NOT NULL", sql_file);
|
fputs(" NOT NULL", sql_file);
|
||||||
|
@ -977,14 +993,18 @@ static void dumpTable(uint numFields, char *table)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(md_result_file,"\n--\n-- Dumping data for table '%s'\n--\n", table);
|
if (!opt_xml)
|
||||||
|
fprintf(md_result_file,"\n--\n-- Dumping data for table '%s'\n--\n",
|
||||||
|
table);
|
||||||
sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff));
|
sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff));
|
||||||
if (where)
|
if (where)
|
||||||
{
|
{
|
||||||
fprintf(md_result_file,"-- WHERE: %s\n",where);
|
if (!opt_xml)
|
||||||
|
fprintf(md_result_file,"-- WHERE: %s\n",where);
|
||||||
strxmov(strend(query), " WHERE ",where,NullS);
|
strxmov(strend(query), " WHERE ",where,NullS);
|
||||||
}
|
}
|
||||||
fputs("\n\n", md_result_file);
|
if (!opt_xml)
|
||||||
|
fputs("\n\n", md_result_file);
|
||||||
if (mysql_query(sock, query))
|
if (mysql_query(sock, query))
|
||||||
{
|
{
|
||||||
DBerror(sock, "when retrieving data from server");
|
DBerror(sock, "when retrieving data from server");
|
||||||
|
@ -1017,6 +1037,8 @@ static void dumpTable(uint numFields, char *table)
|
||||||
row_break=0;
|
row_break=0;
|
||||||
rownr=0;
|
rownr=0;
|
||||||
init_length=(uint) strlen(insert_pat)+4;
|
init_length=(uint) strlen(insert_pat)+4;
|
||||||
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "\t<%s>\n", table);
|
||||||
|
|
||||||
if (opt_autocommit)
|
if (opt_autocommit)
|
||||||
fprintf(md_result_file, "set autocommit=0;\n");
|
fprintf(md_result_file, "set autocommit=0;\n");
|
||||||
|
@ -1026,7 +1048,7 @@ static void dumpTable(uint numFields, char *table)
|
||||||
uint i;
|
uint i;
|
||||||
ulong *lengths=mysql_fetch_lengths(res);
|
ulong *lengths=mysql_fetch_lengths(res);
|
||||||
rownr++;
|
rownr++;
|
||||||
if (!extended_insert)
|
if (!extended_insert && !opt_xml)
|
||||||
fputs(insert_pat,md_result_file);
|
fputs(insert_pat,md_result_file);
|
||||||
mysql_field_seek(res,0);
|
mysql_field_seek(res,0);
|
||||||
|
|
||||||
|
@ -1085,22 +1107,36 @@ static void dumpTable(uint numFields, char *table)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (i)
|
if (i && !opt_xml)
|
||||||
fputc(',',md_result_file);
|
fputc(',', md_result_file);
|
||||||
if (row[i])
|
if (row[i])
|
||||||
{
|
{
|
||||||
if (!IS_NUM_FIELD(field))
|
if (!IS_NUM_FIELD(field))
|
||||||
unescape(md_result_file, row[i], lengths[i]);
|
{
|
||||||
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "\t\t<%s>%s</%s>\n",
|
||||||
|
field->name, row[i], field->name);
|
||||||
|
else
|
||||||
|
unescape(md_result_file, row[i], lengths[i]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* change any strings ("inf","nan",..) into NULL */
|
/* change any strings ("inf","nan",..) into NULL */
|
||||||
char *ptr = row[i];
|
char *ptr = row[i];
|
||||||
fputs((!isalpha(*ptr)) ? ptr : "NULL", md_result_file);
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "\t\t<%s>%s</%s>\n",
|
||||||
|
field->name,!isalpha(*ptr) ?ptr: "NULL",field->name);
|
||||||
|
else
|
||||||
|
fputs((!isalpha(*ptr)) ? ptr : "NULL", md_result_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fputs("NULL",md_result_file);
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "\t\t<%s>%s</%s>\n",
|
||||||
|
field->name, "NULL", field->name);
|
||||||
|
else
|
||||||
|
fputs("NULL", md_result_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1118,18 +1154,26 @@ static void dumpTable(uint numFields, char *table)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (row_break)
|
if (row_break && !opt_xml)
|
||||||
fputs(";\n", md_result_file);
|
fputs(";\n", md_result_file);
|
||||||
row_break=1; /* This is first row */
|
row_break=1; /* This is first row */
|
||||||
fputs(insert_pat,md_result_file);
|
|
||||||
fputs(extended_row.str,md_result_file);
|
if (!opt_xml)
|
||||||
|
{
|
||||||
|
fputs(insert_pat,md_result_file);
|
||||||
|
fputs(extended_row.str,md_result_file);
|
||||||
|
}
|
||||||
total_length = row_length+init_length;
|
total_length = row_length+init_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (!opt_xml)
|
||||||
fputs(");\n", md_result_file);
|
fputs(");\n", md_result_file);
|
||||||
}
|
}
|
||||||
if (extended_insert && row_break)
|
|
||||||
|
//XML - close table tag and supress regular output
|
||||||
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "\t</%s>\n", table);
|
||||||
|
else if (extended_insert && row_break)
|
||||||
fputs(";\n", md_result_file); /* If not empty table */
|
fputs(";\n", md_result_file); /* If not empty table */
|
||||||
fflush(md_result_file);
|
fflush(md_result_file);
|
||||||
if (mysql_errno(sock))
|
if (mysql_errno(sock))
|
||||||
|
@ -1204,9 +1248,14 @@ static int dump_databases(char **db_names)
|
||||||
{
|
{
|
||||||
int result=0;
|
int result=0;
|
||||||
for ( ; *db_names ; db_names++)
|
for ( ; *db_names ; db_names++)
|
||||||
{
|
{
|
||||||
|
//XML edit - add database element
|
||||||
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "<%s>\n", *db_names);
|
||||||
if (dump_all_tables_in_db(*db_names))
|
if (dump_all_tables_in_db(*db_names))
|
||||||
result=1;
|
result=1;
|
||||||
|
if (opt_xml)
|
||||||
|
fprintf(md_result_file, "</%s>\n", *db_names);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} /* dump_databases */
|
} /* dump_databases */
|
||||||
|
|
|
@ -837,7 +837,7 @@ btr_parse_page_reorganize(
|
||||||
/*======================*/
|
/*======================*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page, /* in: page or NULL */
|
page_t* page, /* in: page or NULL */
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
|
@ -1438,7 +1438,7 @@ btr_page_split_and_insert(
|
||||||
page_t* insert_page;
|
page_t* insert_page;
|
||||||
page_cur_t* page_cursor;
|
page_cur_t* page_cursor;
|
||||||
rec_t* first_rec;
|
rec_t* first_rec;
|
||||||
byte* buf;
|
byte* buf = 0; /* remove warning */
|
||||||
rec_t* move_limit;
|
rec_t* move_limit;
|
||||||
ibool insert_will_fit;
|
ibool insert_will_fit;
|
||||||
ulint n_iterations = 0;
|
ulint n_iterations = 0;
|
||||||
|
@ -1616,7 +1616,7 @@ static
|
||||||
void
|
void
|
||||||
btr_level_list_remove(
|
btr_level_list_remove(
|
||||||
/*==================*/
|
/*==================*/
|
||||||
dict_tree_t* tree, /* in: index tree */
|
dict_tree_t* tree __attribute__((unused)), /* in: index tree */
|
||||||
page_t* page, /* in: page to remove */
|
page_t* page, /* in: page to remove */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
{
|
{
|
||||||
|
@ -2338,7 +2338,7 @@ btr_validate_level(
|
||||||
{
|
{
|
||||||
ulint space;
|
ulint space;
|
||||||
page_t* page;
|
page_t* page;
|
||||||
page_t* right_page;
|
page_t* right_page = 0; /* remove warning */
|
||||||
page_t* father_page;
|
page_t* father_page;
|
||||||
page_t* right_father_page;
|
page_t* right_father_page;
|
||||||
rec_t* node_ptr;
|
rec_t* node_ptr;
|
||||||
|
|
|
@ -94,7 +94,7 @@ static
|
||||||
void
|
void
|
||||||
btr_cur_latch_leaves(
|
btr_cur_latch_leaves(
|
||||||
/*=================*/
|
/*=================*/
|
||||||
dict_tree_t* tree, /* in: index tree */
|
dict_tree_t* tree __attribute__((unused)), /* in: index tree */
|
||||||
page_t* page, /* in: leaf page where the search
|
page_t* page, /* in: leaf page where the search
|
||||||
converged */
|
converged */
|
||||||
ulint space, /* in: space id */
|
ulint space, /* in: space id */
|
||||||
|
@ -219,7 +219,7 @@ btr_cur_search_to_nth_level(
|
||||||
ulint insert_planned;
|
ulint insert_planned;
|
||||||
ulint buf_mode;
|
ulint buf_mode;
|
||||||
ulint estimate;
|
ulint estimate;
|
||||||
ulint root_height;
|
ulint root_height = 0; /* remove warning */
|
||||||
#ifdef BTR_CUR_ADAPT
|
#ifdef BTR_CUR_ADAPT
|
||||||
btr_search_t* info;
|
btr_search_t* info;
|
||||||
#endif
|
#endif
|
||||||
|
@ -488,7 +488,7 @@ btr_cur_open_at_index_side(
|
||||||
ulint page_no;
|
ulint page_no;
|
||||||
ulint space;
|
ulint space;
|
||||||
ulint height;
|
ulint height;
|
||||||
ulint root_height;
|
ulint root_height = 0; /* remove warning */
|
||||||
rec_t* node_ptr;
|
rec_t* node_ptr;
|
||||||
ulint estimate;
|
ulint estimate;
|
||||||
|
|
||||||
|
@ -2907,8 +2907,9 @@ btr_store_big_rec_extern_fields(
|
||||||
rec_t* rec, /* in: record */
|
rec_t* rec, /* in: record */
|
||||||
big_rec_t* big_rec_vec, /* in: vector containing fields
|
big_rec_t* big_rec_vec, /* in: vector containing fields
|
||||||
to be stored externally */
|
to be stored externally */
|
||||||
mtr_t* local_mtr) /* in: mtr containing the latch to
|
mtr_t* local_mtr __attribute__((unused))) /* in: mtr
|
||||||
rec and to the tree */
|
containing the latch to rec and to the
|
||||||
|
tree */
|
||||||
{
|
{
|
||||||
byte* data;
|
byte* data;
|
||||||
ulint local_len;
|
ulint local_len;
|
||||||
|
@ -3069,9 +3070,9 @@ btr_free_externally_stored_field(
|
||||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||||
rollback and we do not want to free
|
rollback and we do not want to free
|
||||||
inherited fields */
|
inherited fields */
|
||||||
mtr_t* local_mtr) /* in: mtr containing the latch to
|
mtr_t* local_mtr __attribute__((unused))) /* in: mtr
|
||||||
data an an X-latch to the index
|
containing the latch to data an an
|
||||||
tree */
|
X-latch to the index tree */
|
||||||
{
|
{
|
||||||
page_t* page;
|
page_t* page;
|
||||||
page_t* rec_page;
|
page_t* rec_page;
|
||||||
|
|
|
@ -1245,7 +1245,7 @@ btr_search_update_hash_on_insert(
|
||||||
dulint tree_id;
|
dulint tree_id;
|
||||||
ulint fold;
|
ulint fold;
|
||||||
ulint ins_fold;
|
ulint ins_fold;
|
||||||
ulint next_fold;
|
ulint next_fold = 0; /* remove warning (??? bug ???) */
|
||||||
ulint n_fields;
|
ulint n_fields;
|
||||||
ulint n_bytes;
|
ulint n_bytes;
|
||||||
ulint side;
|
ulint side;
|
||||||
|
|
|
@ -280,7 +280,7 @@ buf_page_print(
|
||||||
ut_sprintf_buf(buf, read_buf, UNIV_PAGE_SIZE);
|
ut_sprintf_buf(buf, read_buf, UNIV_PAGE_SIZE);
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Page dump in ascii and hex (%lu bytes):\n%s",
|
"InnoDB: Page dump in ascii and hex (%u bytes):\n%s",
|
||||||
UNIV_PAGE_SIZE, buf);
|
UNIV_PAGE_SIZE, buf);
|
||||||
fprintf(stderr, "InnoDB: End of page dump\n");
|
fprintf(stderr, "InnoDB: End of page dump\n");
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,10 @@ ibool
|
||||||
buf_LRU_search_and_free_block(
|
buf_LRU_search_and_free_block(
|
||||||
/*==========================*/
|
/*==========================*/
|
||||||
/* out: TRUE if freed */
|
/* out: TRUE if freed */
|
||||||
ulint n_iterations) /* in: how many times this has been called
|
ulint n_iterations __attribute__((unused))) /* in: how many times
|
||||||
repeatedly without result: a high value
|
this has been called repeatedly without
|
||||||
means that we should search farther */
|
result: a high value means that we should
|
||||||
|
search farther */
|
||||||
{
|
{
|
||||||
buf_block_t* block;
|
buf_block_t* block;
|
||||||
ibool freed;
|
ibool freed;
|
||||||
|
@ -199,7 +200,7 @@ buf_LRU_get_free_block(void)
|
||||||
buf_block_t* block = NULL;
|
buf_block_t* block = NULL;
|
||||||
ibool freed;
|
ibool freed;
|
||||||
ulint n_iterations = 0;
|
ulint n_iterations = 0;
|
||||||
ibool mon_value_was;
|
ibool mon_value_was = 0; /* remove bug */
|
||||||
ibool started_monitor = FALSE;
|
ibool started_monitor = FALSE;
|
||||||
loop:
|
loop:
|
||||||
mutex_enter(&(buf_pool->mutex));
|
mutex_enter(&(buf_pool->mutex));
|
||||||
|
|
|
@ -572,7 +572,7 @@ from entry with dtuple_convert_big_rec. */
|
||||||
void
|
void
|
||||||
dtuple_convert_back_big_rec(
|
dtuple_convert_back_big_rec(
|
||||||
/*========================*/
|
/*========================*/
|
||||||
dict_index_t* index, /* in: index */
|
dict_index_t* index __attribute__((unused)), /* in: index */
|
||||||
dtuple_t* entry, /* in: entry whose data was put to vector */
|
dtuple_t* entry, /* in: entry whose data was put to vector */
|
||||||
big_rec_t* vector) /* in, own: big rec vector; it is
|
big_rec_t* vector) /* in, own: big rec vector; it is
|
||||||
freed in this function */
|
freed in this function */
|
||||||
|
|
|
@ -254,27 +254,29 @@ dict_boot(void)
|
||||||
/* Insert into the dictionary cache the descriptions of the basic
|
/* Insert into the dictionary cache the descriptions of the basic
|
||||||
system tables */
|
system tables */
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8);
|
table = dict_mem_table_create((char *) "SYS_TABLES", DICT_HDR_SPACE,8);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "ID", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "N_COLS", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "MIX_ID", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "MIX_LEN", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "CLUSTER_NAME", DATA_BINARY,
|
||||||
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
|
0, 0, 0);
|
||||||
|
dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0);
|
||||||
|
|
||||||
table->id = DICT_TABLES_ID;
|
table->id = DICT_TABLES_ID;
|
||||||
|
|
||||||
dict_table_add_to_cache(table);
|
dict_table_add_to_cache(table);
|
||||||
dict_sys->sys_tables = table;
|
dict_sys->sys_tables = table;
|
||||||
|
|
||||||
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
|
index = dict_mem_index_create((char *) "SYS_TABLES", (char *)
|
||||||
DICT_HDR_SPACE,
|
"CLUST_IND",
|
||||||
DICT_UNIQUE | DICT_CLUSTERED, 1);
|
DICT_HDR_SPACE,
|
||||||
|
DICT_UNIQUE | DICT_CLUSTERED, 1);
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "NAME", 0);
|
dict_mem_index_add_field(index, (char *) "NAME", 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLES,
|
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLES,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
|
@ -282,51 +284,52 @@ dict_boot(void)
|
||||||
|
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
ut_a(dict_index_add_to_cache(table, index));
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
index = dict_mem_index_create("SYS_TABLES", "ID_IND", DICT_HDR_SPACE,
|
index = dict_mem_index_create((char *) "SYS_TABLES",
|
||||||
DICT_UNIQUE, 1);
|
(char *) "ID_IND", DICT_HDR_SPACE,
|
||||||
dict_mem_index_add_field(index, "ID", 0);
|
DICT_UNIQUE, 1);
|
||||||
|
dict_mem_index_add_field(index, (char *) "ID", 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
|
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
index->id = DICT_TABLE_IDS_ID;
|
index->id = DICT_TABLE_IDS_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
ut_a(dict_index_add_to_cache(table, index));
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7);
|
table = dict_mem_table_create((char *) "SYS_COLUMNS",DICT_HDR_SPACE,7);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "TABLE_ID", DATA_BINARY,0,0,0);
|
||||||
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "MTYPE", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "PRTYPE", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "LEN", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "PREC", DATA_INT, 0, 4, 0);
|
||||||
|
|
||||||
table->id = DICT_COLUMNS_ID;
|
table->id = DICT_COLUMNS_ID;
|
||||||
|
|
||||||
dict_table_add_to_cache(table);
|
dict_table_add_to_cache(table);
|
||||||
dict_sys->sys_columns = table;
|
dict_sys->sys_columns = table;
|
||||||
|
|
||||||
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
|
index = dict_mem_index_create((char *) "SYS_COLUMNS",
|
||||||
DICT_HDR_SPACE,
|
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "TABLE_ID", 0);
|
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0);
|
||||||
dict_mem_index_add_field(index, "POS", 0);
|
dict_mem_index_add_field(index, (char *) "POS", 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
|
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
index->id = DICT_COLUMNS_ID;
|
index->id = DICT_COLUMNS_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
ut_a(dict_index_add_to_cache(table, index));
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7);
|
table = dict_mem_table_create((char *) "SYS_INDEXES",DICT_HDR_SPACE,7);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "TABLE_ID", DATA_BINARY, 0,0,0);
|
||||||
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "ID", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "N_FIELDS", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "PAGE_NO", DATA_INT, 0, 4, 0);
|
||||||
|
|
||||||
/* The '+ 2' below comes from the 2 system fields */
|
/* The '+ 2' below comes from the 2 system fields */
|
||||||
ut_ad(DICT_SYS_INDEXES_PAGE_NO_FIELD == 6 + 2);
|
ut_ad(DICT_SYS_INDEXES_PAGE_NO_FIELD == 6 + 2);
|
||||||
|
@ -336,34 +339,34 @@ dict_boot(void)
|
||||||
dict_table_add_to_cache(table);
|
dict_table_add_to_cache(table);
|
||||||
dict_sys->sys_indexes = table;
|
dict_sys->sys_indexes = table;
|
||||||
|
|
||||||
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
|
index = dict_mem_index_create((char *) "SYS_INDEXES",
|
||||||
DICT_HDR_SPACE,
|
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "TABLE_ID", 0);
|
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0);
|
||||||
dict_mem_index_add_field(index, "ID", 0);
|
dict_mem_index_add_field(index, (char *) "ID", 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
|
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
index->id = DICT_INDEXES_ID;
|
index->id = DICT_INDEXES_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
ut_a(dict_index_add_to_cache(table, index));
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3);
|
table = dict_mem_table_create((char *) "SYS_FIELDS", DICT_HDR_SPACE,3);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "INDEX_ID", DATA_BINARY, 0,0,0);
|
||||||
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
|
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0);
|
||||||
dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table, (char *) "COL_NAME", DATA_BINARY, 0,0,0);
|
||||||
|
|
||||||
table->id = DICT_FIELDS_ID;
|
table->id = DICT_FIELDS_ID;
|
||||||
dict_table_add_to_cache(table);
|
dict_table_add_to_cache(table);
|
||||||
dict_sys->sys_fields = table;
|
dict_sys->sys_fields = table;
|
||||||
|
|
||||||
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
|
index = dict_mem_index_create((char *) "SYS_FIELDS",
|
||||||
DICT_HDR_SPACE,
|
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "INDEX_ID", 0);
|
dict_mem_index_add_field(index, (char *) "INDEX_ID", 0);
|
||||||
dict_mem_index_add_field(index, "POS", 0);
|
dict_mem_index_add_field(index, (char *) "POS", 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
|
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
|
|
|
@ -1044,8 +1044,8 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||||
|
|
||||||
mutex_enter(&(dict_sys->mutex));
|
mutex_enter(&(dict_sys->mutex));
|
||||||
|
|
||||||
table1 = dict_table_get_low("SYS_FOREIGN");
|
table1 = dict_table_get_low((char *) "SYS_FOREIGN");
|
||||||
table2 = dict_table_get_low("SYS_FOREIGN_COLS");
|
table2 = dict_table_get_low((char *) "SYS_FOREIGN_COLS");
|
||||||
|
|
||||||
if (table1 && table2
|
if (table1 && table2
|
||||||
&& UT_LIST_GET_LEN(table1->indexes) == 3
|
&& UT_LIST_GET_LEN(table1->indexes) == 3
|
||||||
|
@ -1061,18 +1061,18 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||||
|
|
||||||
trx = trx_allocate_for_mysql();
|
trx = trx_allocate_for_mysql();
|
||||||
|
|
||||||
trx->op_info = "creating foreign key sys tables";
|
trx->op_info = (char *) "creating foreign key sys tables";
|
||||||
|
|
||||||
if (table1) {
|
if (table1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: dropping incompletely created SYS_FOREIGN table\n");
|
"InnoDB: dropping incompletely created SYS_FOREIGN table\n");
|
||||||
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
|
row_drop_table_for_mysql((char *) "SYS_FOREIGN", trx, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (table2) {
|
if (table2) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n");
|
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n");
|
||||||
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
|
row_drop_table_for_mysql((char *) "SYS_FOREIGN_COLS",trx,TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@ -1082,7 +1082,7 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||||
there are 2 secondary indexes on SYS_FOREIGN, and they
|
there are 2 secondary indexes on SYS_FOREIGN, and they
|
||||||
are defined just like below */
|
are defined just like below */
|
||||||
|
|
||||||
str =
|
str = (char *)
|
||||||
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
|
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
|
||||||
"BEGIN\n"
|
"BEGIN\n"
|
||||||
"CREATE TABLE\n"
|
"CREATE TABLE\n"
|
||||||
|
@ -1121,15 +1121,15 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
|
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
|
||||||
|
|
||||||
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
|
row_drop_table_for_mysql((char *) "SYS_FOREIGN", trx, TRUE);
|
||||||
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
|
row_drop_table_for_mysql((char *) "SYS_FOREIGN_COLS",trx,TRUE);
|
||||||
|
|
||||||
error = DB_MUST_GET_MORE_FILE_SPACE;
|
error = DB_MUST_GET_MORE_FILE_SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
que_graph_free(graph);
|
que_graph_free(graph);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
trx_free_for_mysql(trx);
|
trx_free_for_mysql(trx);
|
||||||
|
|
||||||
|
@ -1165,7 +1165,7 @@ dict_create_add_foreigns_to_dictionary(
|
||||||
|
|
||||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||||
|
|
||||||
if (NULL == dict_table_get_low("SYS_FOREIGN")) {
|
if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
|
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
|
|
|
@ -492,15 +492,19 @@ dict_table_add_to_cache(
|
||||||
The clustered index will not always physically contain all
|
The clustered index will not always physically contain all
|
||||||
system columns. */
|
system columns. */
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "DB_ROW_ID", DATA_SYS, DATA_ROW_ID, 0, 0);
|
dict_mem_table_add_col(table, (char *) "DB_ROW_ID", DATA_SYS,
|
||||||
|
DATA_ROW_ID, 0, 0);
|
||||||
ut_ad(DATA_ROW_ID == 0);
|
ut_ad(DATA_ROW_ID == 0);
|
||||||
dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS, DATA_TRX_ID, 0, 0);
|
dict_mem_table_add_col(table, (char *) "DB_TRX_ID", DATA_SYS,
|
||||||
|
DATA_TRX_ID, 0, 0);
|
||||||
ut_ad(DATA_TRX_ID == 1);
|
ut_ad(DATA_TRX_ID == 1);
|
||||||
dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS, DATA_ROLL_PTR,
|
dict_mem_table_add_col(table, (char *) "DB_ROLL_PTR", DATA_SYS,
|
||||||
|
DATA_ROLL_PTR,
|
||||||
0, 0);
|
0, 0);
|
||||||
ut_ad(DATA_ROLL_PTR == 2);
|
ut_ad(DATA_ROLL_PTR == 2);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "DB_MIX_ID", DATA_SYS, DATA_MIX_ID, 0, 0);
|
dict_mem_table_add_col(table, (char *) "DB_MIX_ID", DATA_SYS,
|
||||||
|
DATA_MIX_ID, 0, 0);
|
||||||
ut_ad(DATA_MIX_ID == 3);
|
ut_ad(DATA_MIX_ID == 3);
|
||||||
ut_ad(DATA_N_SYS_COLS == 4); /* This assert reminds that if a new
|
ut_ad(DATA_N_SYS_COLS == 4); /* This assert reminds that if a new
|
||||||
system column is added to the program,
|
system column is added to the program,
|
||||||
|
@ -1908,7 +1912,7 @@ dict_create_foreign_constraints(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
loop:
|
loop:
|
||||||
ptr = dict_scan_to(ptr, "FOREIGN");
|
ptr = dict_scan_to(ptr, (char *) "FOREIGN");
|
||||||
|
|
||||||
if (*ptr == '\0' || dict_bracket_count(sql_string, ptr) != 1) {
|
if (*ptr == '\0' || dict_bracket_count(sql_string, ptr) != 1) {
|
||||||
|
|
||||||
|
@ -1920,19 +1924,19 @@ loop:
|
||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, "FOREIGN", &success);
|
ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
|
||||||
|
|
||||||
if (!isspace(*ptr)) {
|
if (!isspace(*ptr)) {
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, "KEY", &success);
|
ptr = dict_accept(ptr, (char *) "KEY", &success);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, "(", &success);
|
ptr = dict_accept(ptr, (char *) "(", &success);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
goto loop;
|
goto loop;
|
||||||
|
@ -1950,13 +1954,13 @@ col_loop1:
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
ptr = dict_accept(ptr, ",", &success);
|
ptr = dict_accept(ptr, (char *) ",", &success);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
goto col_loop1;
|
goto col_loop1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, ")", &success);
|
ptr = dict_accept(ptr, (char *) ")", &success);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
|
@ -1971,7 +1975,7 @@ col_loop1:
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, "REFERENCES", &success);
|
ptr = dict_accept(ptr, (char *) "REFERENCES", &success);
|
||||||
|
|
||||||
if (!success || !isspace(*ptr)) {
|
if (!success || !isspace(*ptr)) {
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
|
@ -2002,7 +2006,7 @@ col_loop1:
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, "(", &success);
|
ptr = dict_accept(ptr, (char *) "(", &success);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
dict_foreign_free(foreign);
|
dict_foreign_free(foreign);
|
||||||
|
@ -2022,13 +2026,13 @@ col_loop2:
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, ",", &success);
|
ptr = dict_accept(ptr, (char *) ",", &success);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
goto col_loop2;
|
goto col_loop2;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_accept(ptr, ")", &success);
|
ptr = dict_accept(ptr, (char *) ")", &success);
|
||||||
|
|
||||||
if (!success || foreign->n_fields != i) {
|
if (!success || foreign->n_fields != i) {
|
||||||
dict_foreign_free(foreign);
|
dict_foreign_free(foreign);
|
||||||
|
@ -2554,7 +2558,8 @@ void
|
||||||
dict_update_statistics_low(
|
dict_update_statistics_low(
|
||||||
/*=======================*/
|
/*=======================*/
|
||||||
dict_table_t* table, /* in: table */
|
dict_table_t* table, /* in: table */
|
||||||
ibool has_dict_mutex) /* in: TRUE if the caller has the
|
ibool has_dict_mutex __attribute__((unused)))
|
||||||
|
/* in: TRUE if the caller has the
|
||||||
dictionary mutex */
|
dictionary mutex */
|
||||||
{
|
{
|
||||||
dict_index_t* index;
|
dict_index_t* index;
|
||||||
|
|
|
@ -75,7 +75,7 @@ dict_get_first_table_name_in_db(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_tables = dict_table_get_low("SYS_TABLES");
|
sys_tables = dict_table_get_low((char *) "SYS_TABLES");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
|
@ -154,7 +154,7 @@ dict_print(void)
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_tables = dict_table_get_low("SYS_TABLES");
|
sys_tables = dict_table_get_low((char *) "SYS_TABLES");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
||||||
|
|
||||||
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
|
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
|
||||||
|
@ -241,7 +241,7 @@ dict_load_table(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_tables = dict_table_get_low("SYS_TABLES");
|
sys_tables = dict_table_get_low((char *) "SYS_TABLES");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
|
@ -277,7 +277,7 @@ dict_load_table(
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("SPACE",
|
ut_a(0 == ut_strcmp((char *) "SPACE",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_tables), 9))->name));
|
dict_table_get_first_index(sys_tables), 9))->name));
|
||||||
|
@ -285,7 +285,7 @@ dict_load_table(
|
||||||
field = rec_get_nth_field(rec, 9, &len);
|
field = rec_get_nth_field(rec, 9, &len);
|
||||||
space = mach_read_from_4(field);
|
space = mach_read_from_4(field);
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("N_COLS",
|
ut_a(0 == ut_strcmp((char *) "N_COLS",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_tables), 4))->name));
|
dict_table_get_first_index(sys_tables), 4))->name));
|
||||||
|
@ -295,7 +295,7 @@ dict_load_table(
|
||||||
|
|
||||||
table = dict_mem_table_create(name, space, n_cols);
|
table = dict_mem_table_create(name, space, n_cols);
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("ID",
|
ut_a(0 == ut_strcmp((char *) "ID",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_tables), 3))->name));
|
dict_table_get_first_index(sys_tables), 3))->name));
|
||||||
|
@ -498,7 +498,7 @@ dict_load_columns(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_columns = dict_table_get_low("SYS_COLUMNS");
|
sys_columns = dict_table_get_low((char *) "SYS_COLUMNS");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_columns->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_columns->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
|
@ -528,7 +528,7 @@ dict_load_columns(
|
||||||
ut_ad(len == 4);
|
ut_ad(len == 4);
|
||||||
ut_a(i == mach_read_from_4(field));
|
ut_a(i == mach_read_from_4(field));
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("NAME",
|
ut_a(0 == ut_strcmp((char *) "NAME",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_columns), 4))->name));
|
dict_table_get_first_index(sys_columns), 4))->name));
|
||||||
|
@ -550,7 +550,7 @@ dict_load_columns(
|
||||||
field = rec_get_nth_field(rec, 7, &len);
|
field = rec_get_nth_field(rec, 7, &len);
|
||||||
col_len = mach_read_from_4(field);
|
col_len = mach_read_from_4(field);
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("PREC",
|
ut_a(0 == ut_strcmp((char *) "PREC",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_columns), 8))->name));
|
dict_table_get_first_index(sys_columns), 8))->name));
|
||||||
|
@ -608,7 +608,7 @@ dict_load_indexes(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_indexes = dict_table_get_low("SYS_INDEXES");
|
sys_indexes = dict_table_get_low((char *) "SYS_INDEXES");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
|
@ -643,7 +643,7 @@ dict_load_indexes(
|
||||||
ut_ad(len == 8);
|
ut_ad(len == 8);
|
||||||
id = mach_read_from_8(field);
|
id = mach_read_from_8(field);
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("NAME",
|
ut_a(0 == ut_strcmp((char *) "NAME",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_indexes), 4))->name));
|
dict_table_get_first_index(sys_indexes), 4))->name));
|
||||||
|
@ -663,7 +663,7 @@ dict_load_indexes(
|
||||||
field = rec_get_nth_field(rec, 7, &len);
|
field = rec_get_nth_field(rec, 7, &len);
|
||||||
space = mach_read_from_4(field);
|
space = mach_read_from_4(field);
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("PAGE_NO",
|
ut_a(0 == ut_strcmp((char *) "PAGE_NO",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_indexes), 8))->name));
|
dict_table_get_first_index(sys_indexes), 8))->name));
|
||||||
|
@ -674,8 +674,8 @@ dict_load_indexes(
|
||||||
if (is_sys_table
|
if (is_sys_table
|
||||||
&& ((type & DICT_CLUSTERED)
|
&& ((type & DICT_CLUSTERED)
|
||||||
|| ((table == dict_sys->sys_tables)
|
|| ((table == dict_sys->sys_tables)
|
||||||
&& (name_len == ut_strlen("ID_IND"))
|
&& (name_len == ut_strlen((char *) "ID_IND"))
|
||||||
&& (0 == ut_memcmp(name_buf, "ID_IND",
|
&& (0 == ut_memcmp(name_buf, (char *) "ID_IND",
|
||||||
name_len))))) {
|
name_len))))) {
|
||||||
|
|
||||||
/* The index was created in memory already in
|
/* The index was created in memory already in
|
||||||
|
@ -727,7 +727,7 @@ dict_load_fields(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_fields = dict_table_get_low("SYS_FIELDS");
|
sys_fields = dict_table_get_low((char *) "SYS_FIELDS");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_fields->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_fields->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
|
@ -756,7 +756,7 @@ dict_load_fields(
|
||||||
ut_ad(len == 4);
|
ut_ad(len == 4);
|
||||||
ut_a(i == mach_read_from_4(field));
|
ut_a(i == mach_read_from_4(field));
|
||||||
|
|
||||||
ut_a(0 == ut_strcmp("COL_NAME",
|
ut_a(0 == ut_strcmp((char *) "COL_NAME",
|
||||||
dict_field_get_col(
|
dict_field_get_col(
|
||||||
dict_index_get_nth_field(
|
dict_index_get_nth_field(
|
||||||
dict_table_get_first_index(sys_fields), 4))->name));
|
dict_table_get_first_index(sys_fields), 4))->name));
|
||||||
|
@ -807,7 +807,7 @@ dict_load_foreign_cols(
|
||||||
foreign->n_fields * sizeof(void*));
|
foreign->n_fields * sizeof(void*));
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS");
|
sys_foreign_cols = dict_table_get_low((char *) "SYS_FOREIGN_COLS");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(foreign->heap, 1);
|
tuple = dtuple_create(foreign->heap, 1);
|
||||||
|
@ -885,7 +885,7 @@ dict_load_foreign(
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
sys_foreign = dict_table_get_low("SYS_FOREIGN");
|
sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN");
|
||||||
sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes);
|
sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes);
|
||||||
|
|
||||||
tuple = dtuple_create(heap2, 1);
|
tuple = dtuple_create(heap2, 1);
|
||||||
|
@ -999,7 +999,7 @@ dict_load_foreigns(
|
||||||
|
|
||||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||||
|
|
||||||
sys_foreign = dict_table_get_low("SYS_FOREIGN");
|
sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN");
|
||||||
|
|
||||||
if (sys_foreign == NULL) {
|
if (sys_foreign == NULL) {
|
||||||
/* No foreign keys defined yet in this database */
|
/* No foreign keys defined yet in this database */
|
||||||
|
|
|
@ -164,8 +164,8 @@ eval_logical(
|
||||||
que_node_t* arg1;
|
que_node_t* arg1;
|
||||||
que_node_t* arg2;
|
que_node_t* arg2;
|
||||||
ibool val1;
|
ibool val1;
|
||||||
ibool val2;
|
ibool val2 = 0; /* remove warning */
|
||||||
ibool val;
|
ibool val = 0; /* remove warning */
|
||||||
int func;
|
int func;
|
||||||
|
|
||||||
ut_ad(que_node_get_type(logical_node) == QUE_NODE_FUNC);
|
ut_ad(que_node_get_type(logical_node) == QUE_NODE_FUNC);
|
||||||
|
@ -205,7 +205,7 @@ eval_arith(
|
||||||
que_node_t* arg1;
|
que_node_t* arg1;
|
||||||
que_node_t* arg2;
|
que_node_t* arg2;
|
||||||
lint val1;
|
lint val1;
|
||||||
lint val2;
|
lint val2 = 0; /* remove warning */
|
||||||
lint val;
|
lint val;
|
||||||
int func;
|
int func;
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ eval_predefined_2(
|
||||||
{
|
{
|
||||||
que_node_t* arg;
|
que_node_t* arg;
|
||||||
que_node_t* arg1;
|
que_node_t* arg1;
|
||||||
que_node_t* arg2;
|
que_node_t* arg2 = 0; /* remove warning (??? bug ???) */
|
||||||
lint int_val;
|
lint int_val;
|
||||||
byte* data;
|
byte* data;
|
||||||
ulint len1;
|
ulint len1;
|
||||||
|
|
|
@ -1209,7 +1209,7 @@ fil_aio_wait(
|
||||||
ut_ad(fil_validate());
|
ut_ad(fil_validate());
|
||||||
|
|
||||||
if (os_aio_use_native_aio) {
|
if (os_aio_use_native_aio) {
|
||||||
srv_io_thread_op_info[segment] = "native aio handle";
|
srv_io_thread_op_info[segment] = (char *) "native aio handle";
|
||||||
#ifdef WIN_ASYNC_IO
|
#ifdef WIN_ASYNC_IO
|
||||||
ret = os_aio_windows_handle(segment, 0, &fil_node, &message,
|
ret = os_aio_windows_handle(segment, 0, &fil_node, &message,
|
||||||
&type);
|
&type);
|
||||||
|
@ -1220,7 +1220,7 @@ fil_aio_wait(
|
||||||
ut_a(0);
|
ut_a(0);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
srv_io_thread_op_info[segment] = "simulated aio handle";
|
srv_io_thread_op_info[segment] =(char *)"simulated aio handle";
|
||||||
|
|
||||||
ret = os_aio_simulated_handle(segment, (void**) &fil_node,
|
ret = os_aio_simulated_handle(segment, (void**) &fil_node,
|
||||||
&message, &type);
|
&message, &type);
|
||||||
|
@ -1228,7 +1228,7 @@ fil_aio_wait(
|
||||||
|
|
||||||
ut_a(ret);
|
ut_a(ret);
|
||||||
|
|
||||||
srv_io_thread_op_info[segment] = "complete io for fil node";
|
srv_io_thread_op_info[segment] = (char *) "complete io for fil node";
|
||||||
|
|
||||||
mutex_enter(&(system->mutex));
|
mutex_enter(&(system->mutex));
|
||||||
|
|
||||||
|
@ -1241,10 +1241,11 @@ fil_aio_wait(
|
||||||
/* Do the i/o handling */
|
/* Do the i/o handling */
|
||||||
|
|
||||||
if (buf_pool_is_block(message)) {
|
if (buf_pool_is_block(message)) {
|
||||||
srv_io_thread_op_info[segment] = "complete io for buf page";
|
srv_io_thread_op_info[segment] =
|
||||||
|
(char *) "complete io for buf page";
|
||||||
buf_page_io_complete(message);
|
buf_page_io_complete(message);
|
||||||
} else {
|
} else {
|
||||||
srv_io_thread_op_info[segment] = "complete io for log";
|
srv_io_thread_op_info[segment] =(char *) "complete io for log";
|
||||||
log_io_complete(message);
|
log_io_complete(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -803,7 +803,7 @@ fsp_parse_init_file_page(
|
||||||
/*=====================*/
|
/*=====================*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page) /* in: page or NULL */
|
page_t* page) /* in: page or NULL */
|
||||||
{
|
{
|
||||||
ut_ad(ptr && end_ptr);
|
ut_ad(ptr && end_ptr);
|
||||||
|
@ -1252,7 +1252,7 @@ fsp_seg_inode_page_get_nth_inode(
|
||||||
/* out: segment inode */
|
/* out: segment inode */
|
||||||
page_t* page, /* in: segment inode page */
|
page_t* page, /* in: segment inode page */
|
||||||
ulint i, /* in: inode index on page */
|
ulint i, /* in: inode index on page */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(i < FSP_SEG_INODES_PER_PAGE);
|
ut_ad(i < FSP_SEG_INODES_PER_PAGE);
|
||||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
||||||
|
@ -1494,7 +1494,7 @@ fseg_get_nth_frag_page_no(
|
||||||
/* out: page number, FIL_NULL if not in use */
|
/* out: page number, FIL_NULL if not in use */
|
||||||
fseg_inode_t* inode, /* in: segment inode */
|
fseg_inode_t* inode, /* in: segment inode */
|
||||||
ulint n, /* in: slot index */
|
ulint n, /* in: slot index */
|
||||||
mtr_t* mtr) /* in: mtr handle */
|
mtr_t* mtr __attribute__((unused))) /* in: mtr handle */
|
||||||
{
|
{
|
||||||
ut_ad(inode && mtr);
|
ut_ad(inode && mtr);
|
||||||
ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
|
ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
|
||||||
|
@ -1632,7 +1632,7 @@ fseg_create_general(
|
||||||
fsp_header_t* space_header;
|
fsp_header_t* space_header;
|
||||||
fseg_inode_t* inode;
|
fseg_inode_t* inode;
|
||||||
dulint seg_id;
|
dulint seg_id;
|
||||||
fseg_header_t* header;
|
fseg_header_t* header = 0; /* remove warning */
|
||||||
rw_lock_t* latch;
|
rw_lock_t* latch;
|
||||||
ibool success;
|
ibool success;
|
||||||
page_t* ret = NULL;
|
page_t* ret = NULL;
|
||||||
|
|
|
@ -292,6 +292,7 @@ ibuf_count_get(
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
Sets the ibuf count for a given page. */
|
Sets the ibuf count for a given page. */
|
||||||
|
#ifdef UNIV_IBUF_DEBUG
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
ibuf_count_set(
|
ibuf_count_set(
|
||||||
|
@ -306,6 +307,7 @@ ibuf_count_set(
|
||||||
|
|
||||||
*(ibuf_counts[space] + page_no) = val;
|
*(ibuf_counts[space] + page_no) = val;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
Creates the insert buffer data structure at a database startup and
|
Creates the insert buffer data structure at a database startup and
|
||||||
|
@ -472,19 +474,18 @@ ibuf_data_init_for_space(
|
||||||
|
|
||||||
table = dict_mem_table_create(buf, space, 2);
|
table = dict_mem_table_create(buf, space, 2);
|
||||||
|
|
||||||
dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table,(char *) "PAGE_NO", DATA_BINARY, 0, 0, 0);
|
||||||
dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0);
|
dict_mem_table_add_col(table,(char *) "TYPES", DATA_BINARY, 0, 0, 0);
|
||||||
|
|
||||||
table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
|
table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
|
||||||
|
|
||||||
dict_table_add_to_cache(table);
|
dict_table_add_to_cache(table);
|
||||||
|
|
||||||
index = dict_mem_index_create(buf, "CLUST_IND", space,
|
index = dict_mem_index_create(buf, (char *) "CLUST_IND", space,
|
||||||
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,
|
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,2);
|
||||||
2);
|
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "PAGE_NO", 0);
|
dict_mem_index_add_field(index, (char *) "PAGE_NO", 0);
|
||||||
dict_mem_index_add_field(index, "TYPES", 0);
|
dict_mem_index_add_field(index, (char *) "TYPES", 0);
|
||||||
|
|
||||||
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;
|
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;
|
||||||
|
|
||||||
|
@ -538,7 +539,7 @@ ibuf_parse_bitmap_init(
|
||||||
/*===================*/
|
/*===================*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page, /* in: page or NULL */
|
page_t* page, /* in: page or NULL */
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
|
@ -561,7 +562,8 @@ ibuf_bitmap_page_get_bits(
|
||||||
page_t* page, /* in: bitmap page */
|
page_t* page, /* in: bitmap page */
|
||||||
ulint page_no,/* in: page whose bits to get */
|
ulint page_no,/* in: page whose bits to get */
|
||||||
ulint bit, /* in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ... */
|
ulint bit, /* in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ... */
|
||||||
mtr_t* mtr) /* in: mtr containing an x-latch to the bitmap page */
|
mtr_t* mtr __attribute__((unused))) /* in: mtr containing an x-latch
|
||||||
|
to the bitmap page */
|
||||||
{
|
{
|
||||||
ulint byte_offset;
|
ulint byte_offset;
|
||||||
ulint bit_offset;
|
ulint bit_offset;
|
||||||
|
|
|
@ -89,7 +89,7 @@ btr_page_get_level(
|
||||||
/*===============*/
|
/*===============*/
|
||||||
/* out: level, leaf level == 0 */
|
/* out: level, leaf level == 0 */
|
||||||
page_t* page, /* in: index page */
|
page_t* page, /* in: index page */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(page && mtr);
|
ut_ad(page && mtr);
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ btr_page_get_next(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
/* out: next page number */
|
/* out: next page number */
|
||||||
page_t* page, /* in: index page */
|
page_t* page, /* in: index page */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(page && mtr);
|
ut_ad(page && mtr);
|
||||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
||||||
|
@ -155,7 +155,7 @@ btr_page_get_prev(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
/* out: prev page number */
|
/* out: prev page number */
|
||||||
page_t* page, /* in: index page */
|
page_t* page, /* in: index page */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(page && mtr);
|
ut_ad(page && mtr);
|
||||||
|
|
||||||
|
|
|
@ -625,9 +625,10 @@ UNIV_INLINE
|
||||||
void
|
void
|
||||||
buf_page_dbg_add_level(
|
buf_page_dbg_add_level(
|
||||||
/*===================*/
|
/*===================*/
|
||||||
buf_frame_t* frame, /* in: buffer page where we have acquired
|
buf_frame_t* frame __attribute__((unused)), /* in: buffer page
|
||||||
a latch */
|
where we have acquired latch */
|
||||||
ulint level) /* in: latching order level */
|
ulint level __attribute__((unused))) /* in: latching order
|
||||||
|
level */
|
||||||
{
|
{
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
sync_thread_add_level(&(buf_block_align(frame)->lock), level);
|
sync_thread_add_level(&(buf_block_align(frame)->lock), level);
|
||||||
|
|
|
@ -106,7 +106,7 @@ dict_table_get_n_sys_cols(
|
||||||
/*======================*/
|
/*======================*/
|
||||||
/* out: number of system (e.g.,
|
/* out: number of system (e.g.,
|
||||||
ROW_ID) columns of a table */
|
ROW_ID) columns of a table */
|
||||||
dict_table_t* table) /* in: table */
|
dict_table_t* table __attribute__((unused))) /* in: table */
|
||||||
{
|
{
|
||||||
ut_ad(table);
|
ut_ad(table);
|
||||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||||
|
|
|
@ -59,7 +59,7 @@ ha_node_t*
|
||||||
ha_chain_get_next(
|
ha_chain_get_next(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
/* out: next node, NULL if none */
|
/* out: next node, NULL if none */
|
||||||
hash_table_t* table, /* in: hash table */
|
hash_table_t* table __attribute__((unused)), /* in: hash table */
|
||||||
ha_node_t* node) /* in: hash chain node */
|
ha_node_t* node) /* in: hash chain node */
|
||||||
{
|
{
|
||||||
ut_ad(table);
|
ut_ad(table);
|
||||||
|
|
|
@ -15,7 +15,8 @@ row_mysql_store_var_len(
|
||||||
/*====================*/
|
/*====================*/
|
||||||
/* out: dest + 2 */
|
/* out: dest + 2 */
|
||||||
byte* dest, /* in: where to store */
|
byte* dest, /* in: where to store */
|
||||||
ulint len) /* in: length, must fit in two bytes */
|
ulint len __attribute__((unused))) /* in: length, must fit in two
|
||||||
|
bytes */
|
||||||
{
|
{
|
||||||
ut_ad(len < 256 * 256);
|
ut_ad(len < 256 * 256);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -60,7 +60,7 @@ row_vers_sec_rec_may_see_older(
|
||||||
/*===========================*/
|
/*===========================*/
|
||||||
/* out: FALSE if can be read immediately */
|
/* out: FALSE if can be read immediately */
|
||||||
rec_t* rec, /* in: record which should be read or passed */
|
rec_t* rec, /* in: record which should be read or passed */
|
||||||
dict_index_t* index, /* in: secondary index */
|
dict_index_t* index __attribute__((unused)),/* in: secondary index */
|
||||||
read_view_t* view) /* in: read view */
|
read_view_t* view) /* in: read view */
|
||||||
{
|
{
|
||||||
page_t* page;
|
page_t* page;
|
||||||
|
|
|
@ -126,7 +126,8 @@ rw_lock_s_lock_low(
|
||||||
/*===============*/
|
/*===============*/
|
||||||
/* out: TRUE if success */
|
/* out: TRUE if success */
|
||||||
rw_lock_t* lock, /* in: pointer to rw-lock */
|
rw_lock_t* lock, /* in: pointer to rw-lock */
|
||||||
ulint pass, /* in: pass value; != 0, if the lock will be
|
ulint pass __attribute__((unused)),
|
||||||
|
/* in: pass value; != 0, if the lock will be
|
||||||
passed to another thread to unlock */
|
passed to another thread to unlock */
|
||||||
char* file_name, /* in: file name where lock requested */
|
char* file_name, /* in: file name where lock requested */
|
||||||
ulint line) /* in: line where requested */
|
ulint line) /* in: line where requested */
|
||||||
|
|
|
@ -539,7 +539,8 @@ lock_sec_rec_cons_read_sees(
|
||||||
index record */
|
index record */
|
||||||
rec_t* rec, /* in: user record which should be read or
|
rec_t* rec, /* in: user record which should be read or
|
||||||
passed over by a read cursor */
|
passed over by a read cursor */
|
||||||
dict_index_t* index, /* in: non-clustered index */
|
dict_index_t* index __attribute__((unused)),
|
||||||
|
/* in: non-clustered index */
|
||||||
read_view_t* view) /* in: consistent read view */
|
read_view_t* view) /* in: consistent read view */
|
||||||
{
|
{
|
||||||
dulint max_trx_id;
|
dulint max_trx_id;
|
||||||
|
@ -2292,7 +2293,7 @@ list start is moved to another page. */
|
||||||
void
|
void
|
||||||
lock_move_rec_list_start(
|
lock_move_rec_list_start(
|
||||||
/*=====================*/
|
/*=====================*/
|
||||||
page_t* new_page, /* in: index page to move to */
|
page_t* new_page __attribute__((unused)),/*in: index page to move to */
|
||||||
page_t* page, /* in: index page */
|
page_t* page, /* in: index page */
|
||||||
rec_t* rec, /* in: record on page: this is the
|
rec_t* rec, /* in: record on page: this is the
|
||||||
first record NOT copied */
|
first record NOT copied */
|
||||||
|
@ -2736,7 +2737,7 @@ lock_deadlock_recursive(
|
||||||
we return TRUE */
|
we return TRUE */
|
||||||
{
|
{
|
||||||
lock_t* lock;
|
lock_t* lock;
|
||||||
ulint bit_no;
|
ulint bit_no = 0; /* remove warning */
|
||||||
trx_t* lock_trx;
|
trx_t* lock_trx;
|
||||||
|
|
||||||
ut_a(trx && start && wait_lock);
|
ut_a(trx && start && wait_lock);
|
||||||
|
|
|
@ -372,7 +372,8 @@ void
|
||||||
mem_heap_validate_or_print(
|
mem_heap_validate_or_print(
|
||||||
/*=======================*/
|
/*=======================*/
|
||||||
mem_heap_t* heap, /* in: memory heap */
|
mem_heap_t* heap, /* in: memory heap */
|
||||||
byte* top, /* in: calculate and validate only until
|
byte* top __attribute__((unused)),
|
||||||
|
/* in: calculate and validate only until
|
||||||
this top pointer in the heap is reached,
|
this top pointer in the heap is reached,
|
||||||
if this pointer is NULL, ignored */
|
if this pointer is NULL, ignored */
|
||||||
ibool print, /* in: if TRUE, prints the contents
|
ibool print, /* in: if TRUE, prints the contents
|
||||||
|
@ -578,7 +579,8 @@ static
|
||||||
void
|
void
|
||||||
mem_print_info_low(
|
mem_print_info_low(
|
||||||
/*===============*/
|
/*===============*/
|
||||||
ibool print_all) /* in: if TRUE, all heaps are printed,
|
ibool print_all __attribute__((unused)))
|
||||||
|
/* in: if TRUE, all heaps are printed,
|
||||||
else only the heaps allocated after the
|
else only the heaps allocated after the
|
||||||
previous call of this function */
|
previous call of this function */
|
||||||
{
|
{
|
||||||
|
|
|
@ -469,7 +469,8 @@ mtr_read_ulint(
|
||||||
/* out: value read */
|
/* out: value read */
|
||||||
byte* ptr, /* in: pointer from where to read */
|
byte* ptr, /* in: pointer from where to read */
|
||||||
ulint type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
|
ulint type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused)))
|
||||||
|
/* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(mtr->state == MTR_ACTIVE);
|
ut_ad(mtr->state == MTR_ACTIVE);
|
||||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
||||||
|
@ -494,8 +495,9 @@ mtr_read_dulint(
|
||||||
/*===========*/
|
/*===========*/
|
||||||
/* out: value read */
|
/* out: value read */
|
||||||
byte* ptr, /* in: pointer from where to read */
|
byte* ptr, /* in: pointer from where to read */
|
||||||
ulint type, /* in: MLOG_8BYTES */
|
ulint type __attribute__((unused)), /* in: MLOG_8BYTES */
|
||||||
mtr_t* mtr) /* in: mini-transaction handle */
|
mtr_t* mtr __attribute__((unused)))
|
||||||
|
/* in: mini-transaction handle */
|
||||||
{
|
{
|
||||||
ut_ad(mtr->state == MTR_ACTIVE);
|
ut_ad(mtr->state == MTR_ACTIVE);
|
||||||
ut_ad(ptr && mtr);
|
ut_ad(ptr && mtr);
|
||||||
|
|
|
@ -421,7 +421,7 @@ SQLError(
|
||||||
}
|
}
|
||||||
|
|
||||||
*pfNativeError = 0;
|
*pfNativeError = 0;
|
||||||
ut_memcpy(szSqlState, "S1000", 6);
|
ut_memcpy(szSqlState, (char *) "S1000", 6);
|
||||||
|
|
||||||
len = (ulint)cbErrorMsgMax - 1;
|
len = (ulint)cbErrorMsgMax - 1;
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,8 @@ os_thread_create(
|
||||||
#endif
|
#endif
|
||||||
void* arg, /* in: argument to start
|
void* arg, /* in: argument to start
|
||||||
function */
|
function */
|
||||||
os_thread_id_t* thread_id) /* out: id of created
|
os_thread_id_t* thread_id __attribute__((unused)))
|
||||||
|
/* out: id of created
|
||||||
thread */
|
thread */
|
||||||
{
|
{
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
|
@ -204,7 +205,8 @@ ulint
|
||||||
os_thread_get_priority(
|
os_thread_get_priority(
|
||||||
/*===================*/
|
/*===================*/
|
||||||
/* out: priority */
|
/* out: priority */
|
||||||
os_thread_t handle) /* in: OS handle to the thread */
|
os_thread_t handle __attribute__((unused)))
|
||||||
|
/* in: OS handle to the thread */
|
||||||
{
|
{
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
int os_pri;
|
int os_pri;
|
||||||
|
|
|
@ -510,14 +510,14 @@ page_cur_parse_insert_rec(
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
ulint extra_info_yes;
|
ulint extra_info_yes;
|
||||||
ulint offset;
|
ulint offset = 0; /* remove warning */
|
||||||
ulint origin_offset;
|
ulint origin_offset;
|
||||||
ulint end_seg_len;
|
ulint end_seg_len;
|
||||||
ulint mismatch_index;
|
ulint mismatch_index;
|
||||||
rec_t* cursor_rec;
|
rec_t* cursor_rec;
|
||||||
byte buf1[1024];
|
byte buf1[1024];
|
||||||
byte* buf;
|
byte* buf;
|
||||||
ulint info_bits;
|
ulint info_bits = 0; /* remove warning */
|
||||||
page_cur_t cursor;
|
page_cur_t cursor;
|
||||||
|
|
||||||
if (!is_short) {
|
if (!is_short) {
|
||||||
|
@ -835,9 +835,9 @@ page_copy_rec_list_end_to_created_page(
|
||||||
rec_t* rec, /* in: first record to copy */
|
rec_t* rec, /* in: first record to copy */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
{
|
{
|
||||||
page_dir_slot_t* slot;
|
page_dir_slot_t* slot = 0; /* remove warning */
|
||||||
byte* heap_top;
|
byte* heap_top;
|
||||||
rec_t* insert_rec;
|
rec_t* insert_rec = 0; /* remove warning */
|
||||||
rec_t* prev_rec;
|
rec_t* prev_rec;
|
||||||
ulint count;
|
ulint count;
|
||||||
ulint n_recs;
|
ulint n_recs;
|
||||||
|
@ -882,6 +882,7 @@ page_copy_rec_list_end_to_created_page(
|
||||||
slot_index = 0;
|
slot_index = 0;
|
||||||
n_recs = 0;
|
n_recs = 0;
|
||||||
|
|
||||||
|
/* should be do ... until, comment by Jani */
|
||||||
while (rec != page_get_supremum_rec(page)) {
|
while (rec != page_get_supremum_rec(page)) {
|
||||||
|
|
||||||
insert_rec = rec_copy(heap_top, rec);
|
insert_rec = rec_copy(heap_top, rec);
|
||||||
|
|
|
@ -210,7 +210,7 @@ page_parse_create(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page, /* in: page or NULL */
|
page_t* page, /* in: page or NULL */
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
|
@ -283,7 +283,7 @@ page_create(
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
field = dtuple_get_nth_field(tuple, 0);
|
field = dtuple_get_nth_field(tuple, 0);
|
||||||
|
|
||||||
dfield_set_data(field, "infimum", strlen("infimum") + 1);
|
dfield_set_data(field,(char *) "infimum", strlen("infimum") + 1);
|
||||||
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
|
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
|
||||||
|
|
||||||
/* Set the corresponding physical record to its place in the page
|
/* Set the corresponding physical record to its place in the page
|
||||||
|
@ -305,7 +305,7 @@ page_create(
|
||||||
tuple = dtuple_create(heap, 1);
|
tuple = dtuple_create(heap, 1);
|
||||||
field = dtuple_get_nth_field(tuple, 0);
|
field = dtuple_get_nth_field(tuple, 0);
|
||||||
|
|
||||||
dfield_set_data(field, "supremum", strlen("supremum") + 1);
|
dfield_set_data(field, (char *) "supremum", strlen("supremum") + 1);
|
||||||
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
|
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
|
||||||
|
|
||||||
supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple);
|
supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple);
|
||||||
|
|
|
@ -528,7 +528,7 @@ opt_search_plan_for_table(
|
||||||
ulint goodness;
|
ulint goodness;
|
||||||
ulint last_op;
|
ulint last_op;
|
||||||
ulint best_goodness;
|
ulint best_goodness;
|
||||||
ulint best_last_op;
|
ulint best_last_op = 0; /* remove warning */
|
||||||
ulint mix_id_pos;
|
ulint mix_id_pos;
|
||||||
que_node_t* index_plan[128];
|
que_node_t* index_plan[128];
|
||||||
que_node_t* best_index_plan[128];
|
que_node_t* best_index_plan[128];
|
||||||
|
@ -546,6 +546,7 @@ opt_search_plan_for_table(
|
||||||
best_index = index; /* Eliminate compiler warning */
|
best_index = index; /* Eliminate compiler warning */
|
||||||
best_goodness = 0;
|
best_goodness = 0;
|
||||||
|
|
||||||
|
/* should be do ... until ? comment by Jani */
|
||||||
while (index) {
|
while (index) {
|
||||||
goodness = opt_calc_index_goodness(index, sel_node, i,
|
goodness = opt_calc_index_goodness(index, sel_node, i,
|
||||||
index_plan, &last_op);
|
index_plan, &last_op);
|
||||||
|
|
|
@ -1942,7 +1942,7 @@ Called by yyparse on error. */
|
||||||
void
|
void
|
||||||
yyerror(
|
yyerror(
|
||||||
/*====*/
|
/*====*/
|
||||||
char* s) /* in: error message string */
|
char* s __attribute__((unused))) /* in: error message string */
|
||||||
{
|
{
|
||||||
ut_ad(s);
|
ut_ad(s);
|
||||||
|
|
||||||
|
|
|
@ -393,7 +393,7 @@ graph so that the graph can communicate an error message to the client.) */
|
||||||
void
|
void
|
||||||
que_fork_error_handle(
|
que_fork_error_handle(
|
||||||
/*==================*/
|
/*==================*/
|
||||||
trx_t* trx, /* in: trx */
|
trx_t* trx __attribute__((unused)), /* in: trx */
|
||||||
que_t* fork) /* in: query graph which was run before signal
|
que_t* fork) /* in: query graph which was run before signal
|
||||||
handling started, NULL not allowed */
|
handling started, NULL not allowed */
|
||||||
{
|
{
|
||||||
|
@ -1130,47 +1130,47 @@ que_node_print_info(
|
||||||
addr = (ulint)node;
|
addr = (ulint)node;
|
||||||
|
|
||||||
if (type == QUE_NODE_SELECT) {
|
if (type == QUE_NODE_SELECT) {
|
||||||
str = "SELECT";
|
str = (char *) "SELECT";
|
||||||
} else if (type == QUE_NODE_INSERT) {
|
} else if (type == QUE_NODE_INSERT) {
|
||||||
str = "INSERT";
|
str = (char *) "INSERT";
|
||||||
} else if (type == QUE_NODE_UPDATE) {
|
} else if (type == QUE_NODE_UPDATE) {
|
||||||
str = "UPDATE";
|
str = (char *) "UPDATE";
|
||||||
} else if (type == QUE_NODE_WHILE) {
|
} else if (type == QUE_NODE_WHILE) {
|
||||||
str = "WHILE";
|
str = (char *) "WHILE";
|
||||||
} else if (type == QUE_NODE_ASSIGNMENT) {
|
} else if (type == QUE_NODE_ASSIGNMENT) {
|
||||||
str = "ASSIGNMENT";
|
str = (char *) "ASSIGNMENT";
|
||||||
} else if (type == QUE_NODE_IF) {
|
} else if (type == QUE_NODE_IF) {
|
||||||
str = "IF";
|
str = (char *) "IF";
|
||||||
} else if (type == QUE_NODE_FETCH) {
|
} else if (type == QUE_NODE_FETCH) {
|
||||||
str = "FETCH";
|
str = (char *) "FETCH";
|
||||||
} else if (type == QUE_NODE_OPEN) {
|
} else if (type == QUE_NODE_OPEN) {
|
||||||
str = "OPEN";
|
str = (char *) "OPEN";
|
||||||
} else if (type == QUE_NODE_PROC) {
|
} else if (type == QUE_NODE_PROC) {
|
||||||
str = "STORED PROCEDURE";
|
str = (char *) "STORED PROCEDURE";
|
||||||
} else if (type == QUE_NODE_FUNC) {
|
} else if (type == QUE_NODE_FUNC) {
|
||||||
str = "FUNCTION";
|
str = (char *) "FUNCTION";
|
||||||
} else if (type == QUE_NODE_LOCK) {
|
} else if (type == QUE_NODE_LOCK) {
|
||||||
str = "LOCK";
|
str = (char *) "LOCK";
|
||||||
} else if (type == QUE_NODE_THR) {
|
} else if (type == QUE_NODE_THR) {
|
||||||
str = "QUERY THREAD";
|
str = (char *) "QUERY THREAD";
|
||||||
} else if (type == QUE_NODE_COMMIT) {
|
} else if (type == QUE_NODE_COMMIT) {
|
||||||
str = "COMMIT";
|
str = (char *) "COMMIT";
|
||||||
} else if (type == QUE_NODE_UNDO) {
|
} else if (type == QUE_NODE_UNDO) {
|
||||||
str = "UNDO ROW";
|
str = (char *) "UNDO ROW";
|
||||||
} else if (type == QUE_NODE_PURGE) {
|
} else if (type == QUE_NODE_PURGE) {
|
||||||
str = "PURGE ROW";
|
str = (char *) "PURGE ROW";
|
||||||
} else if (type == QUE_NODE_ROLLBACK) {
|
} else if (type == QUE_NODE_ROLLBACK) {
|
||||||
str = "ROLLBACK";
|
str = (char *) "ROLLBACK";
|
||||||
} else if (type == QUE_NODE_CREATE_TABLE) {
|
} else if (type == QUE_NODE_CREATE_TABLE) {
|
||||||
str = "CREATE TABLE";
|
str = (char *) "CREATE TABLE";
|
||||||
} else if (type == QUE_NODE_CREATE_INDEX) {
|
} else if (type == QUE_NODE_CREATE_INDEX) {
|
||||||
str = "CREATE INDEX";
|
str = (char *) "CREATE INDEX";
|
||||||
} else if (type == QUE_NODE_FOR) {
|
} else if (type == QUE_NODE_FOR) {
|
||||||
str = "FOR LOOP";
|
str = (char *) "FOR LOOP";
|
||||||
} else if (type == QUE_NODE_RETURN) {
|
} else if (type == QUE_NODE_RETURN) {
|
||||||
str = "RETURN";
|
str = (char *) "RETURN";
|
||||||
} else {
|
} else {
|
||||||
str = "UNKNOWN NODE TYPE";
|
str = (char *) "UNKNOWN NODE TYPE";
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Node type %lu: %s, address %lx\n", type, str, addr);
|
printf("Node type %lu: %s, address %lx\n", type, str, addr);
|
||||||
|
|
|
@ -79,7 +79,7 @@ ulint
|
||||||
cmp_collate(
|
cmp_collate(
|
||||||
/*========*/
|
/*========*/
|
||||||
/* out: collation order position */
|
/* out: collation order position */
|
||||||
dtype_t* type, /* in: type */
|
dtype_t* type __attribute__((unused)) , /* in: type */
|
||||||
ulint code) /* in: code of a character stored in database
|
ulint code) /* in: code of a character stored in database
|
||||||
record */
|
record */
|
||||||
{
|
{
|
||||||
|
|
|
@ -517,9 +517,9 @@ rec_print(
|
||||||
ut_ad(rec);
|
ut_ad(rec);
|
||||||
|
|
||||||
if (rec_get_1byte_offs_flag(rec)) {
|
if (rec_get_1byte_offs_flag(rec)) {
|
||||||
offs = "TRUE";
|
offs = (char *) "TRUE";
|
||||||
} else {
|
} else {
|
||||||
offs = "FALSE";
|
offs = (char *) "FALSE";
|
||||||
}
|
}
|
||||||
|
|
||||||
n = rec_get_n_fields(rec);
|
n = rec_get_n_fields(rec);
|
||||||
|
|
|
@ -384,7 +384,7 @@ row_ins_check_foreign_constraint(
|
||||||
dictionary cache if they exist at all */
|
dictionary cache if they exist at all */
|
||||||
dict_table_t* table, /* in: if check_ref is TRUE, then the foreign
|
dict_table_t* table, /* in: if check_ref is TRUE, then the foreign
|
||||||
table, else the referenced table */
|
table, else the referenced table */
|
||||||
dict_index_t* index, /* in: index in table */
|
dict_index_t* index __attribute__((unused)),/* in: index in table */
|
||||||
dtuple_t* entry, /* in: index entry for index */
|
dtuple_t* entry, /* in: index entry for index */
|
||||||
que_thr_t* thr) /* in: query thread */
|
que_thr_t* thr) /* in: query thread */
|
||||||
{
|
{
|
||||||
|
@ -825,7 +825,7 @@ row_ins_index_entry_low(
|
||||||
que_thr_t* thr) /* in: query thread */
|
que_thr_t* thr) /* in: query thread */
|
||||||
{
|
{
|
||||||
btr_cur_t cursor;
|
btr_cur_t cursor;
|
||||||
ulint modify;
|
ulint modify = 0; /* remove warning */
|
||||||
rec_t* insert_rec;
|
rec_t* insert_rec;
|
||||||
rec_t* rec;
|
rec_t* rec;
|
||||||
ulint err;
|
ulint err;
|
||||||
|
|
|
@ -489,7 +489,7 @@ row_lock_table_autoinc_for_mysql(
|
||||||
ut_ad(trx);
|
ut_ad(trx);
|
||||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||||
|
|
||||||
trx->op_info = "setting auto-inc lock";
|
trx->op_info = (char *) "setting auto-inc lock";
|
||||||
|
|
||||||
if (node == NULL) {
|
if (node == NULL) {
|
||||||
row_get_prebuilt_insert_row(prebuilt);
|
row_get_prebuilt_insert_row(prebuilt);
|
||||||
|
@ -525,14 +525,14 @@ run_again:
|
||||||
goto run_again;
|
goto run_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
que_thr_stop_for_mysql_no_error(thr, trx);
|
que_thr_stop_for_mysql_no_error(thr, trx);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,7 @@ row_insert_for_mysql(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "inserting";
|
trx->op_info = (char *) "inserting";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ run_again:
|
||||||
goto run_again;
|
goto run_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ run_again:
|
||||||
}
|
}
|
||||||
|
|
||||||
row_update_statistics_if_needed(prebuilt);
|
row_update_statistics_if_needed(prebuilt);
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -754,7 +754,7 @@ row_update_for_mysql(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "updating or deleting";
|
trx->op_info = (char *) "updating or deleting";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ run_again:
|
||||||
|
|
||||||
if (err == DB_RECORD_NOT_FOUND) {
|
if (err == DB_RECORD_NOT_FOUND) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -842,7 +842,7 @@ run_again:
|
||||||
goto run_again;
|
goto run_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
@ -861,7 +861,7 @@ run_again:
|
||||||
|
|
||||||
row_update_statistics_if_needed(prebuilt);
|
row_update_statistics_if_needed(prebuilt);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -949,17 +949,17 @@ row_create_table_for_mysql(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "creating table";
|
trx->op_info = (char *) "creating table";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
namelen = ut_strlen(table->name);
|
namelen = ut_strlen(table->name);
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_monitor");
|
keywordlen = ut_strlen((char *) "innodb_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||||
"innodb_monitor", keywordlen)) {
|
(char *) "innodb_monitor", keywordlen)) {
|
||||||
|
|
||||||
/* Table name ends to characters innodb_monitor:
|
/* Table name ends to characters innodb_monitor:
|
||||||
start monitor prints */
|
start monitor prints */
|
||||||
|
@ -972,32 +972,34 @@ row_create_table_for_mysql(
|
||||||
os_event_set(srv_lock_timeout_thread_event);
|
os_event_set(srv_lock_timeout_thread_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
keywordlen = ut_strlen((char *) "innodb_lock_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||||
"innodb_lock_monitor", keywordlen)) {
|
(char *) "innodb_lock_monitor", keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_monitor = TRUE;
|
srv_print_innodb_monitor = TRUE;
|
||||||
srv_print_innodb_lock_monitor = TRUE;
|
srv_print_innodb_lock_monitor = TRUE;
|
||||||
os_event_set(srv_lock_timeout_thread_event);
|
os_event_set(srv_lock_timeout_thread_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
keywordlen = ut_strlen((char *) "innodb_tablespace_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||||
"innodb_tablespace_monitor", keywordlen)) {
|
(char *) "innodb_tablespace_monitor",
|
||||||
|
keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_tablespace_monitor = TRUE;
|
srv_print_innodb_tablespace_monitor = TRUE;
|
||||||
os_event_set(srv_lock_timeout_thread_event);
|
os_event_set(srv_lock_timeout_thread_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_table_monitor");
|
keywordlen = ut_strlen((char *) "innodb_table_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||||
"innodb_table_monitor", keywordlen)) {
|
(char *) "innodb_table_monitor",
|
||||||
|
keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_table_monitor = TRUE;
|
srv_print_innodb_table_monitor = TRUE;
|
||||||
os_event_set(srv_lock_timeout_thread_event);
|
os_event_set(srv_lock_timeout_thread_event);
|
||||||
|
@ -1057,7 +1059,7 @@ row_create_table_for_mysql(
|
||||||
mutex_exit(&(dict_sys->mutex));
|
mutex_exit(&(dict_sys->mutex));
|
||||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -1081,7 +1083,7 @@ row_create_index_for_mysql(
|
||||||
|
|
||||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||||
|
|
||||||
trx->op_info = "creating index";
|
trx->op_info = (char *) "creating index";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
@ -1121,7 +1123,7 @@ row_create_index_for_mysql(
|
||||||
|
|
||||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -1152,7 +1154,7 @@ row_table_add_foreign_constraints(
|
||||||
|
|
||||||
ut_a(sql_string);
|
ut_a(sql_string);
|
||||||
|
|
||||||
trx->op_info = "adding foreign keys";
|
trx->op_info = (char *) "adding foreign keys";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
@ -1226,16 +1228,16 @@ row_drop_table_for_mysql(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "dropping table";
|
trx->op_info = (char *) "dropping table";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
namelen = ut_strlen(name);
|
namelen = ut_strlen(name);
|
||||||
keywordlen = ut_strlen("innodb_monitor");
|
keywordlen = ut_strlen((char *) "innodb_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||||
"innodb_monitor", keywordlen)) {
|
(char *) "innodb_monitor", keywordlen)) {
|
||||||
|
|
||||||
/* Table name ends to characters innodb_monitor:
|
/* Table name ends to characters innodb_monitor:
|
||||||
stop monitor prints */
|
stop monitor prints */
|
||||||
|
@ -1244,30 +1246,33 @@ row_drop_table_for_mysql(
|
||||||
srv_print_innodb_lock_monitor = FALSE;
|
srv_print_innodb_lock_monitor = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
keywordlen = ut_strlen((char *) "innodb_lock_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||||
"innodb_lock_monitor", keywordlen)) {
|
(char *) "innodb_lock_monitor",
|
||||||
|
keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_monitor = FALSE;
|
srv_print_innodb_monitor = FALSE;
|
||||||
srv_print_innodb_lock_monitor = FALSE;
|
srv_print_innodb_lock_monitor = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
keywordlen = ut_strlen((char *) "innodb_tablespace_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||||
"innodb_tablespace_monitor", keywordlen)) {
|
(char *) "innodb_tablespace_monitor",
|
||||||
|
keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_tablespace_monitor = FALSE;
|
srv_print_innodb_tablespace_monitor = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
keywordlen = ut_strlen("innodb_table_monitor");
|
keywordlen = ut_strlen((char *) "innodb_table_monitor");
|
||||||
|
|
||||||
if (namelen >= keywordlen
|
if (namelen >= keywordlen
|
||||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||||
"innodb_table_monitor", keywordlen)) {
|
(char *) "innodb_table_monitor",
|
||||||
|
keywordlen)) {
|
||||||
|
|
||||||
srv_print_innodb_table_monitor = FALSE;
|
srv_print_innodb_table_monitor = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1277,7 +1282,7 @@ row_drop_table_for_mysql(
|
||||||
tables in Innobase. Deleting a row from SYS_INDEXES table also
|
tables in Innobase. Deleting a row from SYS_INDEXES table also
|
||||||
frees the file segments of the B-tree associated with the index. */
|
frees the file segments of the B-tree associated with the index. */
|
||||||
|
|
||||||
str1 =
|
str1 = (char *)
|
||||||
"PROCEDURE DROP_TABLE_PROC () IS\n"
|
"PROCEDURE DROP_TABLE_PROC () IS\n"
|
||||||
"table_name CHAR;\n"
|
"table_name CHAR;\n"
|
||||||
"sys_foreign_id CHAR;\n"
|
"sys_foreign_id CHAR;\n"
|
||||||
|
@ -1288,7 +1293,7 @@ row_drop_table_for_mysql(
|
||||||
"BEGIN\n"
|
"BEGIN\n"
|
||||||
"table_name := '";
|
"table_name := '";
|
||||||
|
|
||||||
str2 =
|
str2 = (char *)
|
||||||
"';\n"
|
"';\n"
|
||||||
"SELECT ID INTO table_id\n"
|
"SELECT ID INTO table_id\n"
|
||||||
"FROM SYS_TABLES\n"
|
"FROM SYS_TABLES\n"
|
||||||
|
@ -1423,7 +1428,7 @@ funct_exit:
|
||||||
|
|
||||||
que_graph_free(graph);
|
que_graph_free(graph);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -1445,13 +1450,13 @@ row_drop_database_for_mysql(
|
||||||
ut_a(name != NULL);
|
ut_a(name != NULL);
|
||||||
ut_a(name[strlen(name) - 1] == '/');
|
ut_a(name[strlen(name) - 1] == '/');
|
||||||
|
|
||||||
trx->op_info = "dropping database";
|
trx->op_info = (char *) "dropping database";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
mutex_enter(&(dict_sys->mutex));
|
mutex_enter(&(dict_sys->mutex));
|
||||||
|
|
||||||
while (table_name = dict_get_first_table_name_in_db(name)) {
|
while ((table_name = dict_get_first_table_name_in_db(name))) {
|
||||||
ut_a(memcmp(table_name, name, strlen(name)) == 0);
|
ut_a(memcmp(table_name, name, strlen(name)) == 0);
|
||||||
|
|
||||||
err = row_drop_table_for_mysql(table_name, trx, TRUE);
|
err = row_drop_table_for_mysql(table_name, trx, TRUE);
|
||||||
|
@ -1470,7 +1475,7 @@ row_drop_database_for_mysql(
|
||||||
|
|
||||||
trx_commit_for_mysql(trx);
|
trx_commit_for_mysql(trx);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
@ -1511,20 +1516,20 @@ row_rename_table_for_mysql(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "renaming table";
|
trx->op_info = (char *) "renaming table";
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
str1 =
|
str1 = (char *)
|
||||||
"PROCEDURE RENAME_TABLE_PROC () IS\n"
|
"PROCEDURE RENAME_TABLE_PROC () IS\n"
|
||||||
"new_table_name CHAR;\n"
|
"new_table_name CHAR;\n"
|
||||||
"old_table_name CHAR;\n"
|
"old_table_name CHAR;\n"
|
||||||
"BEGIN\n"
|
"BEGIN\n"
|
||||||
"new_table_name :='";
|
"new_table_name :='";
|
||||||
|
|
||||||
str2 =
|
str2 = (char *)
|
||||||
"';\nold_table_name := '";
|
"';\nold_table_name := '";
|
||||||
|
|
||||||
str3 =
|
str3 = (char *)
|
||||||
"';\n"
|
"';\n"
|
||||||
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
|
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
|
||||||
"WHERE NAME = old_table_name;\n"
|
"WHERE NAME = old_table_name;\n"
|
||||||
|
@ -1591,7 +1596,7 @@ funct_exit:
|
||||||
|
|
||||||
que_graph_free(graph);
|
que_graph_free(graph);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
@ -1718,7 +1723,7 @@ row_check_table_for_mysql(
|
||||||
ulint n_rows_in_table = ULINT_UNDEFINED;
|
ulint n_rows_in_table = ULINT_UNDEFINED;
|
||||||
ulint ret = DB_SUCCESS;
|
ulint ret = DB_SUCCESS;
|
||||||
|
|
||||||
prebuilt->trx->op_info = "checking table";
|
prebuilt->trx->op_info = (char *) "checking table";
|
||||||
|
|
||||||
index = dict_table_get_first_index(table);
|
index = dict_table_get_first_index(table);
|
||||||
|
|
||||||
|
@ -1751,7 +1756,7 @@ row_check_table_for_mysql(
|
||||||
index = dict_table_get_next_index(index);
|
index = dict_table_get_next_index(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
prebuilt->trx->op_info = "";
|
prebuilt->trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ row_purge_remove_sec_if_poss_low(
|
||||||
btr_pcur_t pcur;
|
btr_pcur_t pcur;
|
||||||
btr_cur_t* btr_cur;
|
btr_cur_t* btr_cur;
|
||||||
ibool success;
|
ibool success;
|
||||||
ibool old_has;
|
ibool old_has = 0; /* remove warning */
|
||||||
ibool found;
|
ibool found;
|
||||||
ulint err;
|
ulint err;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
|
|
@ -64,7 +64,8 @@ row_sel_sec_rec_is_for_clust_rec(
|
||||||
rec_t* sec_rec, /* in: secondary index record */
|
rec_t* sec_rec, /* in: secondary index record */
|
||||||
dict_index_t* sec_index, /* in: secondary index */
|
dict_index_t* sec_index, /* in: secondary index */
|
||||||
rec_t* clust_rec, /* in: clustered index record */
|
rec_t* clust_rec, /* in: clustered index record */
|
||||||
dict_index_t* clust_index) /* in: clustered index */
|
dict_index_t* clust_index __attribute__((unused)))
|
||||||
|
/* in: clustered index */
|
||||||
{
|
{
|
||||||
dict_col_t* col;
|
dict_col_t* col;
|
||||||
byte* sec_field;
|
byte* sec_field;
|
||||||
|
@ -2498,7 +2499,7 @@ row_search_for_mysql(
|
||||||
printf("N tables locked %lu\n", trx->mysql_n_tables_locked);
|
printf("N tables locked %lu\n", trx->mysql_n_tables_locked);
|
||||||
*/
|
*/
|
||||||
if (direction == 0) {
|
if (direction == 0) {
|
||||||
trx->op_info = "starting index read";
|
trx->op_info = (char *) "starting index read";
|
||||||
|
|
||||||
prebuilt->n_rows_fetched = 0;
|
prebuilt->n_rows_fetched = 0;
|
||||||
prebuilt->n_fetch_cached = 0;
|
prebuilt->n_fetch_cached = 0;
|
||||||
|
@ -2509,7 +2510,7 @@ row_search_for_mysql(
|
||||||
row_prebuild_sel_graph(prebuilt);
|
row_prebuild_sel_graph(prebuilt);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
trx->op_info = "fetching rows";
|
trx->op_info = (char *) "fetching rows";
|
||||||
|
|
||||||
if (prebuilt->n_rows_fetched == 0) {
|
if (prebuilt->n_rows_fetched == 0) {
|
||||||
prebuilt->fetch_direction = direction;
|
prebuilt->fetch_direction = direction;
|
||||||
|
@ -2534,7 +2535,7 @@ row_search_for_mysql(
|
||||||
prebuilt->n_rows_fetched++;
|
prebuilt->n_rows_fetched++;
|
||||||
|
|
||||||
srv_n_rows_read++;
|
srv_n_rows_read++;
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(DB_SUCCESS);
|
return(DB_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -2546,7 +2547,7 @@ row_search_for_mysql(
|
||||||
cache, but the cache was not full at the time of the
|
cache, but the cache was not full at the time of the
|
||||||
popping: no more rows can exist in the result set */
|
popping: no more rows can exist in the result set */
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
return(DB_RECORD_NOT_FOUND);
|
return(DB_RECORD_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2578,7 +2579,7 @@ row_search_for_mysql(
|
||||||
|
|
||||||
/* printf("%s record not found 1\n", index->name); */
|
/* printf("%s record not found 1\n", index->name); */
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
return(DB_RECORD_NOT_FOUND);
|
return(DB_RECORD_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2638,7 +2639,7 @@ row_search_for_mysql(
|
||||||
trx->has_search_latch = FALSE;
|
trx->has_search_latch = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
return(DB_SUCCESS);
|
return(DB_SUCCESS);
|
||||||
|
|
||||||
} else if (shortcut == SEL_EXHAUSTED) {
|
} else if (shortcut == SEL_EXHAUSTED) {
|
||||||
|
@ -2657,7 +2658,7 @@ row_search_for_mysql(
|
||||||
trx->has_search_latch = FALSE;
|
trx->has_search_latch = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
return(DB_RECORD_NOT_FOUND);
|
return(DB_RECORD_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3029,7 +3030,7 @@ lock_wait_or_error:
|
||||||
|
|
||||||
/* printf("Using index %s cnt %lu ret value %lu err\n", index->name,
|
/* printf("Using index %s cnt %lu ret value %lu err\n", index->name,
|
||||||
cnt, err); */
|
cnt, err); */
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
|
|
||||||
|
@ -3050,7 +3051,7 @@ normal_return:
|
||||||
srv_n_rows_read++;
|
srv_n_rows_read++;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ void
|
||||||
row_undo_ins_parse_undo_rec(
|
row_undo_ins_parse_undo_rec(
|
||||||
/*========================*/
|
/*========================*/
|
||||||
undo_node_t* node, /* in: row undo node */
|
undo_node_t* node, /* in: row undo node */
|
||||||
que_thr_t* thr) /* in: query thread */
|
que_thr_t* thr __attribute__((unused))) /* in: query thread */
|
||||||
{
|
{
|
||||||
dict_index_t* clust_index;
|
dict_index_t* clust_index;
|
||||||
byte* ptr;
|
byte* ptr;
|
||||||
|
|
|
@ -139,7 +139,7 @@ row_undo_mod_remove_clust_low(
|
||||||
/* out: DB_SUCCESS, DB_FAIL, or error code:
|
/* out: DB_SUCCESS, DB_FAIL, or error code:
|
||||||
we may run out of file space */
|
we may run out of file space */
|
||||||
undo_node_t* node, /* in: row undo node */
|
undo_node_t* node, /* in: row undo node */
|
||||||
que_thr_t* thr, /* in: query thread */
|
que_thr_t* thr __attribute__((unused)), /* in: query thread */
|
||||||
mtr_t* mtr, /* in: mtr */
|
mtr_t* mtr, /* in: mtr */
|
||||||
ulint mode) /* in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
|
ulint mode) /* in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
|
||||||
{
|
{
|
||||||
|
|
|
@ -388,7 +388,7 @@ row_upd_write_sys_vals_to_log(
|
||||||
dulint roll_ptr,/* in: roll ptr of the undo log record */
|
dulint roll_ptr,/* in: roll ptr of the undo log record */
|
||||||
byte* log_ptr,/* pointer to a buffer of size > 20 opened
|
byte* log_ptr,/* pointer to a buffer of size > 20 opened
|
||||||
in mlog */
|
in mlog */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr __attribute__((unused))) /* in: mtr */
|
||||||
{
|
{
|
||||||
ut_ad(index->type & DICT_CLUSTERED);
|
ut_ad(index->type & DICT_CLUSTERED);
|
||||||
ut_ad(mtr);
|
ut_ad(mtr);
|
||||||
|
|
|
@ -57,7 +57,7 @@ ulint srv_activity_count = 0;
|
||||||
ibool srv_lock_timeout_and_monitor_active = FALSE;
|
ibool srv_lock_timeout_and_monitor_active = FALSE;
|
||||||
ibool srv_error_monitor_active = FALSE;
|
ibool srv_error_monitor_active = FALSE;
|
||||||
|
|
||||||
char* srv_main_thread_op_info = "";
|
char* srv_main_thread_op_info = (char *) "";
|
||||||
|
|
||||||
/* Server parameters which are read from the initfile */
|
/* Server parameters which are read from the initfile */
|
||||||
|
|
||||||
|
@ -929,6 +929,7 @@ srv_communication_init(
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Implements the recovery utility. */
|
Implements the recovery utility. */
|
||||||
|
#ifdef NOT_USED
|
||||||
static
|
static
|
||||||
ulint
|
ulint
|
||||||
srv_recovery_thread(
|
srv_recovery_thread(
|
||||||
|
@ -966,7 +967,7 @@ srv_recovery_thread(
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Implements the purge utility. */
|
Implements the purge utility. */
|
||||||
|
|
||||||
|
@ -1018,6 +1019,7 @@ srv_create_utility_threads(void)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Implements the communication threads. */
|
Implements the communication threads. */
|
||||||
|
#ifdef NOT_USED
|
||||||
static
|
static
|
||||||
ulint
|
ulint
|
||||||
srv_com_thread(
|
srv_com_thread(
|
||||||
|
@ -1065,7 +1067,7 @@ srv_com_thread(
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Creates the communication threads. */
|
Creates the communication threads. */
|
||||||
|
|
||||||
|
@ -1087,6 +1089,7 @@ srv_create_com_threads(void)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Implements the worker threads. */
|
Implements the worker threads. */
|
||||||
|
#ifdef NOT_USED
|
||||||
static
|
static
|
||||||
ulint
|
ulint
|
||||||
srv_worker_thread(
|
srv_worker_thread(
|
||||||
|
@ -1129,7 +1132,7 @@ srv_worker_thread(
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Creates the worker threads. */
|
Creates the worker threads. */
|
||||||
|
|
||||||
|
@ -2283,7 +2286,7 @@ srv_master_thread(
|
||||||
|
|
||||||
os_event_set(srv_sys->operational);
|
os_event_set(srv_sys->operational);
|
||||||
loop:
|
loop:
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read
|
n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read
|
||||||
+ buf_pool->n_pages_written;
|
+ buf_pool->n_pages_written;
|
||||||
|
@ -2299,7 +2302,7 @@ loop:
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
|
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
|
||||||
+ buf_pool->n_pages_written;
|
+ buf_pool->n_pages_written;
|
||||||
srv_main_thread_op_info = "sleeping";
|
srv_main_thread_op_info = (char *) "sleeping";
|
||||||
os_thread_sleep(1000000);
|
os_thread_sleep(1000000);
|
||||||
|
|
||||||
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
|
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
|
||||||
|
@ -2311,7 +2314,7 @@ loop:
|
||||||
is issued or the we have specified in my.cnf no flush
|
is issued or the we have specified in my.cnf no flush
|
||||||
at transaction commit */
|
at transaction commit */
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing log";
|
srv_main_thread_op_info = (char *) "flushing log";
|
||||||
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
||||||
|
|
||||||
/* If there were less than 10 i/os during the
|
/* If there were less than 10 i/os during the
|
||||||
|
@ -2324,10 +2327,11 @@ loop:
|
||||||
n_ios = log_sys->n_log_ios + buf_pool->n_pages_read
|
n_ios = log_sys->n_log_ios + buf_pool->n_pages_read
|
||||||
+ buf_pool->n_pages_written;
|
+ buf_pool->n_pages_written;
|
||||||
if (n_pend_ios < 3 && (n_ios - n_ios_old < 10)) {
|
if (n_pend_ios < 3 && (n_ios - n_ios_old < 10)) {
|
||||||
srv_main_thread_op_info = "doing insert buffer merge";
|
srv_main_thread_op_info =
|
||||||
|
(char *) "doing insert buffer merge";
|
||||||
ibuf_contract_for_n_pages(TRUE, 5);
|
ibuf_contract_for_n_pages(TRUE, 5);
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing log";
|
srv_main_thread_op_info = (char *) "flushing log";
|
||||||
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2359,20 +2363,20 @@ loop:
|
||||||
+ buf_pool->n_pages_written;
|
+ buf_pool->n_pages_written;
|
||||||
if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) {
|
if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) {
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing buffer pool pages";
|
srv_main_thread_op_info =(char *) "flushing buffer pool pages";
|
||||||
buf_flush_batch(BUF_FLUSH_LIST, 50, ut_dulint_max);
|
buf_flush_batch(BUF_FLUSH_LIST, 50, ut_dulint_max);
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing log";
|
srv_main_thread_op_info = (char *) "flushing log";
|
||||||
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We run a batch of insert buffer merge every 10 seconds,
|
/* We run a batch of insert buffer merge every 10 seconds,
|
||||||
even if the server were active */
|
even if the server were active */
|
||||||
|
|
||||||
srv_main_thread_op_info = "doing insert buffer merge";
|
srv_main_thread_op_info = (char *) "doing insert buffer merge";
|
||||||
ibuf_contract_for_n_pages(TRUE, 5);
|
ibuf_contract_for_n_pages(TRUE, 5);
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing log";
|
srv_main_thread_op_info = (char *) "flushing log";
|
||||||
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
||||||
|
|
||||||
/* We run a full purge every 10 seconds, even if the server
|
/* We run a full purge every 10 seconds, even if the server
|
||||||
|
@ -2389,13 +2393,13 @@ loop:
|
||||||
goto background_loop;
|
goto background_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv_main_thread_op_info = "purging";
|
srv_main_thread_op_info = (char *) "purging";
|
||||||
n_pages_purged = trx_purge();
|
n_pages_purged = trx_purge();
|
||||||
|
|
||||||
current_time = time(NULL);
|
current_time = time(NULL);
|
||||||
|
|
||||||
if (difftime(current_time, last_flush_time) > 1) {
|
if (difftime(current_time, last_flush_time) > 1) {
|
||||||
srv_main_thread_op_info = "flushing log";
|
srv_main_thread_op_info = (char *) "flushing log";
|
||||||
|
|
||||||
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
|
||||||
last_flush_time = current_time;
|
last_flush_time = current_time;
|
||||||
|
@ -2406,7 +2410,7 @@ background_loop:
|
||||||
/* In this loop we run background operations when the server
|
/* In this loop we run background operations when the server
|
||||||
is quiet */
|
is quiet */
|
||||||
|
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
if (srv_activity_count != old_activity_count) {
|
if (srv_activity_count != old_activity_count) {
|
||||||
|
@ -2419,11 +2423,11 @@ background_loop:
|
||||||
/* The server has been quiet for a while: start running background
|
/* The server has been quiet for a while: start running background
|
||||||
operations */
|
operations */
|
||||||
|
|
||||||
srv_main_thread_op_info = "purging";
|
srv_main_thread_op_info = (char *) "purging";
|
||||||
|
|
||||||
n_pages_purged = trx_purge();
|
n_pages_purged = trx_purge();
|
||||||
|
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
if (srv_activity_count != old_activity_count) {
|
if (srv_activity_count != old_activity_count) {
|
||||||
|
@ -2432,10 +2436,10 @@ background_loop:
|
||||||
}
|
}
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
srv_main_thread_op_info = "doing insert buffer merge";
|
srv_main_thread_op_info = (char *) "doing insert buffer merge";
|
||||||
n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
|
n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
|
||||||
|
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
if (srv_activity_count != old_activity_count) {
|
if (srv_activity_count != old_activity_count) {
|
||||||
|
@ -2444,10 +2448,10 @@ background_loop:
|
||||||
}
|
}
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
srv_main_thread_op_info = "flushing buffer pool pages";
|
srv_main_thread_op_info = (char *) "flushing buffer pool pages";
|
||||||
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
|
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
|
||||||
|
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
if (srv_activity_count != old_activity_count) {
|
if (srv_activity_count != old_activity_count) {
|
||||||
|
@ -2456,14 +2460,15 @@ background_loop:
|
||||||
}
|
}
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
srv_main_thread_op_info = "waiting for buffer pool flush to end";
|
srv_main_thread_op_info =
|
||||||
|
(char *) "waiting for buffer pool flush to end";
|
||||||
buf_flush_wait_batch_end(BUF_FLUSH_LIST);
|
buf_flush_wait_batch_end(BUF_FLUSH_LIST);
|
||||||
|
|
||||||
srv_main_thread_op_info = "making checkpoint";
|
srv_main_thread_op_info = (char *) "making checkpoint";
|
||||||
|
|
||||||
log_checkpoint(TRUE, FALSE);
|
log_checkpoint(TRUE, FALSE);
|
||||||
|
|
||||||
srv_main_thread_op_info = "reserving kernel mutex";
|
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
if (srv_activity_count != old_activity_count) {
|
if (srv_activity_count != old_activity_count) {
|
||||||
|
@ -2472,7 +2477,8 @@ background_loop:
|
||||||
}
|
}
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
srv_main_thread_op_info = "archiving log (if log archive is on)";
|
srv_main_thread_op_info =
|
||||||
|
(char *) "archiving log (if log archive is on)";
|
||||||
|
|
||||||
log_archive_do(FALSE, &n_bytes_archived);
|
log_archive_do(FALSE, &n_bytes_archived);
|
||||||
|
|
||||||
|
@ -2496,7 +2502,7 @@ background_loop:
|
||||||
master thread to wait for more server activity */
|
master thread to wait for more server activity */
|
||||||
|
|
||||||
suspend_thread:
|
suspend_thread:
|
||||||
srv_main_thread_op_info = "suspending";
|
srv_main_thread_op_info = (char *) "suspending";
|
||||||
|
|
||||||
mutex_enter(&kernel_mutex);
|
mutex_enter(&kernel_mutex);
|
||||||
|
|
||||||
|
@ -2504,7 +2510,7 @@ suspend_thread:
|
||||||
|
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
srv_main_thread_op_info = "waiting for server activity";
|
srv_main_thread_op_info = (char *) "waiting for server activity";
|
||||||
|
|
||||||
os_event_wait(event);
|
os_event_wait(event);
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,8 @@ static
|
||||||
void
|
void
|
||||||
srv_normalize_path_for_win(
|
srv_normalize_path_for_win(
|
||||||
/*=======================*/
|
/*=======================*/
|
||||||
char* str) /* in/out: null-terminated character string */
|
char* str __attribute__((unused)))
|
||||||
|
/* in/out: null-terminated character string */
|
||||||
{
|
{
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
ulint i;
|
ulint i;
|
||||||
|
@ -311,7 +312,8 @@ open_or_create_log_file(
|
||||||
if (k == 0 && i == 0) {
|
if (k == 0 && i == 0) {
|
||||||
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
|
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
|
||||||
|
|
||||||
fil_space_create("arch_log_space", arch_space_id, FIL_LOG);
|
fil_space_create((char *) "arch_log_space", arch_space_id,
|
||||||
|
FIL_LOG);
|
||||||
} else {
|
} else {
|
||||||
arch_space_id = ULINT_UNDEFINED;
|
arch_space_id = ULINT_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
@ -509,6 +511,7 @@ open_or_create_data_files(
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
This thread is used to measure contention of latches. */
|
This thread is used to measure contention of latches. */
|
||||||
|
#ifdef NOT_USED
|
||||||
static
|
static
|
||||||
ulint
|
ulint
|
||||||
test_measure_cont(
|
test_measure_cont(
|
||||||
|
@ -578,7 +581,7 @@ test_measure_cont(
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
Starts InnoDB and creates a new database if database files
|
Starts InnoDB and creates a new database if database files
|
||||||
are not found and the user wants. Server parameters are
|
are not found and the user wants. Server parameters are
|
||||||
|
@ -610,18 +613,21 @@ innobase_start_or_create_for_mysql(void)
|
||||||
srv_is_being_started = TRUE;
|
srv_is_being_started = TRUE;
|
||||||
srv_startup_is_before_trx_rollback_phase = TRUE;
|
srv_startup_is_before_trx_rollback_phase = TRUE;
|
||||||
|
|
||||||
if (0 == ut_strcmp(srv_unix_file_flush_method_str, "fdatasync")) {
|
if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||||
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
|
(char *) "fdatasync")) {
|
||||||
|
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
|
||||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str, "O_DSYNC")) {
|
|
||||||
srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
|
|
||||||
|
|
||||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||||
"littlesync")) {
|
(char *) "O_DSYNC")) {
|
||||||
srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
|
srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
|
||||||
|
|
||||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str, "nosync")) {
|
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||||
srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
|
(char *) "littlesync")) {
|
||||||
|
srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
|
||||||
|
|
||||||
|
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||||
|
(char *) "nosync")) {
|
||||||
|
srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Unrecognized value %s for innodb_flush_method\n",
|
"InnoDB: Unrecognized value %s for innodb_flush_method\n",
|
||||||
|
|
|
@ -446,7 +446,7 @@ sync_array_cell_print(
|
||||||
{
|
{
|
||||||
mutex_t* mutex;
|
mutex_t* mutex;
|
||||||
rw_lock_t* rwlock;
|
rw_lock_t* rwlock;
|
||||||
char* str = NULL;
|
char* str __attribute__((unused)) = NULL;
|
||||||
ulint type;
|
ulint type;
|
||||||
|
|
||||||
type = cell->request_type;
|
type = cell->request_type;
|
||||||
|
|
|
@ -115,8 +115,8 @@ rw_lock_create_func(
|
||||||
lock->cfile_name = cfile_name;
|
lock->cfile_name = cfile_name;
|
||||||
lock->cline = cline;
|
lock->cline = cline;
|
||||||
|
|
||||||
lock->last_s_file_name = "not yet reserved";
|
lock->last_s_file_name = (char *) "not yet reserved";
|
||||||
lock->last_x_file_name = "not yet reserved";
|
lock->last_x_file_name = (char *) "not yet reserved";
|
||||||
lock->last_s_line = 0;
|
lock->last_s_line = 0;
|
||||||
lock->last_x_line = 0;
|
lock->last_x_line = 0;
|
||||||
|
|
||||||
|
@ -789,7 +789,7 @@ Prints debug info of an rw-lock. */
|
||||||
void
|
void
|
||||||
rw_lock_print(
|
rw_lock_print(
|
||||||
/*==========*/
|
/*==========*/
|
||||||
rw_lock_t* lock) /* in: rw-lock */
|
rw_lock_t* lock __attribute__((unused))) /* in: rw-lock */
|
||||||
{
|
{
|
||||||
#ifndef UNIV_SYNC_DEBUG
|
#ifndef UNIV_SYNC_DEBUG
|
||||||
printf(
|
printf(
|
||||||
|
|
|
@ -229,7 +229,7 @@ mutex_create_func(
|
||||||
mutex_set_waiters(mutex, 0);
|
mutex_set_waiters(mutex, 0);
|
||||||
mutex->magic_n = MUTEX_MAGIC_N;
|
mutex->magic_n = MUTEX_MAGIC_N;
|
||||||
mutex->line = 0;
|
mutex->line = 0;
|
||||||
mutex->file_name = "not yet reserved";
|
mutex->file_name = (char *) "not yet reserved";
|
||||||
mutex->thread_id = ULINT_UNDEFINED;
|
mutex->thread_id = ULINT_UNDEFINED;
|
||||||
mutex->level = SYNC_LEVEL_NONE;
|
mutex->level = SYNC_LEVEL_NONE;
|
||||||
mutex->cfile_name = cfile_name;
|
mutex->cfile_name = cfile_name;
|
||||||
|
|
|
@ -674,9 +674,9 @@ trx_purge_choose_next_log(void)
|
||||||
trx_rseg_t* rseg;
|
trx_rseg_t* rseg;
|
||||||
trx_rseg_t* min_rseg;
|
trx_rseg_t* min_rseg;
|
||||||
dulint min_trx_no;
|
dulint min_trx_no;
|
||||||
ulint space;
|
ulint space = 0; /* remove warning (??? bug ???) */
|
||||||
ulint page_no;
|
ulint page_no = 0; /* remove warning (??? bug ???) */
|
||||||
ulint offset;
|
ulint offset = 0; /* remove warning (??? bug ???) */
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
|
||||||
ut_ad(mutex_own(&(purge_sys->mutex)));
|
ut_ad(mutex_own(&(purge_sys->mutex)));
|
||||||
|
|
|
@ -989,7 +989,7 @@ trx_undo_parse_erase_page_end(
|
||||||
/*==========================*/
|
/*==========================*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page, /* in: page or NULL */
|
page_t* page, /* in: page or NULL */
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
|
@ -1263,7 +1263,8 @@ trx_undo_prev_version_build(
|
||||||
DB_ERROR if corrupted record */
|
DB_ERROR if corrupted record */
|
||||||
rec_t* index_rec,/* in: clustered index record in the
|
rec_t* index_rec,/* in: clustered index record in the
|
||||||
index tree */
|
index tree */
|
||||||
mtr_t* index_mtr,/* in: mtr which contains the latch to
|
mtr_t* index_mtr __attribute__((unused)),
|
||||||
|
/* in: mtr which contains the latch to
|
||||||
index_rec page and purge_view */
|
index_rec page and purge_view */
|
||||||
rec_t* rec, /* in: version of a clustered index record */
|
rec_t* rec, /* in: version of a clustered index record */
|
||||||
dict_index_t* index, /* in: clustered index */
|
dict_index_t* index, /* in: clustered index */
|
||||||
|
|
|
@ -101,7 +101,7 @@ trx_rollback_for_mysql(
|
||||||
return(DB_SUCCESS);
|
return(DB_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "rollback";
|
trx->op_info = (char *) "rollback";
|
||||||
|
|
||||||
/* Tell Innobase server that there might be work for
|
/* Tell Innobase server that there might be work for
|
||||||
utility threads: */
|
utility threads: */
|
||||||
|
@ -117,7 +117,7 @@ trx_rollback_for_mysql(
|
||||||
|
|
||||||
srv_active_wake_master_thread();
|
srv_active_wake_master_thread();
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ trx_rollback_last_sql_stat_for_mysql(
|
||||||
return(DB_SUCCESS);
|
return(DB_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "rollback of SQL statement";
|
trx->op_info = (char *) "rollback of SQL statement";
|
||||||
|
|
||||||
/* Tell Innobase server that there might be work for
|
/* Tell Innobase server that there might be work for
|
||||||
utility threads: */
|
utility threads: */
|
||||||
|
@ -154,7 +154,7 @@ trx_rollback_last_sql_stat_for_mysql(
|
||||||
|
|
||||||
srv_active_wake_master_thread();
|
srv_active_wake_master_thread();
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ trx_rollback_all_without_sess(void)
|
||||||
|
|
||||||
if (!trx_dummy_sess) {
|
if (!trx_dummy_sess) {
|
||||||
trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
|
trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
|
||||||
ut_strlen("Dummy sess"));
|
ut_strlen((char *) "Dummy sess"));
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
|
@ -64,7 +64,7 @@ trx_create(
|
||||||
|
|
||||||
trx = mem_alloc(sizeof(trx_t));
|
trx = mem_alloc(sizeof(trx_t));
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
trx->type = TRX_USER;
|
trx->type = TRX_USER;
|
||||||
trx->conc_state = TRX_NOT_STARTED;
|
trx->conc_state = TRX_NOT_STARTED;
|
||||||
|
@ -135,7 +135,7 @@ trx_allocate_for_mysql(void)
|
||||||
|
|
||||||
if (!trx_dummy_sess) {
|
if (!trx_dummy_sess) {
|
||||||
trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
|
trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
|
||||||
ut_strlen("Dummy sess"));
|
ut_strlen((char *) "Dummy sess"));
|
||||||
}
|
}
|
||||||
|
|
||||||
trx = trx_create(trx_dummy_sess);
|
trx = trx_create(trx_dummy_sess);
|
||||||
|
@ -991,7 +991,7 @@ trx_sig_send(
|
||||||
ut_a(0);
|
ut_a(0);
|
||||||
|
|
||||||
sess_raise_error_low(trx, 0, 0, NULL, NULL, NULL, NULL,
|
sess_raise_error_low(trx, 0, 0, NULL, NULL, NULL, NULL,
|
||||||
"Signal from another session, or a break execution signal");
|
(char *) "Signal from another session, or a break execution signal");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there were no other signals ahead in the queue, try to start
|
/* If there were no other signals ahead in the queue, try to start
|
||||||
|
@ -1292,7 +1292,7 @@ trx_commit_for_mysql(
|
||||||
|
|
||||||
ut_a(trx);
|
ut_a(trx);
|
||||||
|
|
||||||
trx->op_info = "committing";
|
trx->op_info = (char *) "committing";
|
||||||
|
|
||||||
trx_start_if_not_started(trx);
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
@ -1302,7 +1302,7 @@ trx_commit_for_mysql(
|
||||||
|
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = (char *) "";
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,7 @@ trx_undo_seg_create(
|
||||||
/*================*/
|
/*================*/
|
||||||
/* out: segment header page x-latched, NULL
|
/* out: segment header page x-latched, NULL
|
||||||
if no space left */
|
if no space left */
|
||||||
trx_rseg_t* rseg, /* in: rollback segment */
|
trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */
|
||||||
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
|
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
|
||||||
x-latched */
|
x-latched */
|
||||||
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
|
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
|
||||||
|
@ -657,7 +657,7 @@ trx_undo_parse_discard_latest(
|
||||||
/*==========================*/
|
/*==========================*/
|
||||||
/* out: end of log record or NULL */
|
/* out: end of log record or NULL */
|
||||||
byte* ptr, /* in: buffer */
|
byte* ptr, /* in: buffer */
|
||||||
byte* end_ptr,/* in: buffer end */
|
byte* end_ptr __attribute__((unused)), /* in: buffer end */
|
||||||
page_t* page, /* in: page or NULL */
|
page_t* page, /* in: page or NULL */
|
||||||
mtr_t* mtr) /* in: mtr or NULL */
|
mtr_t* mtr) /* in: mtr or NULL */
|
||||||
{
|
{
|
||||||
|
@ -844,7 +844,7 @@ static
|
||||||
void
|
void
|
||||||
trx_undo_free_page_in_rollback(
|
trx_undo_free_page_in_rollback(
|
||||||
/*===========================*/
|
/*===========================*/
|
||||||
trx_t* trx, /* in: transaction */
|
trx_t* trx __attribute__((unused)), /* in: transaction */
|
||||||
trx_undo_t* undo, /* in: undo log memory copy */
|
trx_undo_t* undo, /* in: undo log memory copy */
|
||||||
ulint page_no,/* in: page number to free: must not be the
|
ulint page_no,/* in: page number to free: must not be the
|
||||||
header page */
|
header page */
|
||||||
|
@ -1560,7 +1560,7 @@ trx_undo_set_state_at_finish(
|
||||||
/*=========================*/
|
/*=========================*/
|
||||||
/* out: undo log segment header page,
|
/* out: undo log segment header page,
|
||||||
x-latched */
|
x-latched */
|
||||||
trx_t* trx, /* in: transaction */
|
trx_t* trx __attribute__((unused)), /* in: transaction */
|
||||||
trx_undo_t* undo, /* in: undo log memory copy */
|
trx_undo_t* undo, /* in: undo log memory copy */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue