Commit e539f5bd authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/dlenev/src/mysql-4.1-bg6765


sql/set_var.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
parents af07ef79 3e221a83
...@@ -1825,8 +1825,6 @@ static void dumpTable(uint numFields, char *table) ...@@ -1825,8 +1825,6 @@ static void dumpTable(uint numFields, char *table)
err: err:
if (query != query_buf) if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR)); my_free(query, MYF(MY_ALLOW_ZERO_PTR));
if (order_by)
my_free(order_by, MYF(0));
safe_exit(error); safe_exit(error);
return; return;
} /* dumpTable */ } /* dumpTable */
...@@ -1978,6 +1976,8 @@ static int dump_all_tables_in_db(char *database) ...@@ -1978,6 +1976,8 @@ static int dump_all_tables_in_db(char *database)
numrows = getTableStructure(table, database); numrows = getTableStructure(table, database);
if (!dFlag && numrows > 0) if (!dFlag && numrows > 0)
dumpTable(numrows,table); dumpTable(numrows,table);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
} }
if (opt_xml) if (opt_xml)
{ {
...@@ -2027,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables) ...@@ -2027,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
numrows = getTableStructure(*table_names, db); numrows = getTableStructure(*table_names, db);
if (!dFlag && numrows > 0) if (!dFlag && numrows > 0)
dumpTable(numrows, *table_names); dumpTable(numrows, *table_names);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
} }
if (opt_xml) if (opt_xml)
{ {
......
...@@ -9,6 +9,7 @@ use test; ...@@ -9,6 +9,7 @@ use test;
# create system tables as in mysql-3.20 # create system tables as in mysql-3.20
--disable_warnings
CREATE TABLE db ( CREATE TABLE db (
Host char(60) binary DEFAULT '' NOT NULL, Host char(60) binary DEFAULT '' NOT NULL,
Db char(32) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL,
...@@ -23,10 +24,12 @@ CREATE TABLE db ( ...@@ -23,10 +24,12 @@ CREATE TABLE db (
KEY User (User) KEY User (User)
) )
type=ISAM; type=ISAM;
--enable-warnings
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
--disable_warnings
CREATE TABLE host ( CREATE TABLE host (
Host char(60) binary DEFAULT '' NOT NULL, Host char(60) binary DEFAULT '' NOT NULL,
Db char(32) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL,
...@@ -39,7 +42,9 @@ CREATE TABLE host ( ...@@ -39,7 +42,9 @@ CREATE TABLE host (
PRIMARY KEY Host (Host,Db) PRIMARY KEY Host (Host,Db)
) )
type=ISAM; type=ISAM;
--enable-warnings
--disable_warnings
CREATE TABLE user ( CREATE TABLE user (
Host char(60) binary DEFAULT '' NOT NULL, Host char(60) binary DEFAULT '' NOT NULL,
User char(16) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL,
...@@ -56,6 +61,7 @@ CREATE TABLE user ( ...@@ -56,6 +61,7 @@ CREATE TABLE user (
PRIMARY KEY Host (Host,User) PRIMARY KEY Host (Host,User)
) )
type=ISAM; type=ISAM;
--enable-warnings
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
......
...@@ -14,6 +14,7 @@ port="" ...@@ -14,6 +14,7 @@ port=""
socket="" socket=""
database="mysql" database="mysql"
bindir="" bindir=""
print_defaults_bindir="."
file=mysql_fix_privilege_tables.sql file=mysql_fix_privilege_tables.sql
...@@ -57,7 +58,9 @@ parse_arguments() { ...@@ -57,7 +58,9 @@ parse_arguments() {
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
--bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;; --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"`
print_defaults_bindir=$bindir
;;
*) *)
if test -n "$pick_args" if test -n "$pick_args"
then then
...@@ -73,7 +76,8 @@ parse_arguments() { ...@@ -73,7 +76,8 @@ parse_arguments() {
# Get first arguments from the my.cfg file, groups [mysqld] and # Get first arguments from the my.cfg file, groups [mysqld] and
# [mysql_install_db], and then merge with the command line arguments # [mysql_install_db], and then merge with the command line arguments
for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra print_defaults=my_print_defaults
for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra
do do
if test -x $dir/my_print_defaults if test -x $dir/my_print_defaults
then then
......
...@@ -358,22 +358,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", ...@@ -358,22 +358,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment); &srv_auto_extend_increment);
#endif #endif
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
// ndb thread specific variable settings /* ndb thread specific variable settings */
sys_var_thd_ulong sys_var_thd_ulong
sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
&SV::ndb_autoincrement_prefetch_sz); &SV::ndb_autoincrement_prefetch_sz);
sys_var_thd_bool sys_var_thd_bool
sys_ndb_force_send("ndb_force_send", sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
&SV::ndb_force_send);
sys_var_thd_bool sys_var_thd_bool
sys_ndb_use_exact_count("ndb_use_exact_count", sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
&SV::ndb_use_exact_count);
sys_var_thd_bool sys_var_thd_bool
sys_ndb_use_transactions("ndb_use_transactions", sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
&SV::ndb_use_transactions);
// ndb server global variable settings
// none
#endif #endif
/* Time/date/datetime formats */ /* Time/date/datetime formats */
......
...@@ -389,7 +389,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, ...@@ -389,7 +389,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not create database if another thread is holding read lock /* do not create database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1)) if (wait_if_global_read_lock(thd, 0, 1))
{ {
error= -1; error= -1;
...@@ -513,7 +513,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) ...@@ -513,7 +513,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not alter database if another thread is holding read lock /* do not alter database if another thread is holding read lock */
if ((error=wait_if_global_read_lock(thd,0,1))) if ((error=wait_if_global_read_lock(thd,0,1)))
goto exit2; goto exit2;
...@@ -541,9 +541,11 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) ...@@ -541,9 +541,11 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
/* suppress_use */ TRUE); /* suppress_use */ TRUE);
// Write should use the database being created as the "current /*
// database" and not the threads current database, which is the Write should use the database being created as the "current
// default. database" and not the threads current database, which is the
default.
*/
qinfo.db = db; qinfo.db = db;
qinfo.db_len = strlen(db); qinfo.db_len = strlen(db);
...@@ -576,7 +578,6 @@ exit2: ...@@ -576,7 +578,6 @@ exit2:
-1 Error generated -1 Error generated
*/ */
int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{ {
long deleted=0; long deleted=0;
...@@ -588,7 +589,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -588,7 +589,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not drop database if another thread is holding read lock /* do not drop database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1)) if (wait_if_global_read_lock(thd, 0, 1))
{ {
error= -1; error= -1;
...@@ -656,10 +657,11 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -656,10 +657,11 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{ {
Query_log_event qinfo(thd, query, query_length, 0, Query_log_event qinfo(thd, query, query_length, 0,
/* suppress_use */ TRUE); /* suppress_use */ TRUE);
/*
// Write should use the database being created as the "current Write should use the database being created as the "current
// database" and not the threads current database, which is the database" and not the threads current database, which is the
// default. default.
*/
qinfo.db = db; qinfo.db = db;
qinfo.db_len = strlen(db); qinfo.db_len = strlen(db);
...@@ -773,7 +775,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, ...@@ -773,7 +775,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
found_other_files++; found_other_files++;
continue; continue;
} }
// just for safety we use files_charset_info /* just for safety we use files_charset_info */
if (db && !my_strcasecmp(files_charset_info, if (db && !my_strcasecmp(files_charset_info,
extension, reg_ext)) extension, reg_ext))
{ {
...@@ -908,7 +910,7 @@ bool mysql_change_db(THD *thd, const char *name) ...@@ -908,7 +910,7 @@ bool mysql_change_db(THD *thd, const char *name)
if (!dbname || !(db_length= strlen(dbname))) if (!dbname || !(db_length= strlen(dbname)))
{ {
x_free(dbname); /* purecov: inspected */ x_free(dbname); /* purecov: inspected */
send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */ send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */
} }
if (check_db_name(dbname)) if (check_db_name(dbname))
......
...@@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) ...@@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return 1; return 1;
} }
bzero(initid->ptr,sizeof(longlong)); bzero(initid->ptr,sizeof(longlong));
// Fool MySQL to think that this function is a constant /*
// This will ensure that MySQL only evalutes the function Fool MySQL to think that this function is a constant
// when the rows are sent to the client and not before any ORDER BY This will ensure that MySQL only evalutes the function
// clauses when the rows are sent to the client and not before any ORDER BY
clauses
*/
initid->const_item=1; initid->const_item=1;
return 0; return 0;
} }
...@@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null, ...@@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
ulonglong val=0; ulonglong val=0;
if (args->arg_count) if (args->arg_count)
val= *((longlong*) args->args[0]); val= *((longlong*) args->args[0]);
return ++ *((longlong*) initid->ptr) + val; return ++*((longlong*) initid->ptr) + val;
} }
/**************************************************************************** /****************************************************************************
** Some functions that handles IP and hostname conversions ** Some functions that handles IP and hostname conversions
** The orignal function was from Zeev Suraski. ** The orignal function was from Zeev Suraski.
......
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