mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge stuff
This commit is contained in:
578
Docs/manual.texi
578
Docs/manual.texi
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,7 @@
|
||||
#include <signal.h>
|
||||
#include <violite.h>
|
||||
|
||||
const char *VER="11.16";
|
||||
const char *VER="11.17";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
@ -129,6 +129,7 @@ static String glob_buffer,old_buffer;
|
||||
static int wait_time = 5;
|
||||
static STATUS status;
|
||||
static ulong select_limit,max_join_size,opt_connect_timeout=0;
|
||||
char mysql_charsets_dir[FN_REFLEN+1];
|
||||
static const char *xmlmeta[] = {
|
||||
"&", "&",
|
||||
"<", "<",
|
||||
@ -609,7 +610,8 @@ static int get_options(int argc, char **argv)
|
||||
default_charset= optarg;
|
||||
break;
|
||||
case OPT_CHARSETS_DIR:
|
||||
charsets_dir= optarg;
|
||||
strmov(mysql_charsets_dir, optarg);
|
||||
charsets_dir = mysql_charsets_dir;
|
||||
break;
|
||||
case OPT_TEE:
|
||||
if (!opt_outfile && strlen(optarg))
|
||||
|
@ -31,7 +31,9 @@
|
||||
** SSL by
|
||||
** Andrei Errapart <andreie@no.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"
|
||||
|
||||
@ -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,
|
||||
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_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 char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
|
||||
*current_host=0,*path=0,*fields_terminated=0,
|
||||
@ -135,6 +138,7 @@ static struct option long_options[] =
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{"version", no_argument, 0, 'V'},
|
||||
{"where", required_argument, 0, 'w'},
|
||||
{"xml", no_argument, 0, 'X'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -248,6 +252,7 @@ puts("\
|
||||
-v, --verbose Print info about the various stages.\n\
|
||||
-V, --version Output version information and exit.\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\
|
||||
EXAMPLES: \"--where=user=\'jimf\'\" \"-wuserid>1\" \"-wuserid<1\"\n\
|
||||
Use -T (--tab=...) with --fields-...\n\
|
||||
@ -274,13 +279,18 @@ puts("\
|
||||
|
||||
static void write_heder(FILE *sql_file, char *db_name)
|
||||
{
|
||||
fprintf(sql_file, "-- MySQL dump %s\n--\n", DUMP_VERSION);
|
||||
fprintf(sql_file, "-- Host: %s Database: %s\n",
|
||||
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));
|
||||
if (opt_xml)
|
||||
fprintf(sql_file,"<?xml version=\"1.0\"?>\n");
|
||||
else
|
||||
{
|
||||
fprintf(sql_file, "-- MySQL dump %s\n--\n", DUMP_VERSION);
|
||||
fprintf(sql_file, "-- Host: %s Database: %s\n",
|
||||
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;
|
||||
} /* write_heder */
|
||||
|
||||
@ -294,7 +304,7 @@ static int get_options(int *argc,char ***argv)
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
set_all_changeable_vars(md_changeable_vars);
|
||||
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)
|
||||
{
|
||||
switch(c) {
|
||||
@ -397,6 +407,7 @@ static int get_options(int *argc,char ***argv)
|
||||
case 'w':
|
||||
where=optarg;
|
||||
break;
|
||||
case 'X': opt_xml = 1; break;
|
||||
case 'x':
|
||||
opt_first_slave=1;
|
||||
break;
|
||||
@ -563,7 +574,7 @@ static void unescape(FILE *file,char *pos,uint length)
|
||||
ignore_errors=0; /* Fatal error */
|
||||
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);
|
||||
fputs(tmp, file);
|
||||
fputc('\'', file);
|
||||
@ -649,13 +660,16 @@ static uint getTableStructure(char *table, char* 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)
|
||||
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
|
||||
|
||||
tableRes=mysql_store_result(sock);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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)
|
||||
fprintf(sql_file, "DROP TABLE IF EXISTS %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])
|
||||
{
|
||||
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])
|
||||
fputs(" NOT NULL", sql_file);
|
||||
@ -977,14 +993,18 @@ static void dumpTable(uint numFields, char *table)
|
||||
}
|
||||
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));
|
||||
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);
|
||||
}
|
||||
fputs("\n\n", md_result_file);
|
||||
if (!opt_xml)
|
||||
fputs("\n\n", md_result_file);
|
||||
if (mysql_query(sock, query))
|
||||
{
|
||||
DBerror(sock, "when retrieving data from server");
|
||||
@ -1017,6 +1037,8 @@ static void dumpTable(uint numFields, char *table)
|
||||
row_break=0;
|
||||
rownr=0;
|
||||
init_length=(uint) strlen(insert_pat)+4;
|
||||
if (opt_xml)
|
||||
fprintf(md_result_file, "\t<%s>\n", table);
|
||||
|
||||
if (opt_autocommit)
|
||||
fprintf(md_result_file, "set autocommit=0;\n");
|
||||
@ -1026,7 +1048,7 @@ static void dumpTable(uint numFields, char *table)
|
||||
uint i;
|
||||
ulong *lengths=mysql_fetch_lengths(res);
|
||||
rownr++;
|
||||
if (!extended_insert)
|
||||
if (!extended_insert && !opt_xml)
|
||||
fputs(insert_pat,md_result_file);
|
||||
mysql_field_seek(res,0);
|
||||
|
||||
@ -1085,22 +1107,36 @@ static void dumpTable(uint numFields, char *table)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i)
|
||||
fputc(',',md_result_file);
|
||||
if (i && !opt_xml)
|
||||
fputc(',', md_result_file);
|
||||
if (row[i])
|
||||
{
|
||||
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
|
||||
{
|
||||
/* change any strings ("inf","nan",..) into NULL */
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
if (row_break)
|
||||
if (row_break && !opt_xml)
|
||||
fputs(";\n", md_result_file);
|
||||
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;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!opt_xml)
|
||||
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 */
|
||||
fflush(md_result_file);
|
||||
if (mysql_errno(sock))
|
||||
@ -1204,9 +1248,14 @@ static int dump_databases(char **db_names)
|
||||
{
|
||||
int result=0;
|
||||
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))
|
||||
result=1;
|
||||
if (opt_xml)
|
||||
fprintf(md_result_file, "</%s>\n", *db_names);
|
||||
}
|
||||
return result;
|
||||
} /* dump_databases */
|
||||
|
@ -35,7 +35,6 @@ struct _ft_vft {
|
||||
float (*find_relevance)(FT_INFO *, my_off_t, byte *);
|
||||
void (*close_search)(FT_INFO *);
|
||||
float (*get_relevance)(FT_INFO *);
|
||||
my_off_t (*get_docid)(FT_INFO *);
|
||||
void (*reinit_search)(FT_INFO *);
|
||||
};
|
||||
|
||||
|
@ -53,6 +53,7 @@ void delete_queue(QUEUE *queue);
|
||||
void queue_insert(QUEUE *queue,byte *element);
|
||||
byte *queue_remove(QUEUE *queue,uint idx);
|
||||
void _downheap(QUEUE *queue,uint idx);
|
||||
void queue_fix(QUEUE *queue);
|
||||
#define is_queue_inited(queue) ((queue)->root != 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -837,7 +837,7 @@ btr_parse_page_reorganize(
|
||||
/*======================*/
|
||||
/* out: end of log record or NULL */
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
@ -1438,7 +1438,7 @@ btr_page_split_and_insert(
|
||||
page_t* insert_page;
|
||||
page_cur_t* page_cursor;
|
||||
rec_t* first_rec;
|
||||
byte* buf;
|
||||
byte* buf = 0; /* remove warning */
|
||||
rec_t* move_limit;
|
||||
ibool insert_will_fit;
|
||||
ulint n_iterations = 0;
|
||||
@ -1616,7 +1616,7 @@ static
|
||||
void
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
@ -2338,7 +2338,7 @@ btr_validate_level(
|
||||
{
|
||||
ulint space;
|
||||
page_t* page;
|
||||
page_t* right_page;
|
||||
page_t* right_page = 0; /* remove warning */
|
||||
page_t* father_page;
|
||||
page_t* right_father_page;
|
||||
rec_t* node_ptr;
|
||||
|
@ -94,7 +94,7 @@ static
|
||||
void
|
||||
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
|
||||
converged */
|
||||
ulint space, /* in: space id */
|
||||
@ -219,7 +219,7 @@ btr_cur_search_to_nth_level(
|
||||
ulint insert_planned;
|
||||
ulint buf_mode;
|
||||
ulint estimate;
|
||||
ulint root_height;
|
||||
ulint root_height = 0; /* remove warning */
|
||||
#ifdef BTR_CUR_ADAPT
|
||||
btr_search_t* info;
|
||||
#endif
|
||||
@ -488,7 +488,7 @@ btr_cur_open_at_index_side(
|
||||
ulint page_no;
|
||||
ulint space;
|
||||
ulint height;
|
||||
ulint root_height;
|
||||
ulint root_height = 0; /* remove warning */
|
||||
rec_t* node_ptr;
|
||||
ulint estimate;
|
||||
|
||||
@ -2907,8 +2907,9 @@ btr_store_big_rec_extern_fields(
|
||||
rec_t* rec, /* in: record */
|
||||
big_rec_t* big_rec_vec, /* in: vector containing fields
|
||||
to be stored externally */
|
||||
mtr_t* local_mtr) /* in: mtr containing the latch to
|
||||
rec and to the tree */
|
||||
mtr_t* local_mtr __attribute__((unused))) /* in: mtr
|
||||
containing the latch to rec and to the
|
||||
tree */
|
||||
{
|
||||
byte* data;
|
||||
ulint local_len;
|
||||
@ -3069,9 +3070,9 @@ btr_free_externally_stored_field(
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* local_mtr) /* in: mtr containing the latch to
|
||||
data an an X-latch to the index
|
||||
tree */
|
||||
mtr_t* local_mtr __attribute__((unused))) /* in: mtr
|
||||
containing the latch to data an an
|
||||
X-latch to the index tree */
|
||||
{
|
||||
page_t* page;
|
||||
page_t* rec_page;
|
||||
|
@ -1245,7 +1245,7 @@ btr_search_update_hash_on_insert(
|
||||
dulint tree_id;
|
||||
ulint fold;
|
||||
ulint ins_fold;
|
||||
ulint next_fold;
|
||||
ulint next_fold = 0; /* remove warning (??? bug ???) */
|
||||
ulint n_fields;
|
||||
ulint n_bytes;
|
||||
ulint side;
|
||||
|
@ -280,7 +280,7 @@ buf_page_print(
|
||||
ut_sprintf_buf(buf, read_buf, UNIV_PAGE_SIZE);
|
||||
|
||||
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);
|
||||
fprintf(stderr, "InnoDB: End of page dump\n");
|
||||
|
||||
|
@ -103,9 +103,10 @@ ibool
|
||||
buf_LRU_search_and_free_block(
|
||||
/*==========================*/
|
||||
/* out: TRUE if freed */
|
||||
ulint n_iterations) /* in: how many times this has been called
|
||||
repeatedly without result: a high value
|
||||
means that we should search farther */
|
||||
ulint n_iterations __attribute__((unused))) /* in: how many times
|
||||
this has been called repeatedly without
|
||||
result: a high value means that we should
|
||||
search farther */
|
||||
{
|
||||
buf_block_t* block;
|
||||
ibool freed;
|
||||
@ -199,7 +200,7 @@ buf_LRU_get_free_block(void)
|
||||
buf_block_t* block = NULL;
|
||||
ibool freed;
|
||||
ulint n_iterations = 0;
|
||||
ibool mon_value_was;
|
||||
ibool mon_value_was = 0; /* remove bug */
|
||||
ibool started_monitor = FALSE;
|
||||
loop:
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
@ -572,7 +572,7 @@ from entry with dtuple_convert_big_rec. */
|
||||
void
|
||||
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 */
|
||||
big_rec_t* vector) /* in, own: big rec vector; it is
|
||||
freed in this function */
|
||||
|
@ -254,27 +254,29 @@ dict_boot(void)
|
||||
/* Insert into the dictionary cache the descriptions of the basic
|
||||
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, "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, "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, "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, "SPACE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "N_COLS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "MIX_ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "MIX_LEN", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "CLUSTER_NAME", DATA_BINARY,
|
||||
0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0);
|
||||
|
||||
table->id = DICT_TABLES_ID;
|
||||
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_tables = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
|
||||
DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 1);
|
||||
index = dict_mem_index_create((char *) "SYS_TABLES", (char *)
|
||||
"CLUST_IND",
|
||||
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,
|
||||
MLOG_4BYTES, &mtr);
|
||||
@ -282,51 +284,52 @@ dict_boot(void)
|
||||
|
||||
ut_a(dict_index_add_to_cache(table, index));
|
||||
/*-------------------------*/
|
||||
index = dict_mem_index_create("SYS_TABLES", "ID_IND", DICT_HDR_SPACE,
|
||||
DICT_UNIQUE, 1);
|
||||
dict_mem_index_add_field(index, "ID", 0);
|
||||
index = dict_mem_index_create((char *) "SYS_TABLES",
|
||||
(char *) "ID_IND", DICT_HDR_SPACE,
|
||||
DICT_UNIQUE, 1);
|
||||
dict_mem_index_add_field(index, (char *) "ID", 0);
|
||||
|
||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
|
||||
MLOG_4BYTES, &mtr);
|
||||
index->id = DICT_TABLE_IDS_ID;
|
||||
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, "POS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "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 *) "TABLE_ID", DATA_BINARY,0,0,0);
|
||||
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "MTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "PRTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "LEN", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "PREC", DATA_INT, 0, 4, 0);
|
||||
|
||||
table->id = DICT_COLUMNS_ID;
|
||||
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_columns = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
|
||||
DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
index = dict_mem_index_create((char *) "SYS_COLUMNS",
|
||||
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "TABLE_ID", 0);
|
||||
dict_mem_index_add_field(index, "POS", 0);
|
||||
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0);
|
||||
dict_mem_index_add_field(index, (char *) "POS", 0);
|
||||
|
||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
|
||||
MLOG_4BYTES, &mtr);
|
||||
index->id = DICT_COLUMNS_ID;
|
||||
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, "ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "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, "TYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "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 *) "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, (char *) "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, (char *) "N_FIELDS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "SPACE", 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 */
|
||||
ut_ad(DICT_SYS_INDEXES_PAGE_NO_FIELD == 6 + 2);
|
||||
@ -336,34 +339,34 @@ dict_boot(void)
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_indexes = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
|
||||
DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
index = dict_mem_index_create((char *) "SYS_INDEXES",
|
||||
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "TABLE_ID", 0);
|
||||
dict_mem_index_add_field(index, "ID", 0);
|
||||
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0);
|
||||
dict_mem_index_add_field(index, (char *) "ID", 0);
|
||||
|
||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
|
||||
MLOG_4BYTES, &mtr);
|
||||
index->id = DICT_INDEXES_ID;
|
||||
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, "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 *) "INDEX_ID", DATA_BINARY, 0,0,0);
|
||||
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, (char *) "COL_NAME", DATA_BINARY, 0,0,0);
|
||||
|
||||
table->id = DICT_FIELDS_ID;
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_fields = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
|
||||
DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
index = dict_mem_index_create((char *) "SYS_FIELDS",
|
||||
(char *) "CLUST_IND", DICT_HDR_SPACE,
|
||||
DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "INDEX_ID", 0);
|
||||
dict_mem_index_add_field(index, "POS", 0);
|
||||
dict_mem_index_add_field(index, (char *) "INDEX_ID", 0);
|
||||
dict_mem_index_add_field(index, (char *) "POS", 0);
|
||||
|
||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
|
||||
MLOG_4BYTES, &mtr);
|
||||
|
@ -1044,8 +1044,8 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
table1 = dict_table_get_low("SYS_FOREIGN");
|
||||
table2 = dict_table_get_low("SYS_FOREIGN_COLS");
|
||||
table1 = dict_table_get_low((char *) "SYS_FOREIGN");
|
||||
table2 = dict_table_get_low((char *) "SYS_FOREIGN_COLS");
|
||||
|
||||
if (table1 && table2
|
||||
&& 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->op_info = "creating foreign key sys tables";
|
||||
trx->op_info = (char *) "creating foreign key sys tables";
|
||||
|
||||
if (table1) {
|
||||
fprintf(stderr,
|
||||
"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) {
|
||||
fprintf(stderr,
|
||||
"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,
|
||||
@ -1082,7 +1082,7 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||
there are 2 secondary indexes on SYS_FOREIGN, and they
|
||||
are defined just like below */
|
||||
|
||||
str =
|
||||
str = (char *)
|
||||
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
|
||||
"BEGIN\n"
|
||||
"CREATE TABLE\n"
|
||||
@ -1121,15 +1121,15 @@ dict_create_or_check_foreign_constraint_tables(void)
|
||||
fprintf(stderr,
|
||||
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
|
||||
|
||||
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
|
||||
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
|
||||
row_drop_table_for_mysql((char *) "SYS_FOREIGN", trx, TRUE);
|
||||
row_drop_table_for_mysql((char *) "SYS_FOREIGN_COLS",trx,TRUE);
|
||||
|
||||
error = DB_MUST_GET_MORE_FILE_SPACE;
|
||||
}
|
||||
|
||||
que_graph_free(graph);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
trx_free_for_mysql(trx);
|
||||
|
||||
@ -1165,7 +1165,7 @@ dict_create_add_foreigns_to_dictionary(
|
||||
|
||||
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,
|
||||
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
|
||||
return(DB_ERROR);
|
||||
|
@ -492,15 +492,19 @@ dict_table_add_to_cache(
|
||||
The clustered index will not always physically contain all
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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_N_SYS_COLS == 4); /* This assert reminds that if a new
|
||||
system column is added to the program,
|
||||
@ -1908,7 +1912,7 @@ dict_create_foreign_constraints(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
loop:
|
||||
ptr = dict_scan_to(ptr, "FOREIGN");
|
||||
ptr = dict_scan_to(ptr, (char *) "FOREIGN");
|
||||
|
||||
if (*ptr == '\0' || dict_bracket_count(sql_string, ptr) != 1) {
|
||||
|
||||
@ -1920,19 +1924,19 @@ loop:
|
||||
return(error);
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, "FOREIGN", &success);
|
||||
ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
|
||||
|
||||
if (!isspace(*ptr)) {
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, "KEY", &success);
|
||||
ptr = dict_accept(ptr, (char *) "KEY", &success);
|
||||
|
||||
if (!success) {
|
||||
goto loop;
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, "(", &success);
|
||||
ptr = dict_accept(ptr, (char *) "(", &success);
|
||||
|
||||
if (!success) {
|
||||
goto loop;
|
||||
@ -1950,13 +1954,13 @@ col_loop1:
|
||||
|
||||
i++;
|
||||
|
||||
ptr = dict_accept(ptr, ",", &success);
|
||||
ptr = dict_accept(ptr, (char *) ",", &success);
|
||||
|
||||
if (success) {
|
||||
goto col_loop1;
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, ")", &success);
|
||||
ptr = dict_accept(ptr, (char *) ")", &success);
|
||||
|
||||
if (!success) {
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
@ -1971,7 +1975,7 @@ col_loop1:
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, "REFERENCES", &success);
|
||||
ptr = dict_accept(ptr, (char *) "REFERENCES", &success);
|
||||
|
||||
if (!success || !isspace(*ptr)) {
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
@ -2002,7 +2006,7 @@ col_loop1:
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, "(", &success);
|
||||
ptr = dict_accept(ptr, (char *) "(", &success);
|
||||
|
||||
if (!success) {
|
||||
dict_foreign_free(foreign);
|
||||
@ -2022,13 +2026,13 @@ col_loop2:
|
||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, ",", &success);
|
||||
ptr = dict_accept(ptr, (char *) ",", &success);
|
||||
|
||||
if (success) {
|
||||
goto col_loop2;
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, ")", &success);
|
||||
ptr = dict_accept(ptr, (char *) ")", &success);
|
||||
|
||||
if (!success || foreign->n_fields != i) {
|
||||
dict_foreign_free(foreign);
|
||||
@ -2554,7 +2558,8 @@ void
|
||||
dict_update_statistics_low(
|
||||
/*=======================*/
|
||||
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 */
|
||||
{
|
||||
dict_index_t* index;
|
||||
|
@ -75,7 +75,7 @@ dict_get_first_table_name_in_db(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap, 1);
|
||||
@ -154,7 +154,7 @@ dict_print(void)
|
||||
|
||||
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);
|
||||
|
||||
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
|
||||
@ -241,7 +241,7 @@ dict_load_table(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap, 1);
|
||||
@ -277,7 +277,7 @@ dict_load_table(
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
ut_a(0 == ut_strcmp("SPACE",
|
||||
ut_a(0 == ut_strcmp((char *) "SPACE",
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_tables), 9))->name));
|
||||
@ -285,7 +285,7 @@ dict_load_table(
|
||||
field = rec_get_nth_field(rec, 9, &len);
|
||||
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_index_get_nth_field(
|
||||
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);
|
||||
|
||||
ut_a(0 == ut_strcmp("ID",
|
||||
ut_a(0 == ut_strcmp((char *) "ID",
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_tables), 3))->name));
|
||||
@ -498,7 +498,7 @@ dict_load_columns(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap, 1);
|
||||
@ -528,7 +528,7 @@ dict_load_columns(
|
||||
ut_ad(len == 4);
|
||||
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_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_columns), 4))->name));
|
||||
@ -550,7 +550,7 @@ dict_load_columns(
|
||||
field = rec_get_nth_field(rec, 7, &len);
|
||||
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_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_columns), 8))->name));
|
||||
@ -608,7 +608,7 @@ dict_load_indexes(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap, 1);
|
||||
@ -643,7 +643,7 @@ dict_load_indexes(
|
||||
ut_ad(len == 8);
|
||||
id = mach_read_from_8(field);
|
||||
|
||||
ut_a(0 == ut_strcmp("NAME",
|
||||
ut_a(0 == ut_strcmp((char *) "NAME",
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_indexes), 4))->name));
|
||||
@ -663,7 +663,7 @@ dict_load_indexes(
|
||||
field = rec_get_nth_field(rec, 7, &len);
|
||||
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_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_indexes), 8))->name));
|
||||
@ -674,8 +674,8 @@ dict_load_indexes(
|
||||
if (is_sys_table
|
||||
&& ((type & DICT_CLUSTERED)
|
||||
|| ((table == dict_sys->sys_tables)
|
||||
&& (name_len == ut_strlen("ID_IND"))
|
||||
&& (0 == ut_memcmp(name_buf, "ID_IND",
|
||||
&& (name_len == ut_strlen((char *) "ID_IND"))
|
||||
&& (0 == ut_memcmp(name_buf, (char *) "ID_IND",
|
||||
name_len))))) {
|
||||
|
||||
/* The index was created in memory already in
|
||||
@ -727,7 +727,7 @@ dict_load_fields(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap, 1);
|
||||
@ -756,7 +756,7 @@ dict_load_fields(
|
||||
ut_ad(len == 4);
|
||||
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_index_get_nth_field(
|
||||
dict_table_get_first_index(sys_fields), 4))->name));
|
||||
@ -807,7 +807,7 @@ dict_load_foreign_cols(
|
||||
foreign->n_fields * sizeof(void*));
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(foreign->heap, 1);
|
||||
@ -885,7 +885,7 @@ dict_load_foreign(
|
||||
|
||||
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);
|
||||
|
||||
tuple = dtuple_create(heap2, 1);
|
||||
@ -999,7 +999,7 @@ dict_load_foreigns(
|
||||
|
||||
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) {
|
||||
/* No foreign keys defined yet in this database */
|
||||
|
@ -164,8 +164,8 @@ eval_logical(
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
ibool val1;
|
||||
ibool val2;
|
||||
ibool val;
|
||||
ibool val2 = 0; /* remove warning */
|
||||
ibool val = 0; /* remove warning */
|
||||
int 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* arg2;
|
||||
lint val1;
|
||||
lint val2;
|
||||
lint val2 = 0; /* remove warning */
|
||||
lint val;
|
||||
int func;
|
||||
|
||||
@ -283,7 +283,7 @@ eval_predefined_2(
|
||||
{
|
||||
que_node_t* arg;
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
que_node_t* arg2 = 0; /* remove warning (??? bug ???) */
|
||||
lint int_val;
|
||||
byte* data;
|
||||
ulint len1;
|
||||
|
@ -1209,7 +1209,7 @@ fil_aio_wait(
|
||||
ut_ad(fil_validate());
|
||||
|
||||
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
|
||||
ret = os_aio_windows_handle(segment, 0, &fil_node, &message,
|
||||
&type);
|
||||
@ -1220,7 +1220,7 @@ fil_aio_wait(
|
||||
ut_a(0);
|
||||
#endif
|
||||
} 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,
|
||||
&message, &type);
|
||||
@ -1228,7 +1228,7 @@ fil_aio_wait(
|
||||
|
||||
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));
|
||||
|
||||
@ -1241,10 +1241,11 @@ fil_aio_wait(
|
||||
/* Do the i/o handling */
|
||||
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ fsp_parse_init_file_page(
|
||||
/*=====================*/
|
||||
/* out: end of log record or NULL */
|
||||
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 */
|
||||
{
|
||||
ut_ad(ptr && end_ptr);
|
||||
@ -1252,7 +1252,7 @@ fsp_seg_inode_page_get_nth_inode(
|
||||
/* out: segment inode */
|
||||
page_t* page, /* in: segment inode 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(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 */
|
||||
fseg_inode_t* inode, /* in: segment inode */
|
||||
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(n < FSEG_FRAG_ARR_N_SLOTS);
|
||||
@ -1632,7 +1632,7 @@ fseg_create_general(
|
||||
fsp_header_t* space_header;
|
||||
fseg_inode_t* inode;
|
||||
dulint seg_id;
|
||||
fseg_header_t* header;
|
||||
fseg_header_t* header = 0; /* remove warning */
|
||||
rw_lock_t* latch;
|
||||
ibool success;
|
||||
page_t* ret = NULL;
|
||||
|
@ -292,6 +292,7 @@ ibuf_count_get(
|
||||
|
||||
/**********************************************************************
|
||||
Sets the ibuf count for a given page. */
|
||||
#ifdef UNIV_IBUF_DEBUG
|
||||
static
|
||||
void
|
||||
ibuf_count_set(
|
||||
@ -306,6 +307,7 @@ ibuf_count_set(
|
||||
|
||||
*(ibuf_counts[space] + page_no) = val;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************
|
||||
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);
|
||||
|
||||
dict_mem_table_add_col(table, "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 *) "PAGE_NO", 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);
|
||||
|
||||
dict_table_add_to_cache(table);
|
||||
|
||||
index = dict_mem_index_create(buf, "CLUST_IND", space,
|
||||
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,
|
||||
2);
|
||||
index = dict_mem_index_create(buf, (char *) "CLUST_IND", space,
|
||||
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,2);
|
||||
|
||||
dict_mem_index_add_field(index, "PAGE_NO", 0);
|
||||
dict_mem_index_add_field(index, "TYPES", 0);
|
||||
dict_mem_index_add_field(index, (char *) "PAGE_NO", 0);
|
||||
dict_mem_index_add_field(index, (char *) "TYPES", 0);
|
||||
|
||||
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;
|
||||
|
||||
@ -538,7 +539,7 @@ ibuf_parse_bitmap_init(
|
||||
/*===================*/
|
||||
/* out: end of log record or NULL */
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
@ -561,7 +562,8 @@ ibuf_bitmap_page_get_bits(
|
||||
page_t* page, /* in: bitmap page */
|
||||
ulint page_no,/* in: page whose bits to get */
|
||||
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 bit_offset;
|
||||
|
@ -89,7 +89,7 @@ btr_page_get_level(
|
||||
/*===============*/
|
||||
/* out: level, leaf level == 0 */
|
||||
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);
|
||||
|
||||
@ -121,7 +121,7 @@ btr_page_get_next(
|
||||
/*==============*/
|
||||
/* out: next page number */
|
||||
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(mtr_memo_contains(mtr, buf_block_align(page),
|
||||
@ -155,7 +155,7 @@ btr_page_get_prev(
|
||||
/*==============*/
|
||||
/* out: prev page number */
|
||||
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);
|
||||
|
||||
|
@ -625,9 +625,10 @@ UNIV_INLINE
|
||||
void
|
||||
buf_page_dbg_add_level(
|
||||
/*===================*/
|
||||
buf_frame_t* frame, /* in: buffer page where we have acquired
|
||||
a latch */
|
||||
ulint level) /* in: latching order level */
|
||||
buf_frame_t* frame __attribute__((unused)), /* in: buffer page
|
||||
where we have acquired latch */
|
||||
ulint level __attribute__((unused))) /* in: latching order
|
||||
level */
|
||||
{
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
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.,
|
||||
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->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
@ -59,7 +59,7 @@ ha_node_t*
|
||||
ha_chain_get_next(
|
||||
/*==============*/
|
||||
/* 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 */
|
||||
{
|
||||
ut_ad(table);
|
||||
|
@ -15,7 +15,8 @@ row_mysql_store_var_len(
|
||||
/*====================*/
|
||||
/* out: dest + 2 */
|
||||
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);
|
||||
/*
|
||||
|
@ -60,7 +60,7 @@ row_vers_sec_rec_may_see_older(
|
||||
/*===========================*/
|
||||
/* out: FALSE if can be read immediately */
|
||||
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 */
|
||||
{
|
||||
page_t* page;
|
||||
|
@ -126,7 +126,8 @@ rw_lock_s_lock_low(
|
||||
/*===============*/
|
||||
/* out: TRUE if success */
|
||||
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 */
|
||||
char* file_name, /* in: file name where lock requested */
|
||||
ulint line) /* in: line where requested */
|
||||
|
@ -539,7 +539,8 @@ lock_sec_rec_cons_read_sees(
|
||||
index record */
|
||||
rec_t* rec, /* in: user record which should be read or
|
||||
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 */
|
||||
{
|
||||
dulint max_trx_id;
|
||||
@ -2292,7 +2293,7 @@ list start is moved to another page. */
|
||||
void
|
||||
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 */
|
||||
rec_t* rec, /* in: record on page: this is the
|
||||
first record NOT copied */
|
||||
@ -2736,7 +2737,7 @@ lock_deadlock_recursive(
|
||||
we return TRUE */
|
||||
{
|
||||
lock_t* lock;
|
||||
ulint bit_no;
|
||||
ulint bit_no = 0; /* remove warning */
|
||||
trx_t* lock_trx;
|
||||
|
||||
ut_a(trx && start && wait_lock);
|
||||
|
@ -372,7 +372,8 @@ void
|
||||
mem_heap_validate_or_print(
|
||||
/*=======================*/
|
||||
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,
|
||||
if this pointer is NULL, ignored */
|
||||
ibool print, /* in: if TRUE, prints the contents
|
||||
@ -578,7 +579,8 @@ static
|
||||
void
|
||||
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
|
||||
previous call of this function */
|
||||
{
|
||||
|
@ -469,7 +469,8 @@ mtr_read_ulint(
|
||||
/* out: value read */
|
||||
byte* ptr, /* in: pointer from where to read */
|
||||
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_memo_contains(mtr, buf_block_align(ptr),
|
||||
@ -494,8 +495,9 @@ mtr_read_dulint(
|
||||
/*===========*/
|
||||
/* out: value read */
|
||||
byte* ptr, /* in: pointer from where to read */
|
||||
ulint type, /* in: MLOG_8BYTES */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
ulint type __attribute__((unused)), /* in: MLOG_8BYTES */
|
||||
mtr_t* mtr __attribute__((unused)))
|
||||
/* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(mtr->state == MTR_ACTIVE);
|
||||
ut_ad(ptr && mtr);
|
||||
|
@ -421,7 +421,7 @@ SQLError(
|
||||
}
|
||||
|
||||
*pfNativeError = 0;
|
||||
ut_memcpy(szSqlState, "S1000", 6);
|
||||
ut_memcpy(szSqlState, (char *) "S1000", 6);
|
||||
|
||||
len = (ulint)cbErrorMsgMax - 1;
|
||||
|
||||
|
@ -58,7 +58,8 @@ os_thread_create(
|
||||
#endif
|
||||
void* arg, /* in: argument to start
|
||||
function */
|
||||
os_thread_id_t* thread_id) /* out: id of created
|
||||
os_thread_id_t* thread_id __attribute__((unused)))
|
||||
/* out: id of created
|
||||
thread */
|
||||
{
|
||||
#ifdef __WIN__
|
||||
@ -204,7 +205,8 @@ ulint
|
||||
os_thread_get_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__
|
||||
int os_pri;
|
||||
|
@ -510,14 +510,14 @@ page_cur_parse_insert_rec(
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
ulint extra_info_yes;
|
||||
ulint offset;
|
||||
ulint offset = 0; /* remove warning */
|
||||
ulint origin_offset;
|
||||
ulint end_seg_len;
|
||||
ulint mismatch_index;
|
||||
rec_t* cursor_rec;
|
||||
byte buf1[1024];
|
||||
byte* buf;
|
||||
ulint info_bits;
|
||||
ulint info_bits = 0; /* remove warning */
|
||||
page_cur_t cursor;
|
||||
|
||||
if (!is_short) {
|
||||
@ -835,9 +835,9 @@ page_copy_rec_list_end_to_created_page(
|
||||
rec_t* rec, /* in: first record to copy */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_dir_slot_t* slot;
|
||||
page_dir_slot_t* slot = 0; /* remove warning */
|
||||
byte* heap_top;
|
||||
rec_t* insert_rec;
|
||||
rec_t* insert_rec = 0; /* remove warning */
|
||||
rec_t* prev_rec;
|
||||
ulint count;
|
||||
ulint n_recs;
|
||||
@ -882,6 +882,7 @@ page_copy_rec_list_end_to_created_page(
|
||||
slot_index = 0;
|
||||
n_recs = 0;
|
||||
|
||||
/* should be do ... until, comment by Jani */
|
||||
while (rec != page_get_supremum_rec(page)) {
|
||||
|
||||
insert_rec = rec_copy(heap_top, rec);
|
||||
|
@ -210,7 +210,7 @@ page_parse_create(
|
||||
/*==============*/
|
||||
/* out: end of log record or NULL */
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
@ -283,7 +283,7 @@ page_create(
|
||||
tuple = dtuple_create(heap, 1);
|
||||
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);
|
||||
|
||||
/* Set the corresponding physical record to its place in the page
|
||||
@ -305,7 +305,7 @@ page_create(
|
||||
tuple = dtuple_create(heap, 1);
|
||||
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);
|
||||
|
||||
supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple);
|
||||
|
@ -528,7 +528,7 @@ opt_search_plan_for_table(
|
||||
ulint goodness;
|
||||
ulint last_op;
|
||||
ulint best_goodness;
|
||||
ulint best_last_op;
|
||||
ulint best_last_op = 0; /* remove warning */
|
||||
ulint mix_id_pos;
|
||||
que_node_t* 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_goodness = 0;
|
||||
|
||||
/* should be do ... until ? comment by Jani */
|
||||
while (index) {
|
||||
goodness = opt_calc_index_goodness(index, sel_node, i,
|
||||
index_plan, &last_op);
|
||||
|
@ -1942,7 +1942,7 @@ Called by yyparse on error. */
|
||||
void
|
||||
yyerror(
|
||||
/*====*/
|
||||
char* s) /* in: error message string */
|
||||
char* s __attribute__((unused))) /* in: error message string */
|
||||
{
|
||||
ut_ad(s);
|
||||
|
||||
|
@ -393,7 +393,7 @@ graph so that the graph can communicate an error message to the client.) */
|
||||
void
|
||||
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
|
||||
handling started, NULL not allowed */
|
||||
{
|
||||
@ -1130,47 +1130,47 @@ que_node_print_info(
|
||||
addr = (ulint)node;
|
||||
|
||||
if (type == QUE_NODE_SELECT) {
|
||||
str = "SELECT";
|
||||
str = (char *) "SELECT";
|
||||
} else if (type == QUE_NODE_INSERT) {
|
||||
str = "INSERT";
|
||||
str = (char *) "INSERT";
|
||||
} else if (type == QUE_NODE_UPDATE) {
|
||||
str = "UPDATE";
|
||||
str = (char *) "UPDATE";
|
||||
} else if (type == QUE_NODE_WHILE) {
|
||||
str = "WHILE";
|
||||
str = (char *) "WHILE";
|
||||
} else if (type == QUE_NODE_ASSIGNMENT) {
|
||||
str = "ASSIGNMENT";
|
||||
str = (char *) "ASSIGNMENT";
|
||||
} else if (type == QUE_NODE_IF) {
|
||||
str = "IF";
|
||||
str = (char *) "IF";
|
||||
} else if (type == QUE_NODE_FETCH) {
|
||||
str = "FETCH";
|
||||
str = (char *) "FETCH";
|
||||
} else if (type == QUE_NODE_OPEN) {
|
||||
str = "OPEN";
|
||||
str = (char *) "OPEN";
|
||||
} else if (type == QUE_NODE_PROC) {
|
||||
str = "STORED PROCEDURE";
|
||||
str = (char *) "STORED PROCEDURE";
|
||||
} else if (type == QUE_NODE_FUNC) {
|
||||
str = "FUNCTION";
|
||||
str = (char *) "FUNCTION";
|
||||
} else if (type == QUE_NODE_LOCK) {
|
||||
str = "LOCK";
|
||||
str = (char *) "LOCK";
|
||||
} else if (type == QUE_NODE_THR) {
|
||||
str = "QUERY THREAD";
|
||||
str = (char *) "QUERY THREAD";
|
||||
} else if (type == QUE_NODE_COMMIT) {
|
||||
str = "COMMIT";
|
||||
str = (char *) "COMMIT";
|
||||
} else if (type == QUE_NODE_UNDO) {
|
||||
str = "UNDO ROW";
|
||||
str = (char *) "UNDO ROW";
|
||||
} else if (type == QUE_NODE_PURGE) {
|
||||
str = "PURGE ROW";
|
||||
str = (char *) "PURGE ROW";
|
||||
} else if (type == QUE_NODE_ROLLBACK) {
|
||||
str = "ROLLBACK";
|
||||
str = (char *) "ROLLBACK";
|
||||
} else if (type == QUE_NODE_CREATE_TABLE) {
|
||||
str = "CREATE TABLE";
|
||||
str = (char *) "CREATE TABLE";
|
||||
} else if (type == QUE_NODE_CREATE_INDEX) {
|
||||
str = "CREATE INDEX";
|
||||
str = (char *) "CREATE INDEX";
|
||||
} else if (type == QUE_NODE_FOR) {
|
||||
str = "FOR LOOP";
|
||||
str = (char *) "FOR LOOP";
|
||||
} else if (type == QUE_NODE_RETURN) {
|
||||
str = "RETURN";
|
||||
str = (char *) "RETURN";
|
||||
} else {
|
||||
str = "UNKNOWN NODE TYPE";
|
||||
str = (char *) "UNKNOWN NODE TYPE";
|
||||
}
|
||||
|
||||
printf("Node type %lu: %s, address %lx\n", type, str, addr);
|
||||
|
@ -79,7 +79,7 @@ ulint
|
||||
cmp_collate(
|
||||
/*========*/
|
||||
/* 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
|
||||
record */
|
||||
{
|
||||
|
@ -517,9 +517,9 @@ rec_print(
|
||||
ut_ad(rec);
|
||||
|
||||
if (rec_get_1byte_offs_flag(rec)) {
|
||||
offs = "TRUE";
|
||||
offs = (char *) "TRUE";
|
||||
} else {
|
||||
offs = "FALSE";
|
||||
offs = (char *) "FALSE";
|
||||
}
|
||||
|
||||
n = rec_get_n_fields(rec);
|
||||
|
@ -384,7 +384,7 @@ row_ins_check_foreign_constraint(
|
||||
dictionary cache if they exist at all */
|
||||
dict_table_t* table, /* in: if check_ref is TRUE, then the foreign
|
||||
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 */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
@ -825,7 +825,7 @@ row_ins_index_entry_low(
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
btr_cur_t cursor;
|
||||
ulint modify;
|
||||
ulint modify = 0; /* remove warning */
|
||||
rec_t* insert_rec;
|
||||
rec_t* rec;
|
||||
ulint err;
|
||||
|
@ -489,7 +489,7 @@ row_lock_table_autoinc_for_mysql(
|
||||
ut_ad(trx);
|
||||
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) {
|
||||
row_get_prebuilt_insert_row(prebuilt);
|
||||
@ -525,14 +525,14 @@ run_again:
|
||||
goto run_again;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
que_thr_stop_for_mysql_no_error(thr, trx);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -569,7 +569,7 @@ row_insert_for_mysql(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
trx->op_info = "inserting";
|
||||
trx->op_info = (char *) "inserting";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
@ -610,7 +610,7 @@ run_again:
|
||||
goto run_again;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
@ -627,7 +627,7 @@ run_again:
|
||||
}
|
||||
|
||||
row_update_statistics_if_needed(prebuilt);
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -754,7 +754,7 @@ row_update_for_mysql(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
trx->op_info = "updating or deleting";
|
||||
trx->op_info = (char *) "updating or deleting";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
@ -831,7 +831,7 @@ run_again:
|
||||
|
||||
if (err == DB_RECORD_NOT_FOUND) {
|
||||
trx->error_state = DB_SUCCESS;
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -842,7 +842,7 @@ run_again:
|
||||
goto run_again;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
@ -861,7 +861,7 @@ run_again:
|
||||
|
||||
row_update_statistics_if_needed(prebuilt);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -949,17 +949,17 @@ row_create_table_for_mysql(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
trx->op_info = "creating table";
|
||||
trx->op_info = (char *) "creating table";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
namelen = ut_strlen(table->name);
|
||||
|
||||
keywordlen = ut_strlen("innodb_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||
"innodb_monitor", keywordlen)) {
|
||||
(char *) "innodb_monitor", keywordlen)) {
|
||||
|
||||
/* Table name ends to characters innodb_monitor:
|
||||
start monitor prints */
|
||||
@ -972,32 +972,34 @@ row_create_table_for_mysql(
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_lock_monitor");
|
||||
|
||||
if (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_lock_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_tablespace_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||
"innodb_tablespace_monitor", keywordlen)) {
|
||||
(char *) "innodb_tablespace_monitor",
|
||||
keywordlen)) {
|
||||
|
||||
srv_print_innodb_tablespace_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_table_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_table_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||
"innodb_table_monitor", keywordlen)) {
|
||||
(char *) "innodb_table_monitor",
|
||||
keywordlen)) {
|
||||
|
||||
srv_print_innodb_table_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
@ -1057,7 +1059,7 @@ row_create_table_for_mysql(
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -1081,7 +1083,7 @@ row_create_index_for_mysql(
|
||||
|
||||
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);
|
||||
|
||||
@ -1121,7 +1123,7 @@ row_create_index_for_mysql(
|
||||
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -1152,7 +1154,7 @@ row_table_add_foreign_constraints(
|
||||
|
||||
ut_a(sql_string);
|
||||
|
||||
trx->op_info = "adding foreign keys";
|
||||
trx->op_info = (char *) "adding foreign keys";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
@ -1226,16 +1228,16 @@ row_drop_table_for_mysql(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
trx->op_info = "dropping table";
|
||||
trx->op_info = (char *) "dropping table";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
namelen = ut_strlen(name);
|
||||
keywordlen = ut_strlen("innodb_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||
"innodb_monitor", keywordlen)) {
|
||||
(char *) "innodb_monitor", keywordlen)) {
|
||||
|
||||
/* Table name ends to characters innodb_monitor:
|
||||
stop monitor prints */
|
||||
@ -1244,30 +1246,33 @@ row_drop_table_for_mysql(
|
||||
srv_print_innodb_lock_monitor = FALSE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_lock_monitor");
|
||||
|
||||
if (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_lock_monitor = FALSE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_tablespace_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||
"innodb_tablespace_monitor", keywordlen)) {
|
||||
(char *) "innodb_tablespace_monitor",
|
||||
keywordlen)) {
|
||||
|
||||
srv_print_innodb_tablespace_monitor = FALSE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_table_monitor");
|
||||
keywordlen = ut_strlen((char *) "innodb_table_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||
"innodb_table_monitor", keywordlen)) {
|
||||
(char *) "innodb_table_monitor",
|
||||
keywordlen)) {
|
||||
|
||||
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
|
||||
frees the file segments of the B-tree associated with the index. */
|
||||
|
||||
str1 =
|
||||
str1 = (char *)
|
||||
"PROCEDURE DROP_TABLE_PROC () IS\n"
|
||||
"table_name CHAR;\n"
|
||||
"sys_foreign_id CHAR;\n"
|
||||
@ -1288,7 +1293,7 @@ row_drop_table_for_mysql(
|
||||
"BEGIN\n"
|
||||
"table_name := '";
|
||||
|
||||
str2 =
|
||||
str2 = (char *)
|
||||
"';\n"
|
||||
"SELECT ID INTO table_id\n"
|
||||
"FROM SYS_TABLES\n"
|
||||
@ -1423,7 +1428,7 @@ funct_exit:
|
||||
|
||||
que_graph_free(graph);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -1445,13 +1450,13 @@ row_drop_database_for_mysql(
|
||||
ut_a(name != NULL);
|
||||
ut_a(name[strlen(name) - 1] == '/');
|
||||
|
||||
trx->op_info = "dropping database";
|
||||
trx->op_info = (char *) "dropping database";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
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);
|
||||
|
||||
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->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
@ -1511,20 +1516,20 @@ row_rename_table_for_mysql(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
trx->op_info = "renaming table";
|
||||
trx->op_info = (char *) "renaming table";
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
str1 =
|
||||
str1 = (char *)
|
||||
"PROCEDURE RENAME_TABLE_PROC () IS\n"
|
||||
"new_table_name CHAR;\n"
|
||||
"old_table_name CHAR;\n"
|
||||
"BEGIN\n"
|
||||
"new_table_name :='";
|
||||
|
||||
str2 =
|
||||
str2 = (char *)
|
||||
"';\nold_table_name := '";
|
||||
|
||||
str3 =
|
||||
str3 = (char *)
|
||||
"';\n"
|
||||
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
|
||||
"WHERE NAME = old_table_name;\n"
|
||||
@ -1591,7 +1596,7 @@ funct_exit:
|
||||
|
||||
que_graph_free(graph);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
@ -1718,7 +1723,7 @@ row_check_table_for_mysql(
|
||||
ulint n_rows_in_table = ULINT_UNDEFINED;
|
||||
ulint ret = DB_SUCCESS;
|
||||
|
||||
prebuilt->trx->op_info = "checking table";
|
||||
prebuilt->trx->op_info = (char *) "checking table";
|
||||
|
||||
index = dict_table_get_first_index(table);
|
||||
|
||||
@ -1751,7 +1756,7 @@ row_check_table_for_mysql(
|
||||
index = dict_table_get_next_index(index);
|
||||
}
|
||||
|
||||
prebuilt->trx->op_info = "";
|
||||
prebuilt->trx->op_info = (char *) "";
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ row_purge_remove_sec_if_poss_low(
|
||||
btr_pcur_t pcur;
|
||||
btr_cur_t* btr_cur;
|
||||
ibool success;
|
||||
ibool old_has;
|
||||
ibool old_has = 0; /* remove warning */
|
||||
ibool found;
|
||||
ulint err;
|
||||
mtr_t mtr;
|
||||
|
@ -64,7 +64,8 @@ row_sel_sec_rec_is_for_clust_rec(
|
||||
rec_t* sec_rec, /* in: secondary index record */
|
||||
dict_index_t* sec_index, /* in: secondary index */
|
||||
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;
|
||||
byte* sec_field;
|
||||
@ -2498,7 +2499,7 @@ row_search_for_mysql(
|
||||
printf("N tables locked %lu\n", trx->mysql_n_tables_locked);
|
||||
*/
|
||||
if (direction == 0) {
|
||||
trx->op_info = "starting index read";
|
||||
trx->op_info = (char *) "starting index read";
|
||||
|
||||
prebuilt->n_rows_fetched = 0;
|
||||
prebuilt->n_fetch_cached = 0;
|
||||
@ -2509,7 +2510,7 @@ row_search_for_mysql(
|
||||
row_prebuild_sel_graph(prebuilt);
|
||||
}
|
||||
} else {
|
||||
trx->op_info = "fetching rows";
|
||||
trx->op_info = (char *) "fetching rows";
|
||||
|
||||
if (prebuilt->n_rows_fetched == 0) {
|
||||
prebuilt->fetch_direction = direction;
|
||||
@ -2534,7 +2535,7 @@ row_search_for_mysql(
|
||||
prebuilt->n_rows_fetched++;
|
||||
|
||||
srv_n_rows_read++;
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
@ -2546,7 +2547,7 @@ row_search_for_mysql(
|
||||
cache, but the cache was not full at the time of the
|
||||
popping: no more rows can exist in the result set */
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
return(DB_RECORD_NOT_FOUND);
|
||||
}
|
||||
|
||||
@ -2578,7 +2579,7 @@ row_search_for_mysql(
|
||||
|
||||
/* printf("%s record not found 1\n", index->name); */
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
return(DB_RECORD_NOT_FOUND);
|
||||
}
|
||||
|
||||
@ -2638,7 +2639,7 @@ row_search_for_mysql(
|
||||
trx->has_search_latch = FALSE;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
return(DB_SUCCESS);
|
||||
|
||||
} else if (shortcut == SEL_EXHAUSTED) {
|
||||
@ -2657,7 +2658,7 @@ row_search_for_mysql(
|
||||
trx->has_search_latch = FALSE;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
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,
|
||||
cnt, err); */
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
|
||||
@ -3050,7 +3051,7 @@ normal_return:
|
||||
srv_n_rows_read++;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void
|
||||
row_undo_ins_parse_undo_rec(
|
||||
/*========================*/
|
||||
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;
|
||||
byte* ptr;
|
||||
|
@ -139,7 +139,7 @@ row_undo_mod_remove_clust_low(
|
||||
/* out: DB_SUCCESS, DB_FAIL, or error code:
|
||||
we may run out of file space */
|
||||
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 */
|
||||
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 */
|
||||
byte* log_ptr,/* pointer to a buffer of size > 20 opened
|
||||
in mlog */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
mtr_t* mtr __attribute__((unused))) /* in: mtr */
|
||||
{
|
||||
ut_ad(index->type & DICT_CLUSTERED);
|
||||
ut_ad(mtr);
|
||||
|
@ -57,7 +57,7 @@ ulint srv_activity_count = 0;
|
||||
ibool srv_lock_timeout_and_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 */
|
||||
|
||||
@ -929,6 +929,7 @@ srv_communication_init(
|
||||
|
||||
/*************************************************************************
|
||||
Implements the recovery utility. */
|
||||
#ifdef NOT_USED
|
||||
static
|
||||
ulint
|
||||
srv_recovery_thread(
|
||||
@ -966,7 +967,7 @@ srv_recovery_thread(
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*************************************************************************
|
||||
Implements the purge utility. */
|
||||
|
||||
@ -1018,6 +1019,7 @@ srv_create_utility_threads(void)
|
||||
|
||||
/*************************************************************************
|
||||
Implements the communication threads. */
|
||||
#ifdef NOT_USED
|
||||
static
|
||||
ulint
|
||||
srv_com_thread(
|
||||
@ -1065,7 +1067,7 @@ srv_com_thread(
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*************************************************************************
|
||||
Creates the communication threads. */
|
||||
|
||||
@ -1087,6 +1089,7 @@ srv_create_com_threads(void)
|
||||
|
||||
/*************************************************************************
|
||||
Implements the worker threads. */
|
||||
#ifdef NOT_USED
|
||||
static
|
||||
ulint
|
||||
srv_worker_thread(
|
||||
@ -1129,7 +1132,7 @@ srv_worker_thread(
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*************************************************************************
|
||||
Creates the worker threads. */
|
||||
|
||||
@ -2283,7 +2286,7 @@ srv_master_thread(
|
||||
|
||||
os_event_set(srv_sys->operational);
|
||||
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
|
||||
+ buf_pool->n_pages_written;
|
||||
@ -2299,7 +2302,7 @@ loop:
|
||||
for (i = 0; i < 10; i++) {
|
||||
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
|
||||
+ buf_pool->n_pages_written;
|
||||
srv_main_thread_op_info = "sleeping";
|
||||
srv_main_thread_op_info = (char *) "sleeping";
|
||||
os_thread_sleep(1000000);
|
||||
|
||||
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
|
||||
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);
|
||||
|
||||
/* 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
|
||||
+ buf_pool->n_pages_written;
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -2359,20 +2363,20 @@ loop:
|
||||
+ buf_pool->n_pages_written;
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* We run a batch of insert buffer merge every 10 seconds,
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
/* We run a full purge every 10 seconds, even if the server
|
||||
@ -2389,13 +2393,13 @@ loop:
|
||||
goto background_loop;
|
||||
}
|
||||
|
||||
srv_main_thread_op_info = "purging";
|
||||
srv_main_thread_op_info = (char *) "purging";
|
||||
n_pages_purged = trx_purge();
|
||||
|
||||
current_time = time(NULL);
|
||||
|
||||
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);
|
||||
last_flush_time = current_time;
|
||||
@ -2406,7 +2410,7 @@ background_loop:
|
||||
/* In this loop we run background operations when the server
|
||||
is quiet */
|
||||
|
||||
srv_main_thread_op_info = "reserving kernel mutex";
|
||||
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
@ -2419,11 +2423,11 @@ background_loop:
|
||||
/* The server has been quiet for a while: start running background
|
||||
operations */
|
||||
|
||||
srv_main_thread_op_info = "purging";
|
||||
srv_main_thread_op_info = (char *) "purging";
|
||||
|
||||
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);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
@ -2432,10 +2436,10 @@ background_loop:
|
||||
}
|
||||
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);
|
||||
|
||||
srv_main_thread_op_info = "reserving kernel mutex";
|
||||
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
@ -2444,10 +2448,10 @@ background_loop:
|
||||
}
|
||||
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);
|
||||
|
||||
srv_main_thread_op_info = "reserving kernel mutex";
|
||||
srv_main_thread_op_info = (char *) "reserving kernel mutex";
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
@ -2456,14 +2460,15 @@ background_loop:
|
||||
}
|
||||
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);
|
||||
|
||||
srv_main_thread_op_info = "making checkpoint";
|
||||
srv_main_thread_op_info = (char *) "making checkpoint";
|
||||
|
||||
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);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
@ -2472,7 +2477,8 @@ background_loop:
|
||||
}
|
||||
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);
|
||||
|
||||
@ -2496,7 +2502,7 @@ background_loop:
|
||||
master thread to wait for more server activity */
|
||||
|
||||
suspend_thread:
|
||||
srv_main_thread_op_info = "suspending";
|
||||
srv_main_thread_op_info = (char *) "suspending";
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
@ -2504,7 +2510,7 @@ suspend_thread:
|
||||
|
||||
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);
|
||||
|
||||
|
@ -131,7 +131,8 @@ static
|
||||
void
|
||||
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__
|
||||
ulint i;
|
||||
@ -311,7 +312,8 @@ open_or_create_log_file(
|
||||
if (k == 0 && i == 0) {
|
||||
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 {
|
||||
arch_space_id = ULINT_UNDEFINED;
|
||||
}
|
||||
@ -509,6 +511,7 @@ open_or_create_data_files(
|
||||
|
||||
/*********************************************************************
|
||||
This thread is used to measure contention of latches. */
|
||||
#ifdef NOT_USED
|
||||
static
|
||||
ulint
|
||||
test_measure_cont(
|
||||
@ -578,7 +581,7 @@ test_measure_cont(
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/********************************************************************
|
||||
Starts InnoDB and creates a new database if database files
|
||||
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_startup_is_before_trx_rollback_phase = TRUE;
|
||||
|
||||
if (0 == ut_strcmp(srv_unix_file_flush_method_str, "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;
|
||||
if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||
(char *) "fdatasync")) {
|
||||
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
|
||||
|
||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||
"littlesync")) {
|
||||
srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
|
||||
(char *) "O_DSYNC")) {
|
||||
srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
|
||||
|
||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str, "nosync")) {
|
||||
srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
|
||||
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
|
||||
(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 {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Unrecognized value %s for innodb_flush_method\n",
|
||||
|
@ -446,7 +446,7 @@ sync_array_cell_print(
|
||||
{
|
||||
mutex_t* mutex;
|
||||
rw_lock_t* rwlock;
|
||||
char* str = NULL;
|
||||
char* str __attribute__((unused)) = NULL;
|
||||
ulint type;
|
||||
|
||||
type = cell->request_type;
|
||||
|
@ -115,8 +115,8 @@ rw_lock_create_func(
|
||||
lock->cfile_name = cfile_name;
|
||||
lock->cline = cline;
|
||||
|
||||
lock->last_s_file_name = "not yet reserved";
|
||||
lock->last_x_file_name = "not yet reserved";
|
||||
lock->last_s_file_name = (char *) "not yet reserved";
|
||||
lock->last_x_file_name = (char *) "not yet reserved";
|
||||
lock->last_s_line = 0;
|
||||
lock->last_x_line = 0;
|
||||
|
||||
@ -789,7 +789,7 @@ Prints debug info of an rw-lock. */
|
||||
void
|
||||
rw_lock_print(
|
||||
/*==========*/
|
||||
rw_lock_t* lock) /* in: rw-lock */
|
||||
rw_lock_t* lock __attribute__((unused))) /* in: rw-lock */
|
||||
{
|
||||
#ifndef UNIV_SYNC_DEBUG
|
||||
printf(
|
||||
|
@ -229,7 +229,7 @@ mutex_create_func(
|
||||
mutex_set_waiters(mutex, 0);
|
||||
mutex->magic_n = MUTEX_MAGIC_N;
|
||||
mutex->line = 0;
|
||||
mutex->file_name = "not yet reserved";
|
||||
mutex->file_name = (char *) "not yet reserved";
|
||||
mutex->thread_id = ULINT_UNDEFINED;
|
||||
mutex->level = SYNC_LEVEL_NONE;
|
||||
mutex->cfile_name = cfile_name;
|
||||
|
@ -674,9 +674,9 @@ trx_purge_choose_next_log(void)
|
||||
trx_rseg_t* rseg;
|
||||
trx_rseg_t* min_rseg;
|
||||
dulint min_trx_no;
|
||||
ulint space;
|
||||
ulint page_no;
|
||||
ulint offset;
|
||||
ulint space = 0; /* remove warning (??? bug ???) */
|
||||
ulint page_no = 0; /* remove warning (??? bug ???) */
|
||||
ulint offset = 0; /* remove warning (??? bug ???) */
|
||||
mtr_t mtr;
|
||||
|
||||
ut_ad(mutex_own(&(purge_sys->mutex)));
|
||||
|
@ -989,7 +989,7 @@ trx_undo_parse_erase_page_end(
|
||||
/*==========================*/
|
||||
/* out: end of log record or NULL */
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
@ -1263,7 +1263,8 @@ trx_undo_prev_version_build(
|
||||
DB_ERROR if corrupted record */
|
||||
rec_t* index_rec,/* in: clustered index record in the
|
||||
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 */
|
||||
rec_t* rec, /* in: version of a clustered index record */
|
||||
dict_index_t* index, /* in: clustered index */
|
||||
|
@ -101,7 +101,7 @@ trx_rollback_for_mysql(
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
trx->op_info = "rollback";
|
||||
trx->op_info = (char *) "rollback";
|
||||
|
||||
/* Tell Innobase server that there might be work for
|
||||
utility threads: */
|
||||
@ -117,7 +117,7 @@ trx_rollback_for_mysql(
|
||||
|
||||
srv_active_wake_master_thread();
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
@ -138,7 +138,7 @@ trx_rollback_last_sql_stat_for_mysql(
|
||||
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
|
||||
utility threads: */
|
||||
@ -154,7 +154,7 @@ trx_rollback_last_sql_stat_for_mysql(
|
||||
|
||||
srv_active_wake_master_thread();
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
@ -180,7 +180,7 @@ trx_rollback_all_without_sess(void)
|
||||
|
||||
if (!trx_dummy_sess) {
|
||||
trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
|
||||
ut_strlen("Dummy sess"));
|
||||
ut_strlen((char *) "Dummy sess"));
|
||||
}
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
@ -64,7 +64,7 @@ trx_create(
|
||||
|
||||
trx = mem_alloc(sizeof(trx_t));
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
trx->type = TRX_USER;
|
||||
trx->conc_state = TRX_NOT_STARTED;
|
||||
@ -135,7 +135,7 @@ trx_allocate_for_mysql(void)
|
||||
|
||||
if (!trx_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);
|
||||
@ -991,7 +991,7 @@ trx_sig_send(
|
||||
ut_a(0);
|
||||
|
||||
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
|
||||
@ -1292,7 +1292,7 @@ trx_commit_for_mysql(
|
||||
|
||||
ut_a(trx);
|
||||
|
||||
trx->op_info = "committing";
|
||||
trx->op_info = (char *) "committing";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
@ -1302,7 +1302,7 @@ trx_commit_for_mysql(
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
trx->op_info = "";
|
||||
trx->op_info = (char *) "";
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ trx_undo_seg_create(
|
||||
/*================*/
|
||||
/* out: segment header page x-latched, NULL
|
||||
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
|
||||
x-latched */
|
||||
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 */
|
||||
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 */
|
||||
mtr_t* mtr) /* in: mtr or NULL */
|
||||
{
|
||||
@ -844,7 +844,7 @@ static
|
||||
void
|
||||
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 */
|
||||
ulint page_no,/* in: page number to free: must not be the
|
||||
header page */
|
||||
@ -1560,7 +1560,7 @@ trx_undo_set_state_at_finish(
|
||||
/*=========================*/
|
||||
/* out: undo log segment header page,
|
||||
x-latched */
|
||||
trx_t* trx, /* in: transaction */
|
||||
trx_t* trx __attribute__((unused)), /* in: transaction */
|
||||
trx_undo_t* undo, /* in: undo log memory copy */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
|
@ -1712,7 +1712,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
charset_name=charset_name_buff;
|
||||
sprintf(charset_name,"%d",mysql->server_language); /* In case of errors */
|
||||
if (!(mysql->charset =
|
||||
get_charset((uint8) mysql->server_language, MYF(MY_WME))))
|
||||
get_charset((uint8) mysql->server_language, MYF(0))))
|
||||
mysql->charset = default_charset_info; /* shouldn't be fatal */
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
|
||||
|
||||
/* TODO: add caching - pre-read several index entries at once */
|
||||
|
||||
#define FT_CORE
|
||||
#include "ftdefs.h"
|
||||
#include <queues.h>
|
||||
@ -78,7 +80,7 @@ typedef struct st_ft_info {
|
||||
struct _ft_vft *please;
|
||||
MI_INFO *info;
|
||||
uint keynr;
|
||||
int ok;
|
||||
enum { UNINITIALIZED, READY, INDEX_SEARCH, INDEX_DONE, SCAN } state;
|
||||
FTB_EXPR *root;
|
||||
QUEUE queue;
|
||||
MEM_ROOT mem_root;
|
||||
@ -101,13 +103,9 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
|
||||
FT_WORD w;
|
||||
FTB_WORD *ftbw;
|
||||
FTB_EXPR *ftbe;
|
||||
MI_INFO *info=ftb->info;
|
||||
int r;
|
||||
MI_KEYDEF *keyinfo=info->s->keyinfo+ftb->keynr;
|
||||
my_off_t keyroot=info->s->state.key_root[ftb->keynr];
|
||||
uint extra=HA_FT_WLEN+info->s->rec_reflength; /* just a shortcut */
|
||||
uint extra=HA_FT_WLEN+ftb->info->s->rec_reflength; /* just a shortcut */
|
||||
|
||||
if (! ftb->ok)
|
||||
if (ftb->state != UNINITIALIZED)
|
||||
return;
|
||||
|
||||
param.prev=' ';
|
||||
@ -132,7 +130,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
|
||||
case 1:
|
||||
ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
|
||||
sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : w.len+extra));
|
||||
ftbw->len=w.len + !param.trunc;
|
||||
ftbw->len=w.len+1;
|
||||
ftbw->yesno=param.yesno;
|
||||
ftbw->trunc=param.trunc; /* 0 or 1 */
|
||||
ftbw->weight=weight;
|
||||
@ -142,37 +140,55 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
|
||||
memcpy(ftbw->word+1, w.pos, w.len);
|
||||
ftbw->word[0]=w.len;
|
||||
if (ftbw->yesno > 0) up->ythresh++;
|
||||
/*****************************************/
|
||||
r=_mi_search(info, keyinfo, ftbw->word, ftbw->len,
|
||||
SEARCH_FIND | SEARCH_PREFIX, keyroot);
|
||||
if (!r)
|
||||
{
|
||||
r=_mi_compare_text(default_charset_info,
|
||||
info->lastkey+ftbw->trunc,ftbw->len,
|
||||
ftbw->word+ftbw->trunc,ftbw->len,0);
|
||||
}
|
||||
if (r) /* not found */
|
||||
{
|
||||
if (ftbw->yesno>0 && ftbw->up->up==0)
|
||||
{ /* this word MUST BE present in every document returned,
|
||||
so we can abort the search right now */
|
||||
ftb->ok=0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(ftbw->word, info->lastkey, info->lastkey_length);
|
||||
ftbw->docid=info->lastpos;
|
||||
queue_insert(& ftb->queue, (byte *)ftbw);
|
||||
}
|
||||
/*****************************************/
|
||||
queue_insert(& ftb->queue, (byte *)ftbw);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void _ftb_init_index_search(FT_INFO *ftb)
|
||||
{
|
||||
int i, r;
|
||||
FTB_WORD *ftbw;
|
||||
MI_INFO *info=ftb->info;
|
||||
MI_KEYDEF *keyinfo=info->s->keyinfo+ftb->keynr;
|
||||
my_off_t keyroot=info->s->state.key_root[ftb->keynr];
|
||||
|
||||
if (ftb->state != READY)
|
||||
return;
|
||||
ftb->state=INDEX_SEARCH;
|
||||
|
||||
for (i=ftb->queue.elements; i; i--)
|
||||
{
|
||||
ftbw=(FTB_WORD *)(ftb->queue.root[i]);
|
||||
|
||||
r=_mi_search(info, keyinfo, ftbw->word, ftbw->len,
|
||||
SEARCH_FIND | SEARCH_PREFIX, keyroot);
|
||||
if (!r)
|
||||
{
|
||||
r=_mi_compare_text(default_charset_info,
|
||||
info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc,
|
||||
ftbw->word+ftbw->trunc,ftbw->len-ftbw->trunc,0);
|
||||
}
|
||||
if (r) /* not found */
|
||||
{
|
||||
if (ftbw->yesno>0 && ftbw->up->up==0)
|
||||
{ /* this word MUST BE present in every document returned,
|
||||
so we can abort the search right now */
|
||||
ftb->state=INDEX_DONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(ftbw->word, info->lastkey, info->lastkey_length);
|
||||
ftbw->docid=info->lastpos;
|
||||
}
|
||||
}
|
||||
queue_fix(& ftb->queue);
|
||||
}
|
||||
|
||||
FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
|
||||
uint query_len, my_bool presort __attribute__((unused)))
|
||||
{
|
||||
@ -183,7 +199,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
|
||||
if (!(ftb=(FTB *)my_malloc(sizeof(FTB), MYF(MY_WME))))
|
||||
return 0;
|
||||
ftb->please= (struct _ft_vft *) & _ft_vft_boolean;
|
||||
ftb->ok=1;
|
||||
ftb->state=UNINITIALIZED;
|
||||
ftb->info=info;
|
||||
ftb->keynr=keynr;
|
||||
|
||||
@ -202,9 +218,63 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
|
||||
ftbe->docid=HA_POS_ERROR;
|
||||
ftb->root=ftbe;
|
||||
_ftb_parse_query(ftb, &query, query+query_len, ftbe, 0, 0);
|
||||
ftb->state=READY;
|
||||
return ftb;
|
||||
}
|
||||
|
||||
void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc)
|
||||
{
|
||||
FTB_EXPR *ftbe;
|
||||
float weight=ftbw->weight;
|
||||
int yn=ftbw->yesno;
|
||||
|
||||
for (ftbe=ftbw->up; ftbe; ftbe=ftbe->up)
|
||||
{
|
||||
if (ftbe->docid != curdoc)
|
||||
{
|
||||
ftbe->cur_weight=ftbe->yesses=ftbe->nos=0;
|
||||
ftbe->docid=curdoc;
|
||||
}
|
||||
if (yn>0)
|
||||
{
|
||||
ftbe->cur_weight+=weight;
|
||||
if (++ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
|
||||
{
|
||||
yn=ftbe->yesno;
|
||||
weight=ftbe->cur_weight*ftbe->weight;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
if (yn<0)
|
||||
{
|
||||
/* NOTE: special sort function of queue assures that all yn<0
|
||||
* events for every particular subexpression will
|
||||
* "auto-magically" happen BEFORE all yn>=0 events. So no
|
||||
* already matched expression can become not-matched again.
|
||||
*/
|
||||
++ftbe->nos;
|
||||
break;
|
||||
}
|
||||
else
|
||||
/* if (yn==0) */
|
||||
{
|
||||
if (ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
|
||||
{
|
||||
yn=ftbe->yesno;
|
||||
ftbe->cur_weight=weight;
|
||||
weight*=ftbe->weight;
|
||||
}
|
||||
else
|
||||
{
|
||||
ftbe->cur_weight+=weight;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
{
|
||||
FTB_EXPR *ftbe, *up;
|
||||
@ -215,6 +285,9 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
my_off_t curdoc;
|
||||
int r;
|
||||
|
||||
if (ftb->state != INDEX_SEARCH && ftb->state != INDEX_DONE)
|
||||
return -1;
|
||||
|
||||
/* black magic ON */
|
||||
if ((int) _mi_check_index(info, ftb->keynr) < 0)
|
||||
return my_errno;
|
||||
@ -225,66 +298,21 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
if (!ftb->queue.elements)
|
||||
return my_errno=HA_ERR_END_OF_FILE;
|
||||
|
||||
while(ftb->ok &&
|
||||
while(ftb->state == INDEX_SEARCH &&
|
||||
(curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid) != HA_POS_ERROR)
|
||||
{
|
||||
while (curdoc==(ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid)
|
||||
{
|
||||
float weight=ftbw->weight;
|
||||
int yn=ftbw->yesno;
|
||||
for (ftbe=ftbw->up; ftbe; ftbe=ftbe->up)
|
||||
{
|
||||
if (ftbe->docid != curdoc)
|
||||
{
|
||||
ftbe->cur_weight=ftbe->yesses=ftbe->nos=0;
|
||||
ftbe->docid=curdoc;
|
||||
}
|
||||
if (yn>0)
|
||||
{
|
||||
ftbe->cur_weight+=weight;
|
||||
if (++ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
|
||||
{
|
||||
yn=ftbe->yesno;
|
||||
weight=ftbe->cur_weight*ftbe->weight;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
if (yn<0)
|
||||
{
|
||||
/* NOTE: special sort function of queue assures that all yn<0
|
||||
* events for every particular subexpression will
|
||||
* "auto-magically" happen BEFORE all yn>=0 events. So no
|
||||
* already matched expression can become not-matched again.
|
||||
*/
|
||||
++ftbe->nos;
|
||||
break;
|
||||
}
|
||||
else
|
||||
/* if (yn==0) */
|
||||
{
|
||||
if (ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
|
||||
{
|
||||
yn=ftbe->yesno;
|
||||
ftbe->cur_weight=weight;
|
||||
weight*=ftbe->weight;
|
||||
}
|
||||
else
|
||||
{
|
||||
ftbe->cur_weight+=weight;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_ftb_climb_the_tree(ftbw, curdoc);
|
||||
|
||||
/* update queue */
|
||||
r=_mi_search(info, keyinfo, ftbw->word, USE_WHOLE_KEY, /*ftbw->len,*/
|
||||
r=_mi_search(info, keyinfo, ftbw->word, USE_WHOLE_KEY,
|
||||
SEARCH_BIGGER , keyroot);
|
||||
if (!r)
|
||||
{
|
||||
r=_mi_compare_text(default_charset_info,
|
||||
info->lastkey+ftbw->trunc,ftbw->len,
|
||||
ftbw->word+ftbw->trunc,ftbw->len,0);
|
||||
info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc,
|
||||
ftbw->word+ftbw->trunc,ftbw->len-ftbw->trunc,0);
|
||||
}
|
||||
if (r) /* not found */
|
||||
{
|
||||
@ -292,7 +320,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
if (ftbw->yesno>0 && ftbw->up->up==0)
|
||||
{ /* this word MUST BE present in every document returned,
|
||||
so we can stop the search right now */
|
||||
ftb->ok=0;
|
||||
ftb->state=INDEX_DONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -304,7 +332,8 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
}
|
||||
|
||||
ftbe=ftb->root;
|
||||
if (ftbe->cur_weight>0 && ftbe->yesses>=ftbe->ythresh && !ftbe->nos)
|
||||
if (ftbe->docid==curdoc && ftbe->cur_weight>0 &&
|
||||
ftbe->yesses>=ftbe->ythresh && !ftbe->nos)
|
||||
{
|
||||
/* curdoc matched ! */
|
||||
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); /* why is this ? */
|
||||
@ -321,10 +350,56 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
|
||||
return my_errno=HA_ERR_END_OF_FILE;
|
||||
}
|
||||
|
||||
float ft_boolean_find_relevance(FT_INFO *ftb,
|
||||
my_off_t docid __attribute__((unused)), byte *record)
|
||||
float ft_boolean_find_relevance(FT_INFO *ftb, my_off_t docid, byte *record)
|
||||
{
|
||||
return -1.0; /* to be done via str scan */
|
||||
TREE ptree;
|
||||
FT_WORD word;
|
||||
FTB_WORD *ftbw;
|
||||
FTB_EXPR *ftbe;
|
||||
uint i;
|
||||
|
||||
if (ftb->state == READY)
|
||||
{
|
||||
queue_fix(& ftb->queue);
|
||||
ftb->state=SCAN;
|
||||
}
|
||||
else if (ftb->state != SCAN)
|
||||
return -1.0;
|
||||
|
||||
bzero(&ptree, sizeof(ptree));
|
||||
if (_mi_ft_parse(& ptree, ftb->info, ftb->keynr, record))
|
||||
return -1.0;
|
||||
|
||||
for (i=1; i<=ftb->queue.elements; i++)
|
||||
{
|
||||
ftbw=(FTB_WORD *)(ftb->queue.root[i]);
|
||||
ptree.custom_arg=(void *)(ftbw->trunc);
|
||||
word.pos=ftbw->word+1;
|
||||
word.len=ftbw->len-1;
|
||||
if (tree_search(& ptree, & word))
|
||||
{ /* found! */
|
||||
_ftb_climb_the_tree(ftbw, docid);
|
||||
}
|
||||
else
|
||||
{ /* not found! */
|
||||
if (ftbw->yesno>0 && ftbw->up->up==0)
|
||||
{ /* but this word MUST BE present in every document matched,
|
||||
so we can stop the search right now */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete_tree(& ptree);
|
||||
ftbe=ftb->root;
|
||||
if (ftbe->docid==docid && ftbe->cur_weight>0 &&
|
||||
ftbe->yesses>=ftbe->ythresh && !ftbe->nos)
|
||||
{ /* row matched ! */
|
||||
return ftbe->cur_weight;
|
||||
}
|
||||
else
|
||||
{ /* match failed ! */
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void ft_boolean_close_search(FT_INFO *ftb)
|
||||
@ -338,13 +413,8 @@ float ft_boolean_get_relevance(FT_INFO *ftb)
|
||||
return ftb->root->cur_weight;
|
||||
}
|
||||
|
||||
my_off_t ft_boolean_get_docid(FT_INFO *ftb)
|
||||
{
|
||||
return HA_POS_ERROR;
|
||||
}
|
||||
|
||||
void ft_boolean_reinit_search(FT_INFO *ftb)
|
||||
{
|
||||
fprintf(stderr, "ft_boolean_reinit_search called!\n");
|
||||
_ftb_init_index_search(ftb);
|
||||
}
|
||||
|
||||
|
@ -278,11 +278,6 @@ float ft_nlq_get_relevance(FT_INFO *handler)
|
||||
return handler->doc[handler->curdoc].weight;
|
||||
}
|
||||
|
||||
my_off_t ft_nlq_get_docid(FT_INFO *handler)
|
||||
{
|
||||
return handler->doc[handler->curdoc].dpos;
|
||||
}
|
||||
|
||||
void ft_nlq_reinit_search(FT_INFO *handler)
|
||||
{
|
||||
handler->curdoc=-1;
|
||||
|
@ -33,17 +33,16 @@ typedef struct st_ft_docstat {
|
||||
double max, nsum, nsum2;
|
||||
#endif /* EVAL_RUN */
|
||||
|
||||
MI_INFO *info;
|
||||
uint keynr;
|
||||
byte *keybuf;
|
||||
// MI_INFO *info;
|
||||
// uint keynr;
|
||||
// byte *keybuf;
|
||||
} FT_DOCSTAT;
|
||||
|
||||
static int FT_WORD_cmp(void* cmp_arg __attribute__((unused)),
|
||||
FT_WORD *w1, FT_WORD *w2)
|
||||
static int FT_WORD_cmp(void* cmp_arg, FT_WORD *w1, FT_WORD *w2)
|
||||
{
|
||||
return _mi_compare_text(default_charset_info,
|
||||
(uchar*) w1->pos,w1->len,
|
||||
(uchar*) w2->pos, w2->len,0);
|
||||
(uchar*) w2->pos, w2->len,(my_bool)cmp_arg);
|
||||
}
|
||||
|
||||
static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
|
||||
@ -64,7 +63,9 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
|
||||
|
||||
/* transforms tree of words into the array, applying normalization */
|
||||
|
||||
FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
|
||||
FT_WORD * ft_linearize(//MI_INFO *info, uint keynr,
|
||||
//byte *keybuf,
|
||||
TREE *wtree)
|
||||
{
|
||||
FT_WORD *wlist,*p;
|
||||
FT_DOCSTAT docstat;
|
||||
@ -73,9 +74,9 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
|
||||
if ((wlist=(FT_WORD *) my_malloc(sizeof(FT_WORD)*
|
||||
(1+wtree->elements_in_tree),MYF(0))))
|
||||
{
|
||||
docstat.info=info;
|
||||
docstat.keynr=keynr;
|
||||
docstat.keybuf=keybuf;
|
||||
// docstat.info=info;
|
||||
// docstat.keynr=keynr;
|
||||
// docstat.keybuf=keybuf;
|
||||
docstat.list=wlist;
|
||||
docstat.uniq=wtree->elements_in_tree;
|
||||
#ifdef EVAL_RUN
|
||||
@ -207,19 +208,6 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_boolean(byte *q, uint len)
|
||||
{
|
||||
if (!len) return 0;
|
||||
if (*q == FTB_YES || *q == FTB_NO) return 1;
|
||||
|
||||
for (++q; --len; ++q)
|
||||
{
|
||||
if ((*q == FTB_YES || *q == FTB_NO) && q[-1] == ' ' && true_word_char(q[1]))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
TREE * ft_parse(TREE *wtree, byte *doc, int doclen)
|
||||
{
|
||||
byte *end=doc+doclen;
|
||||
|
@ -49,11 +49,11 @@ const MI_KEYSEG ft_keysegs[FT_SEGS]={
|
||||
|
||||
const struct _ft_vft _ft_vft_nlq = {
|
||||
ft_nlq_read_next, ft_nlq_find_relevance, ft_nlq_close_search,
|
||||
ft_nlq_get_relevance, ft_nlq_get_docid, ft_nlq_reinit_search
|
||||
ft_nlq_get_relevance, ft_nlq_reinit_search
|
||||
};
|
||||
const struct _ft_vft _ft_vft_boolean = {
|
||||
ft_boolean_read_next, ft_boolean_find_relevance, ft_boolean_close_search,
|
||||
ft_boolean_get_relevance, ft_boolean_get_docid, ft_boolean_reinit_search
|
||||
ft_boolean_get_relevance, ft_boolean_reinit_search
|
||||
};
|
||||
|
||||
FT_INFO *(*_ft_init_vft[2])(MI_INFO *, uint, byte *, uint, my_bool) =
|
||||
|
@ -29,17 +29,12 @@
|
||||
|
||||
|
||||
/* parses a document i.e. calls _mi_ft_parse for every keyseg */
|
||||
FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
const byte *record)
|
||||
uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record)
|
||||
{
|
||||
TREE *parsed, ptree;
|
||||
MI_KEYSEG *keyseg;
|
||||
byte *pos;
|
||||
uint i;
|
||||
MI_KEYSEG *keyseg=info->s->keyinfo[keynr].seg;
|
||||
|
||||
bzero(parsed=&ptree, sizeof(ptree));
|
||||
|
||||
keyseg=info->s->keyinfo[keynr].seg;
|
||||
for (i=info->s->keyinfo[keynr].keysegs-FT_SEGS ; i-- ; )
|
||||
{
|
||||
uint len;
|
||||
@ -62,13 +57,26 @@ FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
}
|
||||
else
|
||||
len=keyseg->length;
|
||||
if (!(parsed=ft_parse(parsed, pos, len)))
|
||||
return NULL;
|
||||
if (!(ft_parse(parsed, pos, len)))
|
||||
return 1;
|
||||
}
|
||||
/* Handle the case where all columns are NULL */
|
||||
if (!is_tree_inited(parsed) && !(parsed=ft_parse(parsed, (byte*) "", 0)))
|
||||
if (!is_tree_inited(parsed) && !(ft_parse(parsed, (byte*) "", 0)))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
const byte *record)
|
||||
{
|
||||
TREE ptree;
|
||||
|
||||
bzero(&ptree, sizeof(ptree));
|
||||
if (_mi_ft_parse(& ptree, info, keynr, record))
|
||||
return NULL;
|
||||
return ft_linearize(info, keynr, keybuf, parsed);
|
||||
|
||||
return ft_linearize(/*info, keynr, keybuf, */ & ptree);
|
||||
}
|
||||
|
||||
static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
@ -158,7 +166,7 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
|
||||
}
|
||||
|
||||
/* update a document entry */
|
||||
int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
|
||||
const byte *oldrec, const byte *newrec, my_off_t pos)
|
||||
{
|
||||
int error= -1;
|
||||
|
@ -120,8 +120,8 @@ byte ft_get_word(byte **, byte *, FT_WORD *, FTB_PARAM *);
|
||||
byte ft_simple_get_word(byte **, byte *, FT_WORD *);
|
||||
|
||||
TREE * ft_parse(TREE *, byte *, int);
|
||||
FT_WORD * ft_linearize(MI_INFO *, uint, byte *, TREE *);
|
||||
FT_WORD * _mi_ft_parserecord(MI_INFO *, uint , byte *, const byte *);
|
||||
FT_WORD * ft_linearize(/*MI_INFO *, uint, byte *, */TREE *);
|
||||
FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, byte *, const byte *);
|
||||
|
||||
const struct _ft_vft _ft_vft_nlq;
|
||||
FT_INFO *ft_init_nlq_search(MI_INFO *, uint, byte *, uint, my_bool);
|
||||
|
@ -21,8 +21,8 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka');
|
||||
INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
|
||||
INSERT INTO t2 VALUES (7,1,'Bife');
|
||||
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t1, t2
|
||||
WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi')
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
q item id x
|
||||
aaaaaaaaa dsaass de sushi 1 1.92378664016724
|
||||
aaaaaaaaa dsaass de Bolo de Chocolate 2 0
|
||||
@ -32,8 +32,19 @@ ssde df s fsda sad er um copo de Vodka 5 0
|
||||
ssde df s fsda sad er um chocolate Snickers 6 0
|
||||
aaaaaaaaa dsaass de Bife 7 0
|
||||
aaaaaaaaa dsaass de Pizza de Salmao 8 0
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t2, t1
|
||||
WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
q item id x
|
||||
aaaaaaaaa dsaass de sushi 1 1
|
||||
aaaaaaaaa dsaass de Bolo de Chocolate 2 0
|
||||
aaaaaaaaa dsaass de Feijoada 3 0
|
||||
aaaaaaaaa dsaass de Mousse de Chocolate 4 0
|
||||
ssde df s fsda sad er um copo de Vodka 5 0
|
||||
ssde df s fsda sad er um chocolate Snickers 6 0
|
||||
aaaaaaaaa dsaass de Bife 7 0
|
||||
aaaaaaaaa dsaass de Pizza de Salmao 8 0
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi')
|
||||
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
q item id x
|
||||
aaaaaaaaa dsaass de sushi 1 1.92378664016724
|
||||
aaaaaaaaa dsaass de Bolo de Chocolate 2 0
|
||||
@ -43,4 +54,15 @@ ssde df s fsda sad er um copo de Vodka 5 0
|
||||
ssde df s fsda sad er um chocolate Snickers 6 0
|
||||
aaaaaaaaa dsaass de Bife 7 0
|
||||
aaaaaaaaa dsaass de Pizza de Salmao 8 0
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
q item id x
|
||||
aaaaaaaaa dsaass de sushi 1 1
|
||||
aaaaaaaaa dsaass de Bolo de Chocolate 2 0
|
||||
aaaaaaaaa dsaass de Feijoada 3 0
|
||||
aaaaaaaaa dsaass de Mousse de Chocolate 4 0
|
||||
ssde df s fsda sad er um copo de Vodka 5 0
|
||||
ssde df s fsda sad er um chocolate Snickers 6 0
|
||||
aaaaaaaaa dsaass de Bife 7 0
|
||||
aaaaaaaaa dsaass de Pizza de Salmao 8 0
|
||||
drop table t1, t2;
|
||||
|
@ -26,10 +26,16 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
|
||||
INSERT INTO t2 VALUES (7,1,'Bife');
|
||||
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t1, t2
|
||||
WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi')
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t2, t1
|
||||
WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi')
|
||||
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
|
||||
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
|
||||
|
||||
drop table t1, t2;
|
||||
|
@ -296,7 +296,7 @@ static CHARSET_INFO *find_charset_by_name(CHARSET_INFO **table,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static CHARSET_INFO *add_charset(uint cs_number, const char *cs_name)
|
||||
static CHARSET_INFO *add_charset(uint cs_number, const char *cs_name, myf flags)
|
||||
{
|
||||
CHARSET_INFO tmp_cs,*cs;
|
||||
uchar tmp_ctype[CTYPE_TABLE_SIZE];
|
||||
@ -311,11 +311,11 @@ static CHARSET_INFO *add_charset(uint cs_number, const char *cs_name)
|
||||
cs->to_lower=tmp_to_lower;
|
||||
cs->to_upper=tmp_to_upper;
|
||||
cs->sort_order=tmp_sort_order;
|
||||
if (read_charset_file(cs_number, cs, MYF(MY_WME)))
|
||||
if (read_charset_file(cs_number, cs, flags))
|
||||
return NULL;
|
||||
|
||||
cs = (CHARSET_INFO*) my_once_alloc(sizeof(CHARSET_INFO),
|
||||
MYF(MY_WME));
|
||||
MYF(MY_WME));
|
||||
*cs=tmp_cs;
|
||||
cs->name = (char *) my_once_alloc((uint) strlen(cs_name)+1, MYF(MY_WME));
|
||||
cs->ctype = (uchar*) my_once_alloc(CTYPE_TABLE_SIZE, MYF(MY_WME));
|
||||
@ -333,7 +333,7 @@ static CHARSET_INFO *add_charset(uint cs_number, const char *cs_name)
|
||||
return cs;
|
||||
}
|
||||
|
||||
static CHARSET_INFO *get_internal_charset(uint cs_number)
|
||||
static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
|
||||
{
|
||||
CHARSET_INFO *cs;
|
||||
/*
|
||||
@ -344,13 +344,13 @@ static CHARSET_INFO *get_internal_charset(uint cs_number)
|
||||
if (!(cs = find_charset((CHARSET_INFO**) cs_info_table.buffer, cs_number,
|
||||
cs_info_table.elements)))
|
||||
if (!(cs = find_compiled_charset(cs_number)))
|
||||
cs=add_charset(cs_number, get_charset_name(cs_number));
|
||||
cs=add_charset(cs_number, get_charset_name(cs_number), flags);
|
||||
pthread_mutex_unlock(&THR_LOCK_charset);
|
||||
return cs;
|
||||
}
|
||||
|
||||
|
||||
static CHARSET_INFO *get_internal_charset_by_name(const char *name)
|
||||
static CHARSET_INFO *get_internal_charset_by_name(const char *name, myf flags)
|
||||
{
|
||||
CHARSET_INFO *cs;
|
||||
/*
|
||||
@ -361,7 +361,7 @@ static CHARSET_INFO *get_internal_charset_by_name(const char *name)
|
||||
if (!(cs = find_charset_by_name((CHARSET_INFO**) cs_info_table.buffer, name,
|
||||
cs_info_table.elements)))
|
||||
if (!(cs = find_compiled_charset_by_name(name)))
|
||||
cs=add_charset(get_charset_number(name), name);
|
||||
cs=add_charset(get_charset_number(name), name, flags);
|
||||
pthread_mutex_unlock(&THR_LOCK_charset);
|
||||
return cs;
|
||||
}
|
||||
@ -371,7 +371,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
|
||||
{
|
||||
CHARSET_INFO *cs;
|
||||
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
|
||||
cs=get_internal_charset(cs_number);
|
||||
cs=get_internal_charset(cs_number, flags);
|
||||
|
||||
if (!cs && (flags & MY_WME))
|
||||
{
|
||||
@ -403,7 +403,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags)
|
||||
{
|
||||
CHARSET_INFO *cs;
|
||||
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
|
||||
cs=get_internal_charset_by_name(cs_name);
|
||||
cs=get_internal_charset_by_name(cs_name, flags);
|
||||
|
||||
if (!cs && (flags & MY_WME))
|
||||
{
|
||||
|
@ -124,7 +124,6 @@ byte *queue_remove(register QUEUE *queue, uint idx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Fix when element on top has been replaced */
|
||||
|
||||
#ifndef queue_replaced
|
||||
@ -166,3 +165,19 @@ void _downheap(register QUEUE *queue, uint idx)
|
||||
}
|
||||
queue->root[idx]=element;
|
||||
}
|
||||
|
||||
|
||||
static int queue_fix_cmp(QUEUE *queue, void *a, void *b)
|
||||
{
|
||||
return queue->compare(queue->first_cmp_arg,
|
||||
a+queue->offset_to_key,
|
||||
b+queue->offset_to_key);
|
||||
}
|
||||
|
||||
/* Fix heap when every element was changed */
|
||||
void queue_fix(QUEUE *queue)
|
||||
{
|
||||
qsort2(queue->root+1,queue->elements, sizeof(void *),
|
||||
(qsort2_cmp)queue_fix_cmp, queue);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user