Commit 83b1d82a authored by matthias@three.local.lan's avatar matthias@three.local.lan

Merge three.local.lan:/home/matthias/Arbeit/mysql-5.0/src

into three.local.lan:/home/matthias/Arbeit/mysql-5.0/src-WL1420
parents 48bc6d47 00cc3cbf
...@@ -254,11 +254,14 @@ bkpush.log ...@@ -254,11 +254,14 @@ bkpush.log
bkpush.log* bkpush.log*
build.log build.log
build_tags.sh build_tags.sh
client/decimal.c
client/insert_test client/insert_test
client/log_event.cc client/log_event.cc
client/log_event.h client/log_event.h
client/mf_iocache.c client/mf_iocache.c
client/mf_iocache.cc client/mf_iocache.cc
client/my_decimal.cc
client/my_decimal.h
client/mysql client/mysql
client/mysqladmin client/mysqladmin
client/mysqladmin.c client/mysqladmin.c
...@@ -328,9 +331,12 @@ help.h ...@@ -328,9 +331,12 @@ help.h
include/my_config.h include/my_config.h
include/my_global.h include/my_global.h
include/mysql_version.h include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/readline include/readline
include/readline/*.h include/readline/*.h
include/readline/readline.h include/readline/readline.h
include/sql_state.h
include/widec.h include/widec.h
innobase/autom4te-2.53.cache/* innobase/autom4te-2.53.cache/*
innobase/autom4te-2.53.cache/output.0 innobase/autom4te-2.53.cache/output.0
...@@ -432,6 +438,7 @@ libmysqld/log_event.cc ...@@ -432,6 +438,7 @@ libmysqld/log_event.cc
libmysqld/md5.c libmysqld/md5.c
libmysqld/mf_iocache.cc libmysqld/mf_iocache.cc
libmysqld/mini_client.cc libmysqld/mini_client.cc
libmysqld/my_decimal.cc
libmysqld/my_time.c libmysqld/my_time.c
libmysqld/net_pkg.cc libmysqld/net_pkg.cc
libmysqld/net_serv.cc libmysqld/net_serv.cc
...@@ -985,6 +992,7 @@ support-files/mysql-3.23.29-gamma.spec ...@@ -985,6 +992,7 @@ support-files/mysql-3.23.29-gamma.spec
support-files/mysql-log-rotate support-files/mysql-log-rotate
support-files/mysql.server support-files/mysql.server
support-files/mysql.spec support-files/mysql.spec
support-files/ndb-config-2-node.ini
tags tags
test/ndbapi/bank/bankCreator test/ndbapi/bank/bankCreator
test/ndbapi/bank/bankMakeGL test/ndbapi/bank/bankMakeGL
...@@ -1052,11 +1060,3 @@ vio/test-ssl ...@@ -1052,11 +1060,3 @@ vio/test-ssl
vio/test-sslclient vio/test-sslclient
vio/test-sslserver vio/test-sslserver
vio/viotest-ssl vio/viotest-ssl
include/mysqld_ername.h
include/mysqld_error.h
include/sql_state.h
support-files/ndb-config-2-node.ini
client/decimal.c
client/my_decimal.cc
client/my_decimal.h
libmysqld/my_decimal.cc
This diff is collapsed.
...@@ -151,6 +151,7 @@ monty@tramp.mysql.fi ...@@ -151,6 +151,7 @@ monty@tramp.mysql.fi
monty@work.mysql.com monty@work.mysql.com
mronstrom@build.mysql.com mronstrom@build.mysql.com
mronstrom@mysql.com mronstrom@mysql.com
mskold@bk-internal.mysql.com
mskold@mysql.com mskold@mysql.com
msvensson@build.mysql.com msvensson@build.mysql.com
msvensson@neptunus.homeip.net msvensson@neptunus.homeip.net
......
...@@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db,User)," "PRIMARY KEY Host (Host,Db,User),"
"KEY User (User))" "KEY User (User))"
"engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Database privileges';\n"); "comment='Database privileges';\n");
if (test) if (test)
...@@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db))" "PRIMARY KEY Host (Host,Db))"
"comment='Host privileges;" "engine=MyISAM "
" Merged with database privileges';\n"); "CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Host privileges; Merged with database privileges';\n");
} }
if (test_sys_file(mdata,"mysql/user.frm")) if (test_sys_file(mdata,"mysql/user.frm"))
{ {
#ifdef __WIN__ #ifdef __WIN__
...@@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"max_updates int(11) unsigned DEFAULT 0 NOT NULL," "max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
"max_connections int(11) unsigned DEFAULT 0 NOT NULL," "max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
"PRIMARY KEY Host (Host,User)" "PRIMARY KEY Host (Host,User)"
") comment='Users and global privileges';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Users and global privileges';\n");
if (test) if (test)
{ {
...@@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"dl char(128) DEFAULT '' NOT NULL," "dl char(128) DEFAULT '' NOT NULL,"
"type enum ('function','aggregate') NOT NULL," "type enum ('function','aggregate') NOT NULL,"
"PRIMARY KEY (name)" "PRIMARY KEY (name)"
") comment='User defined functions';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='User defined functions';\n");
} }
if (test_sys_file(mdata,"mysql/tables_priv.frm")) if (test_sys_file(mdata,"mysql/tables_priv.frm"))
...@@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
" DEFAULT '' NOT NULL," " DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name)," "PRIMARY KEY (Host,Db,User,Table_name),"
"KEY Grantor (Grantor)" "KEY Grantor (Grantor)"
") comment='Table privileges';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Table privileges';\n");
} }
if (test_sys_file(mdata,"mysql/columns_priv.frm")) if (test_sys_file(mdata,"mysql/columns_priv.frm"))
...@@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Column_priv set('Select','Insert','Update','References')" "Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL," " DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)" "PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
") comment='Column privileges';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Column privileges';\n");
} }
if (test_sys_file(mdata,"mysql/help_topic.frm")) if (test_sys_file(mdata,"mysql/help_topic.frm"))
...@@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"url varchar(128) not null," "url varchar(128) not null,"
"primary key (help_topic_id)," "primary key (help_topic_id),"
"unique index (name)" "unique index (name)"
") comment='help topics';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help topics';\n");
} }
if (test_sys_file(mdata,"mysql/help_category.frm")) if (test_sys_file(mdata,"mysql/help_category.frm"))
...@@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"url varchar(128) not null," "url varchar(128) not null,"
"primary key (help_category_id)," "primary key (help_category_id),"
"unique index (name)" "unique index (name)"
") comment='help categories';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help categories';\n");
} }
if (test_sys_file(mdata,"mysql/help_keyword.frm")) if (test_sys_file(mdata,"mysql/help_keyword.frm"))
...@@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"name varchar(64) not null," "name varchar(64) not null,"
"primary key (help_keyword_id)," "primary key (help_keyword_id),"
"unique index (name)" "unique index (name)"
") comment='help keywords';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help keywords';\n");
} }
if (test_sys_file(mdata,"mysql/help_relation.frm")) if (test_sys_file(mdata,"mysql/help_relation.frm"))
...@@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"help_topic_id int unsigned not null references help_topic," "help_topic_id int unsigned not null references help_topic,"
"help_keyword_id int unsigned not null references help_keyword," "help_keyword_id int unsigned not null references help_keyword,"
"primary key (help_keyword_id, help_topic_id)" "primary key (help_keyword_id, help_topic_id)"
") comment='keyword-topic relation';\n"); ") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='keyword-topic relation';\n");
} }
if (test_sys_file(mdata,"mysql/time_zone_name.frm")) if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
...@@ -333,7 +354,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -333,7 +354,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Name char(64) NOT NULL," "Name char(64) NOT NULL,"
"Time_zone_id int unsigned NOT NULL," "Time_zone_id int unsigned NOT NULL,"
"PRIMARY KEY Name (Name)" "PRIMARY KEY Name (Name)"
") DEFAULT CHARACTER SET latin1 " ") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone names';\n"); "comment='Time zone names';\n");
if (test) if (test)
...@@ -341,7 +362,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -341,7 +362,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
fprintf(out, fprintf(out,
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
"('MET', 1), ('UTC', 2), ('Universal', 2), " "('MET', 1), ('UTC', 2), ('Universal', 2), "
"('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n"); "('Europe/Moscow',3), ('leap/Europe/Moscow',4),"
"('Japan', 5);\n");
} }
} }
...@@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Time_zone_id int unsigned NOT NULL auto_increment," "Time_zone_id int unsigned NOT NULL auto_increment,"
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY TzId (Time_zone_id)" "PRIMARY KEY TzId (Time_zone_id)"
") DEFAULT CHARACTER SET latin1 " ") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zones';\n"); "comment='Time zones';\n");
if (test) if (test)
{ {
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n"); "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n");
} }
} }
...@@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Transition_time bigint signed NOT NULL," "Transition_time bigint signed NOT NULL,"
"Transition_type_id int unsigned NOT NULL," "Transition_type_id int unsigned NOT NULL,"
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
") DEFAULT CHARACTER SET latin1 " ") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transitions';\n"); "comment='Time zone transitions';\n");
if (test) if (test)
...@@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
",(4, 2045689222, 8) ,(4, 2058390022, 9)" ",(4, 2045689222, 8) ,(4, 2058390022, 9)"
",(4, 2077138822, 8) ,(4, 2090444422, 9)" ",(4, 2077138822, 8) ,(4, 2090444422, 9)"
",(4, 2108588422, 8) ,(4, 2121894022, 9)" ",(4, 2108588422, 8) ,(4, 2121894022, 9)"
",(4, 2140038022, 8);\n"); ",(4, 2140038022, 8), (5, -1009875600, 1);\n");
} }
} }
...@@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL," "Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
"Abbreviation char(8) DEFAULT '' NOT NULL," "Abbreviation char(8) DEFAULT '' NOT NULL,"
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
") DEFAULT CHARACTER SET latin1 " ") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transition types';\n"); "comment='Time zone transition types';\n");
if (test) if (test)
...@@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n"); ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n");
} }
} }
...@@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ...@@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Transition_time bigint signed NOT NULL," "Transition_time bigint signed NOT NULL,"
"Correction int signed NOT NULL," "Correction int signed NOT NULL,"
"PRIMARY KEY TranTime (Transition_time)" "PRIMARY KEY TranTime (Transition_time)"
") DEFAULT CHARACTER SET latin1 " ") engine=MyISAM CHARACTER SET utf8 "
"comment='Leap seconds information for time zones';\n"); "comment='Leap seconds information for time zones';\n");
if (test) if (test)
......
...@@ -800,9 +800,12 @@ int removef(const char *format, ...) ...@@ -800,9 +800,12 @@ int removef(const char *format, ...)
#ifndef STRUCT_DIRENT_HAS_D_TYPE #ifndef STRUCT_DIRENT_HAS_D_TYPE
struct stat st; struct stat st;
if (lstat(entry->d_name, &st) == -1) /* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
if (lstat(temp, &st) == -1)
{ {
return 1; return 1; /* Error couldn't lstat file */
} }
if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))
......
This diff is collapsed.
...@@ -329,7 +329,7 @@ prepare stmt4 from ' show engine bdb logs '; ...@@ -329,7 +329,7 @@ prepare stmt4 from ' show engine bdb logs ';
execute stmt4; execute stmt4;
--enable_result_log --enable_result_log
prepare stmt4 from ' show full processlist '; prepare stmt4 from ' show full processlist ';
--replace_column 1 number 6 time --replace_column 1 number 6 time 3 localhost
execute stmt4; execute stmt4;
prepare stmt4 from ' show grants for user '; prepare stmt4 from ' show grants for user ';
--error 1295 --error 1295
......
...@@ -4834,16 +4834,16 @@ uint8 ha_ndbcluster::table_cache_type() ...@@ -4834,16 +4834,16 @@ uint8 ha_ndbcluster::table_cache_type()
} }
uint ndb_get_commitcount(THD* thd, char* dbname, char* tabname, uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
Uint64* commit_count) Uint64 *commit_count)
{ {
DBUG_ENTER("ndb_get_commitcount"); DBUG_ENTER("ndb_get_commitcount");
if (ndb_cache_check_time > 0) if (ndb_cache_check_time > 0)
{ {
// Use cached commit_count from share /* Use cached commit_count from share */
char name[FN_REFLEN]; char name[FN_REFLEN];
NDB_SHARE* share; NDB_SHARE *share;
(void)strxnmov(name, FN_REFLEN, (void)strxnmov(name, FN_REFLEN,
"./",dbname,"/",tabname,NullS); "./",dbname,"/",tabname,NullS);
DBUG_PRINT("info", ("name: %s", name)); DBUG_PRINT("info", ("name: %s", name));
...@@ -4861,7 +4861,7 @@ uint ndb_get_commitcount(THD* thd, char* dbname, char* tabname, ...@@ -4861,7 +4861,7 @@ uint ndb_get_commitcount(THD* thd, char* dbname, char* tabname,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
// Get commit_count from NDB /* Get commit_count from NDB */
Ndb *ndb; Ndb *ndb;
if (!(ndb= check_ndb_in_thd(thd))) if (!(ndb= check_ndb_in_thd(thd)))
DBUG_RETURN(1); DBUG_RETURN(1);
...@@ -4906,16 +4906,16 @@ uint ndb_get_commitcount(THD* thd, char* dbname, char* tabname, ...@@ -4906,16 +4906,16 @@ uint ndb_get_commitcount(THD* thd, char* dbname, char* tabname,
*/ */
static my_bool static my_bool
ndbcluster_cache_retrieval_allowed(THD* thd, ndbcluster_cache_retrieval_allowed(THD *thd,
char* full_name, uint full_name_len, char *full_name, uint full_name_len,
ulonglong *engine_data) ulonglong *engine_data)
{ {
DBUG_ENTER("ndbcluster_cache_retrieval_allowed"); DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
Uint64 commit_count; Uint64 commit_count;
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
char* dbname= full_name; char *dbname= full_name;
char* tabname= dbname+strlen(dbname)+1; char *tabname= dbname+strlen(dbname)+1;
DBUG_PRINT("enter",("dbname=%s, tabname=%s, autocommit=%d", DBUG_PRINT("enter",("dbname=%s, tabname=%s, autocommit=%d",
dbname, tabname, is_autocommit)); dbname, tabname, is_autocommit));
...@@ -4925,14 +4925,14 @@ ndbcluster_cache_retrieval_allowed(THD* thd, ...@@ -4925,14 +4925,14 @@ ndbcluster_cache_retrieval_allowed(THD* thd,
if (ndb_get_commitcount(thd, dbname, tabname, &commit_count)) if (ndb_get_commitcount(thd, dbname, tabname, &commit_count))
{ {
*engine_data+= 1; // invalidate *engine_data+= 1; /* invalidate */
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
DBUG_PRINT("info", ("*engine_data=%llu, commit_count=%llu", DBUG_PRINT("info", ("*engine_data=%llu, commit_count=%llu",
*engine_data, commit_count)); *engine_data, commit_count));
if (*engine_data != commit_count) if (*engine_data != commit_count)
{ {
*engine_data= commit_count; // invalidate *engine_data= commit_count; /* invalidate */
DBUG_PRINT("exit",("Do not use cache, commit_count has changed")); DBUG_PRINT("exit",("Do not use cache, commit_count has changed"));
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
...@@ -4965,8 +4965,8 @@ ndbcluster_cache_retrieval_allowed(THD* thd, ...@@ -4965,8 +4965,8 @@ ndbcluster_cache_retrieval_allowed(THD* thd,
*/ */
my_bool my_bool
ha_ndbcluster::register_query_cache_table(THD* thd, ha_ndbcluster::register_query_cache_table(THD *thd,
char* full_name, uint full_name_len, char *full_name, uint full_name_len,
qc_engine_callback *engine_callback, qc_engine_callback *engine_callback,
ulonglong *engine_data) ulonglong *engine_data)
{ {
...@@ -4978,7 +4978,6 @@ ha_ndbcluster::register_query_cache_table(THD* thd, ...@@ -4978,7 +4978,6 @@ ha_ndbcluster::register_query_cache_table(THD* thd,
if (!is_autocommit) if (!is_autocommit)
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
Uint64 commit_count; Uint64 commit_count;
if (ndb_get_commitcount(thd, m_dbname, m_tabname, &commit_count)) if (ndb_get_commitcount(thd, m_dbname, m_tabname, &commit_count))
{ {
...@@ -4992,6 +4991,7 @@ ha_ndbcluster::register_query_cache_table(THD* thd, ...@@ -4992,6 +4991,7 @@ ha_ndbcluster::register_query_cache_table(THD* thd,
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
/* /*
Handling the shared NDB_SHARE structure that is needed to Handling the shared NDB_SHARE structure that is needed to
provide table locking. provide table locking.
...@@ -5648,21 +5648,21 @@ ha_ndbcluster::update_table_comment( ...@@ -5648,21 +5648,21 @@ ha_ndbcluster::update_table_comment(
extern "C" pthread_handler_decl(ndb_util_thread_func, extern "C" pthread_handler_decl(ndb_util_thread_func,
arg __attribute__((unused))) arg __attribute__((unused)))
{ {
THD *thd; // needs to be first for thread_stack THD *thd; /* needs to be first for thread_stack */
int error = 0; int error= 0;
struct timespec abstime; struct timespec abstime;
my_thread_init(); my_thread_init();
DBUG_ENTER("ndb_util_thread"); DBUG_ENTER("ndb_util_thread");
DBUG_PRINT("enter", ("ndb_cache_check_time: %d", ndb_cache_check_time)); DBUG_PRINT("enter", ("ndb_cache_check_time: %d", ndb_cache_check_time));
thd= new THD; // note that contructor of THD uses DBUG_ ! thd= new THD; /* note that contructor of THD uses DBUG_ */
THD_CHECK_SENTRY(thd); THD_CHECK_SENTRY(thd);
pthread_detach_this_thread(); pthread_detach_this_thread();
ndb_util_thread = pthread_self(); ndb_util_thread= pthread_self();
thd->thread_stack = (char*)&thd; // remember where our stack is thd->thread_stack= (char*)&thd; /* remember where our stack is */
if (thd->store_globals()) if (thd->store_globals())
{ {
thd->cleanup(); thd->cleanup();
...@@ -5685,7 +5685,7 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, ...@@ -5685,7 +5685,7 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
ndb_cache_check_time)); ndb_cache_check_time));
if (abort_loop) if (abort_loop)
break; // Shutting down server break; /* Shutting down server */
if (ndb_cache_check_time == 0) if (ndb_cache_check_time == 0)
{ {
...@@ -5693,32 +5693,31 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, ...@@ -5693,32 +5693,31 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
continue; continue;
} }
// Set new time to wake up /* Set new time to wake up */
set_timespec(abstime, ndb_cache_check_time); set_timespec(abstime, ndb_cache_check_time);
// Lock mutex and fill list with pointers to all open tables /* Lock mutex and fill list with pointers to all open tables */
NDB_SHARE *share; NDB_SHARE *share;
pthread_mutex_lock(&ndbcluster_mutex); pthread_mutex_lock(&ndbcluster_mutex);
for (uint i= 0; i < ndbcluster_open_tables.records; i++) for (uint i= 0; i < ndbcluster_open_tables.records; i++)
{ {
share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i); share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i);
share->use_count++; // Make sure the table can't be closed share->use_count++; /* Make sure the table can't be closed */
DBUG_PRINT("ndb_util_thread", DBUG_PRINT("ndb_util_thread",
("Found open table[%d]: %s, use_count: %d", ("Found open table[%d]: %s, use_count: %d",
i, share->table_name, share->use_count)); i, share->table_name, share->use_count));
// Store pointer to table /* Store pointer to table */
util_open_tables.push_back(share); util_open_tables.push_back(share);
} }
pthread_mutex_unlock(&ndbcluster_mutex); pthread_mutex_unlock(&ndbcluster_mutex);
/* Iterate through the open files list */
// Iterate through the open files list
List_iterator_fast<NDB_SHARE> it(util_open_tables); List_iterator_fast<NDB_SHARE> it(util_open_tables);
while (share=it++) while (share= it++)
{ {
// Split tab- and dbname /* Split tab- and dbname */
char buf[FN_REFLEN]; char buf[FN_REFLEN];
char *tabname, *db; char *tabname, *db;
uint length= dirname_length(share->table_name); uint length= dirname_length(share->table_name);
...@@ -5730,10 +5729,11 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, ...@@ -5730,10 +5729,11 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
("Fetching commit count for: %s, db: %s, tab: %s", ("Fetching commit count for: %s, db: %s, tab: %s",
share->table_name, db, tabname)); share->table_name, db, tabname));
// Contact NDB to get commit count for table /* Contact NDB to get commit count for table */
g_ndb->setDatabaseName(db); g_ndb->setDatabaseName(db);
struct Ndb_statistics stat;; struct Ndb_statistics stat;;
if(ndb_get_table_statistics(g_ndb, tabname, &stat) == 0){ if(ndb_get_table_statistics(g_ndb, tabname, &stat) == 0)
{
DBUG_PRINT("ndb_util_thread", DBUG_PRINT("ndb_util_thread",
("Table: %s, rows: %llu, commit_count: %llu", ("Table: %s, rows: %llu, commit_count: %llu",
share->table_name, stat.row_count, stat.commit_count)); share->table_name, stat.row_count, stat.commit_count));
...@@ -5744,13 +5744,13 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, ...@@ -5744,13 +5744,13 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
DBUG_PRINT("ndb_util_thread", DBUG_PRINT("ndb_util_thread",
("Error: Could not get commit count for table %s", ("Error: Could not get commit count for table %s",
share->table_name)); share->table_name));
share->commit_count++; // Invalidate share->commit_count++; /* Invalidate */
} }
// Decrease the use count and possibly free share /* Decrease the use count and possibly free share */
free_share(share); free_share(share);
} }
// Clear the list of open tables /* Clear the list of open tables */
util_open_tables.empty(); util_open_tables.empty();
} }
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
TABLE *unused_tables; /* Used by mysql_test */ TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */ HASH open_cache; /* Used by mysql_test */
HASH assign_cache;
static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
const char *name, const char *alias, const char *name, const char *alias,
......
...@@ -4817,7 +4817,7 @@ in_sum_expr: ...@@ -4817,7 +4817,7 @@ in_sum_expr:
cast_type: cast_type:
BINARY opt_len { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } BINARY opt_len { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
| CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; Lex->dec= 0; } | CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; Lex->dec= 0; }
| NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; } | NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
| SIGNED_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } | SIGNED_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| SIGNED_SYM INT_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } | SIGNED_SYM INT_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| UNSIGNED { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } | UNSIGNED { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment