summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-12 03:28:02 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-12 03:28:02 +0300
commitb2e946136d21ec3102b3204ef1e2a1a10b404ff3 (patch)
tree34d4d5eb2aef4b99d0518f461da41a331af8574e /sql
parent49e4fea6c9f64f692b941589fd86158bf3e76a10 (diff)
downloadmariadb-git-b2e946136d21ec3102b3204ef1e2a1a10b404ff3.tar.gz
Fixed problem with BIGINT and shutdown on AIX
Moved IF(test,column,NULL) code to 4.0 Changed mysys_priv.h to include my_pthread.h or my_no_pthread.h. Removed some CR's in os2 files. Docs/manual.texi: Changelog include/global.h: Fix for BIGINT problem on AIX include/my_no_pthread.h: Fixed typo libmysql/Makefile.shared: Fix for BIGINT problem on AIX mysql-test/mysql-test-run.sh: Fix to find xterm on AIX 4.3 mysql-test/r/bigint.result: Fix for BIGINT problem on AIX mysql-test/r/func_if.result: Change results for IF() after reverting change. mysql-test/t/bigint.test: Fix for BIGINT problem on AIX mysys/Makefile.am: Fix for BIGINT problem on AIX mysys/my_gethostbyname.c: Cleanup mysys/my_init.c: Cleanup mysys/my_net.c: Cleanup mysys/my_os2cond.c: Space & CRLF cleanup mysys/my_os2dirsrch.c: Space & CRLF cleanup mysys/my_os2dirsrch.h: Space & CRLF cleanup mysys/my_os2dlfcn.c: Space & CRLF cleanup mysys/my_os2file64.c: Space & CRLF cleanup mysys/my_os2mutex.c: Space & CRLF cleanup mysys/my_os2thread.c: Space & CRLF cleanup mysys/my_os2tls.c: Space & CRLF cleanup mysys/mysys_priv.h: cleanup mysys/thr_rwlock.c: cleanup sql/ha_innobase.cc: Removed usage of sprintf() Fixed missing end \0 which caused control characters to appear in SHOW INNODB STATUS sql/item_cmpfunc.cc: Reverted change for IF() sql/mysqld.cc: Fix for shutdown on AIX
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc42
-rw-r--r--sql/item_cmpfunc.cc7
-rw-r--r--sql/mysqld.cc26
3 files changed, 20 insertions, 55 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index 5e6d4b5f50c..2bea014519c 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -267,43 +267,6 @@ innobase_mysql_print_thd(
thd = (THD*) input_thd;
- buf += sprintf(buf, "MySQL thread id %lu, query id %lu",
- thd->thread_id, thd->query_id);
- if (thd->host) {
- buf += sprintf(buf, " %.30s", thd->host);
- }
-
- if (thd->ip) {
- buf += sprintf(buf, " %.20s", thd->ip);
- }
-
- if (thd->user) {
- buf += sprintf(buf, " %.20s", thd->user);
- }
-
- if (thd->proc_info) {
- buf += sprintf(buf, " %.50s", thd->proc_info);
- }
-
- if (thd->query) {
- buf += sprintf(buf, "\n%.150s", thd->query);
- }
-
- buf += sprintf(buf, "\n");
-
-#ifdef notdefined
- /* August 8, 2002
- Revert these changes because they make control characters sometimes
- appear in the output and scramble it:
- the reason is that the last character of the ouptput will be
- '\n', not the null character '\0'. We do not know where the output
- ends in buf!
-
- On platforms (what are those?) where sprintf does not work
- we should define sprintf as 'my_emulated_sprintf'; InnoDB code
- contains lots of sprintfs, it does not help to remove them from
- just a single file. */
-
/* We can't use value of sprintf() as this is not portable */
buf+= my_sprintf(buf,
(buf, "MySQL thread id %lu",
@@ -337,9 +300,8 @@ innobase_mysql_print_thd(
*buf++='\n';
buf=strnmov(buf, thd->query, 150);
}
- *buf='\n';
- /* Here we should add '\0' to the end of output to mark its end */
-#endif
+ buf[0]='\n';
+ buf[1]=0;
}
}
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 86e2ef29564..f17c8af3519 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -494,12 +494,7 @@ Item_func_if::fix_length_and_dec()
decimals=max(args[1]->decimals,args[2]->decimals);
enum Item_result arg1_type=args[1]->result_type();
enum Item_result arg2_type=args[2]->result_type();
- bool null1=args[1]->null_value;
- bool null2=args[2]->null_value;
- if (null1 && !null2)
- arg1_type=arg2_type;
- else if (!null1 && null2)
- arg2_type=arg1_type;
+
binary=1;
if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d73ec9fc0d6..150ad8ea379 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -43,6 +43,8 @@
#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ)
#define HAVE_CLOSE_SERVER_SOCK 1
void close_server_sock();
+#else
+#define close_server_sock()
#endif
extern "C" { // Because of SCO 3.2V4.2
@@ -465,9 +467,7 @@ static void close_connections(void)
if (error != 0 && !count++)
sql_print_error("Got error %d from pthread_cond_timedwait",error);
#endif
-#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ)
close_server_sock();
-#endif
}
(void) pthread_mutex_unlock(&LOCK_thread_count);
#endif /* __WIN__ */
@@ -598,18 +598,26 @@ if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
void close_server_sock()
{
DBUG_ENTER("close_server_sock");
+
if (ip_sock != INVALID_SOCKET)
{
- DBUG_PRINT("info",("closing TCP/IP socket"));
+ DBUG_PRINT("info",("calling shutdown on TCP/IP socket"));
VOID(shutdown(ip_sock,2));
+#ifdef NOT_USED
+ /*
+ The following code is disabled as it cases MySQL to hang on
+ AIX 4.3 during shutdown
+ */
+ DBUG_PRINT("info",("calling closesocket on TCP/IP socket"));
VOID(closesocket(ip_sock));
+#endif
ip_sock=INVALID_SOCKET;
}
if (unix_sock != INVALID_SOCKET)
{
- DBUG_PRINT("info",("closing Unix socket"));
+ DBUG_PRINT("info",("calling shutdown on unix socket"));
VOID(shutdown(unix_sock,2));
- VOID(closesocket(unix_sock));
+ DBUG_PRINT("info",("calling closesocket on unix socket"));
VOID(unlink(mysql_unix_port));
unix_sock=INVALID_SOCKET;
}
@@ -621,7 +629,8 @@ void kill_mysql(void)
{
DBUG_ENTER("kill_mysql");
#ifdef SIGNALS_DONT_BREAK_READ
- close_server_sock(); /* force accept to wake up */
+ abort_loop=1; // Break connection loops
+ close_server_sock(); // Force accept to wake up
#endif
#if defined(__WIN__)
{
@@ -647,10 +656,9 @@ void kill_mysql(void)
DBUG_PRINT("quit",("After pthread_kill"));
shutdown_in_progress=1; // Safety if kill didn't work
#ifdef SIGNALS_DONT_BREAK_READ
- if (!abort_loop)
+ if (!kill_in_progress)
{
pthread_t tmp;
- abort_loop=1;
if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
(void*) 0))
sql_print_error("Error: Can't create thread to kill server");
@@ -1220,7 +1228,7 @@ static void sig_reload(int signo)
static void sig_kill(int signo)
{
- if (!abort_loop)
+ if (!kill_in_progress)
{
abort_loop=1; // mark abort for threads
kill_server((void*) signo);