summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-02 17:05:08 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-02 17:05:08 +0300
commit0e5f0023b3405449c8e3371cb67989f1c1fbb3f7 (patch)
treeccdf6d71295fb66bed1a352fc14d1ca854a0d6bd /sql
parent499ebe5459e655ede75f0d9c30608dd704e637a9 (diff)
parent78aa48a809319ffdc0367f02908a2fcf92f19fbb (diff)
downloadmariadb-git-0e5f0023b3405449c8e3371cb67989f1c1fbb3f7.tar.gz
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
client/mysqltest.c: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/gen_lex_hash.cc9
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/repl_failsafe.cc3
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/slave.h2
-rw-r--r--sql/sql_parse.cc14
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_repl.h2
8 files changed, 12 insertions, 30 deletions
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index ba1d27f2bf6..a4f0791d105 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -356,7 +356,7 @@ void print_arrays()
static void usage(int version)
{
- printf("%s Ver 3.4 Distrib %s, for %s (%s)\n",
+ printf("%s Ver 3.5 Distrib %s, for %s (%s)\n",
my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version)
return;
@@ -394,11 +394,8 @@ static int get_options(int argc, char **argv)
int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- {
- printf("%s: handle_options() failed with error %d\n", my_progname,
- ho_error);
- exit(1);
- }
+ exit(ho_error);
+
if (argc >= 1)
{
usage(0);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1f70829239c..9c0d6bffe6c 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3053,7 +3053,6 @@ static struct my_option my_long_options[] =
*/
{"memlock", OPT_MEMLOCK, "Lock mysqld in memory", (gptr*) &locked_in_memory,
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef DBUG_OFF
{"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
"Undocumented: Meant for debugging and testing of replication",
(gptr*) &disconnect_slave_event_count,
@@ -3070,7 +3069,6 @@ static struct my_option my_long_options[] =
(gptr*) &opt_sporadic_binlog_dump_fail,
(gptr*) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
-#endif
{"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT,
"Simulate memory shortage when compiled with the --with-debug=full option",
0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -4422,11 +4420,7 @@ static void get_options(int argc,char **argv)
#endif
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- {
- printf("%s: handle_options() failed with error %d\n", my_progname,
- ho_error);
- exit(1);
- }
+ exit(ho_error);
fix_paths();
default_table_type_name=ha_table_typelib.type_names[default_table_type-1];
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 257418d1682..fab1491fc2b 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -608,6 +608,9 @@ int show_slave_hosts(THD* thd)
int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
{
+ if (!mi->host || !*mi->host) /* empty host */
+ return 1;
+
if (!mc_mysql_connect(mysql, mi->host, mi->user, mi->password, 0,
mi->port, 0, 0))
{
diff --git a/sql/slave.cc b/sql/slave.cc
index 19e093a75d2..93e711f2e14 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -48,12 +48,10 @@ ulong relay_log_space_limit = 0; /* TODO: fix variables to access ulonglong
// can re-use them on slave start
// TODO: move the vars below under MASTER_INFO
-#ifndef DBUG_OFF
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
static int events_till_disconnect = -1;
int events_till_abort = -1;
static int stuck_count = 0;
-#endif
typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE;
diff --git a/sql/slave.h b/sql/slave.h
index 34df17f2851..16735891815 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -415,9 +415,7 @@ extern bool do_table_inited, ignore_table_inited,
wild_do_table_inited, wild_ignore_table_inited;
extern bool table_rules_on;
-#ifndef DBUG_OFF
extern int disconnect_slave_event_count, abort_slave_event_count ;
-#endif
// the master variables are defaults read from my.cnf or command line
extern uint master_port, master_connect_retry, report_port;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 123a95070b9..3f2d4808cbe 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -160,7 +160,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
uc->connections = 1;
uc->questions=uc->updates=uc->conn_per_hour=0;
uc->user_resources=*mqh;
- if (mqh->connections > max_user_connections)
+ if (max_user_connections && mqh->connections > max_user_connections)
uc->user_resources.connections = max_user_connections;
uc->intime=thd->thr_create_time;
if (hash_insert(&hash_user_connections, (byte*) uc))
@@ -298,7 +298,7 @@ static int check_for_max_user_connections(USER_CONN *uc)
goto end;
}
uc->connections++;
-if (uc->user_resources.connections && uc->conn_per_hour++ >= uc->user_resources.connections)
+ if (uc->user_resources.connections && uc->conn_per_hour++ >= uc->user_resources.connections)
{
net_printf(&current_thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_connections",
(long) uc->user_resources.connections);
@@ -317,12 +317,7 @@ static void decrease_user_connections(USER_CONN *uc)
*/
DBUG_ENTER("decrease_user_connections");
- if (mqh_used)
- {
- if (uc->conn_per_hour)
- uc->conn_per_hour--;
- }
- else if (!--uc->connections)
+ if (!mqh_used && uc->connections && !--uc->connections)
{
/* Last connection for user; Delete it */
(void) pthread_mutex_lock(&LOCK_user_conn);
@@ -1797,6 +1792,7 @@ mysql_execute_command(void)
tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
if ((res=open_and_lock_tables(thd,tables)))
break;
+ thd->select_limit=HA_POS_ERROR;
if (!setup_fields(thd,tables,select_lex->item_list,1,0,0) &&
!setup_fields(thd,tables,lex->value_list,0,0,0) && ! thd->fatal_error &&
(result=new multi_update(thd,tables,select_lex->item_list,lex->duplicates,
@@ -2746,7 +2742,7 @@ void mysql_init_multi_delete(LEX *lex)
{
lex->sql_command = SQLCOM_DELETE_MULTI;
mysql_init_select(lex);
- lex->select->select_limit=HA_POS_ERROR;
+ lex->select->select_limit=lex->thd->select_limit=HA_POS_ERROR;
lex->auxilliary_table_list=lex->select_lex.table_list;
lex->select->table_list.elements=0;
lex->select->table_list.first=0;
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 398ff443ad4..b6c7c98a4cf 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -27,11 +27,9 @@
extern const char* any_db;
-#ifndef DBUG_OFF
int max_binlog_dump_events = 0; // unlimited
bool opt_sporadic_binlog_dump_fail = 0;
static int binlog_dump_count = 0;
-#endif
int check_binlog_magic(IO_CACHE* log, const char** errmsg)
{
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index 360fd50a1e3..b15c72a0bde 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -21,10 +21,8 @@ extern uint32 server_id;
extern bool server_id_supplied;
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
-#ifndef DBUG_OFF
extern int max_binlog_dump_events;
extern bool opt_sporadic_binlog_dump_fail;
-#endif
#define KICK_SLAVE(thd) thd->awake(0 /* do not prepare to die*/);