Commit dd343eb8 authored by unknown's avatar unknown

Merge mskold@build.mysql.com:/home/bk/mysql-4.1

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1


ndb/src/common/transporter/TransporterRegistry.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
parents 53e85a27 7e45c729
This diff is collapsed.
...@@ -2841,6 +2841,22 @@ com_status(String *buffer __attribute__((unused)), ...@@ -2841,6 +2841,22 @@ com_status(String *buffer __attribute__((unused)),
usage(1); /* Print version */ usage(1); /* Print version */
if (connected) if (connected)
{ {
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
/*
Don't remove "limit 1",
it is protection againts SQL_SELECT_LIMIT=0
*/
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
(result=mysql_use_result(&mysql)))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
{
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
}
mysql_free_result(result);
}
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (mysql.net.vio && mysql.net.vio->ssl_arg && if (mysql.net.vio && mysql.net.vio->ssl_arg &&
SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg)) SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg))
...@@ -2874,7 +2890,11 @@ com_status(String *buffer __attribute__((unused)), ...@@ -2874,7 +2890,11 @@ com_status(String *buffer __attribute__((unused)),
if ((id= mysql_insert_id(&mysql))) if ((id= mysql_insert_id(&mysql)))
tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff)); tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff));
if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database") && /*
Don't remove "limit 1",
it is protection againts SQL_SELECT_LIMIT=0
*/
if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1") &&
(result=mysql_use_result(&mysql))) (result=mysql_use_result(&mysql)))
{ {
MYSQL_ROW cur=mysql_fetch_row(result); MYSQL_ROW cur=mysql_fetch_row(result);
...@@ -2887,6 +2907,12 @@ com_status(String *buffer __attribute__((unused)), ...@@ -2887,6 +2907,12 @@ com_status(String *buffer __attribute__((unused)),
} }
mysql_free_result(result); mysql_free_result(result);
} }
else
{
/* Probably pre-4.1 server */
tee_fprintf(stdout, "Client characterset:\t%s\n", charset_info->csname);
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->csname);
}
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket) if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
......
...@@ -67,6 +67,9 @@ __RCSID("$NetBSD: term.c,v 1.35 2002/03/18 16:00:59 christos Exp $"); ...@@ -67,6 +67,9 @@ __RCSID("$NetBSD: term.c,v 1.35 2002/03/18 16:00:59 christos Exp $");
#include "el.h" #include "el.h"
#if !defined(HAVE_TERMCAP_H) && defined(HAVE_TERM_H)
#include <term.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
...@@ -274,7 +274,7 @@ esac ...@@ -274,7 +274,7 @@ esac
# option, cache_name, variable, # option, cache_name, variable,
# code to execute if yes, code to exectute if fail # code to execute if yes, code to exectute if fail
AC_DEFUN(AC_SYS_COMPILER_FLAG, AC_DEFUN([AC_SYS_COMPILER_FLAG],
[ [
AC_MSG_CHECKING($1) AC_MSG_CHECKING($1)
OLD_CFLAGS="[$]CFLAGS" OLD_CFLAGS="[$]CFLAGS"
...@@ -297,7 +297,7 @@ AC_DEFUN(AC_SYS_COMPILER_FLAG, ...@@ -297,7 +297,7 @@ AC_DEFUN(AC_SYS_COMPILER_FLAG,
]) ])
# arch, option, cache_name, variable # arch, option, cache_name, variable
AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG, AC_DEFUN([AC_SYS_CPU_COMPILER_FLAG],
[ [
if test "`uname -m 2>/dev/null`" = "$1" ; then if test "`uname -m 2>/dev/null`" = "$1" ; then
AC_SYS_COMPILER_FLAG($2,$3,$4) AC_SYS_COMPILER_FLAG($2,$3,$4)
...@@ -305,7 +305,7 @@ AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG, ...@@ -305,7 +305,7 @@ AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG,
]) ])
# os, option, cache_name, variable # os, option, cache_name, variable
AC_DEFUN(AC_SYS_OS_COMPILER_FLAG, AC_DEFUN([AC_SYS_OS_COMPILER_FLAG],
[ [
if test "x$mysql_cv_sys_os" = "x$1" ; then if test "x$mysql_cv_sys_os" = "x$1" ; then
AC_SYS_COMPILER_FLAG($2,$3,$4) AC_SYS_COMPILER_FLAG($2,$3,$4)
......
...@@ -294,9 +294,11 @@ set @arg00='ABC'; ...@@ -294,9 +294,11 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
......
...@@ -26,3 +26,9 @@ FROM t1 GROUP BY new LIMIT 1; ...@@ -26,3 +26,9 @@ FROM t1 GROUP BY new LIMIT 1;
number alpha new number alpha new
1413006 idlfmv 1413006<------------------>idlfmv 1413006 idlfmv 1413006<------------------>idlfmv
drop table t1; drop table t1;
create table t1 (a char(4), b double, c date, d tinyint(4));
insert into t1 values ('AAAA', 105, '2003-03-01', 1);
select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
a b c d
AAAA 105 2003-03-01 1
drop table t1;
...@@ -395,7 +395,8 @@ set @arg00='ABC'; ...@@ -395,7 +395,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -407,7 +408,8 @@ a @arg00 a ...@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
......
...@@ -395,7 +395,8 @@ set @arg00='ABC'; ...@@ -395,7 +395,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -407,7 +408,8 @@ a @arg00 a ...@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
......
...@@ -396,7 +396,8 @@ set @arg00='ABC'; ...@@ -396,7 +396,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -408,7 +409,8 @@ a @arg00 a ...@@ -408,7 +409,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
......
...@@ -438,7 +438,8 @@ set @arg00='ABC'; ...@@ -438,7 +438,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -450,7 +451,8 @@ a @arg00 a ...@@ -450,7 +451,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
...@@ -1631,7 +1633,8 @@ set @arg00='ABC'; ...@@ -1631,7 +1633,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -1643,7 +1646,8 @@ a @arg00 a ...@@ -1643,7 +1646,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
......
...@@ -395,7 +395,8 @@ set @arg00='ABC'; ...@@ -395,7 +395,8 @@ set @arg00='ABC';
set @arg01='two'; set @arg01='two';
set @arg02='one'; set @arg02='one';
select first.a, @arg00, second.a FROM t1 first, t1 second select first.a, @arg00, second.a FROM t1 first, t1 second
where @arg01 = first.b or first.a = second.a or second.b = @arg02; where @arg01 = first.b or first.a = second.a or second.b = @arg02
order by second.a, first.a;
a @arg00 a a @arg00 a
1 ABC 1 1 ABC 1
2 ABC 1 2 ABC 1
...@@ -407,7 +408,8 @@ a @arg00 a ...@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4 2 ABC 4
4 ABC 4 4 ABC 4
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
where ? = first.b or first.a = second.a or second.b = ? '; where ? = first.b or first.a = second.a or second.b = ?
order by second.a, first.a';
execute stmt1 using @arg00, @arg01, @arg02; execute stmt1 using @arg00, @arg01, @arg02;
a ? a a ? a
1 ABC 1 1 ABC 1
......
...@@ -25,3 +25,12 @@ FROM t1 GROUP BY new LIMIT 1; ...@@ -25,3 +25,12 @@ FROM t1 GROUP BY new LIMIT 1;
SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new
FROM t1 GROUP BY new LIMIT 1; FROM t1 GROUP BY new LIMIT 1;
drop table t1; drop table t1;
#
# Bug #5540: a problem with double type
#
create table t1 (a char(4), b double, c date, d tinyint(4));
insert into t1 values ('AAAA', 105, '2003-03-01', 1);
select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
drop table t1;
...@@ -1174,7 +1174,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) ...@@ -1174,7 +1174,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
{ {
ndbout_c("Unable to setup transporter service port: %d!\n" ndbout_c("Unable to setup transporter service port: %d!\n"
"Please check if the port is already used,\n" "Please check if the port is already used,\n"
"(perhaps a mgmtsrvrserver is already running)", "(perhaps a mgmt server is already running)",
m_service_port); m_service_port);
delete t->m_service; delete t->m_service;
return false; return false;
...@@ -1199,7 +1199,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) ...@@ -1199,7 +1199,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
{ {
ndbout_c("Unable to setup transporter service port: %d!\n" ndbout_c("Unable to setup transporter service port: %d!\n"
"Please check if the port is already used,\n" "Please check if the port is already used,\n"
"(perhaps a mgmtsrvrserver is already running)", "(perhaps a mgmt server is already running)",
m_service_port); m_service_port);
delete m_transporter_service; delete m_transporter_service;
return false; return false;
......
...@@ -54,7 +54,7 @@ static const char* helpText = ...@@ -54,7 +54,7 @@ static const char* helpText =
#endif #endif
"START BACKUP Start backup\n" "START BACKUP Start backup\n"
"ABORT BACKUP <backup id> Abort backup\n" "ABORT BACKUP <backup id> Abort backup\n"
"SHUTDOWN Shutdown all processed in cluster and quit\n" "SHUTDOWN Shutdown all processes in cluster and quit\n"
"CLUSTERLOG ON Enable Cluster logging\n" "CLUSTERLOG ON Enable Cluster logging\n"
"CLUSTERLOG OFF Disable Cluster logging\n" "CLUSTERLOG OFF Disable Cluster logging\n"
"CLUSTERLOG FILTER <severity> Toggle severity filter on/off\n" "CLUSTERLOG FILTER <severity> Toggle severity filter on/off\n"
...@@ -78,8 +78,10 @@ static const char* helpTextShow = ...@@ -78,8 +78,10 @@ static const char* helpTextShow =
"---------------------------------------------------------------------------\n" "---------------------------------------------------------------------------\n"
"SHOW prints NDB Cluster information\n\n" "SHOW prints NDB Cluster information\n\n"
"SHOW Print information about cluster\n" "SHOW Print information about cluster\n"
#if 0
"SHOW CONFIG Print configuration (in initial config file format)\n" "SHOW CONFIG Print configuration (in initial config file format)\n"
"SHOW PARAMETERS Print information about configuration parameters\n\n" "SHOW PARAMETERS Print information about configuration parameters\n\n"
#endif
; ;
#ifdef HAVE_GLOBAL_REPLICATION #ifdef HAVE_GLOBAL_REPLICATION
......
...@@ -346,8 +346,10 @@ static bool ...@@ -346,8 +346,10 @@ static bool
readLocalConfig(){ readLocalConfig(){
// Read local config file // Read local config file
LocalConfig lc; LocalConfig lc;
if(!lc.init(glob.local_config_filename)) if(!lc.init(glob.local_config_filename)){
lc.printError();
return false; return false;
}
glob.localNodeId = lc._ownNodeId; glob.localNodeId = lc._ownNodeId;
return true; return true;
......
...@@ -579,6 +579,7 @@ NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb) ...@@ -579,6 +579,7 @@ NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb)
m_ndb(ndb) m_ndb(ndb)
{ {
m_globalHash = 0; m_globalHash = 0;
m_local_table_data_size= 0;
} }
NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb, NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb,
......
...@@ -289,7 +289,8 @@ String *Item_func_concat::val_str(String *str) ...@@ -289,7 +289,8 @@ String *Item_func_concat::val_str(String *str)
str->copy(*res); str->copy(*res);
str->append(*res2); str->append(*res2);
} }
res=str; res= str;
use_as_buff= &tmp_value;
} }
else if (res == &tmp_value) else if (res == &tmp_value)
{ {
......
...@@ -293,7 +293,7 @@ int purge_master_logs(THD* thd, const char* to_log) ...@@ -293,7 +293,7 @@ int purge_master_logs(THD* thd, const char* to_log)
char search_file_name[FN_REFLEN]; char search_file_name[FN_REFLEN];
if (!mysql_bin_log.is_open()) if (!mysql_bin_log.is_open())
{ {
send_ok(current_thd); send_ok(thd);
return 0; return 0;
} }
...@@ -306,8 +306,13 @@ int purge_master_logs(THD* thd, const char* to_log) ...@@ -306,8 +306,13 @@ int purge_master_logs(THD* thd, const char* to_log)
int purge_master_logs_before_date(THD* thd, time_t purge_time) int purge_master_logs_before_date(THD* thd, time_t purge_time)
{ {
int res = mysql_bin_log.purge_logs_before_date(purge_time); if (!mysql_bin_log.is_open())
return purge_error_message(thd ,res); {
send_ok(thd);
return 0;
}
return purge_error_message(thd,
mysql_bin_log.purge_logs_before_date(purge_time));
} }
/* /*
......
...@@ -10122,9 +10122,9 @@ static void test_bug4231() ...@@ -10122,9 +10122,9 @@ static void test_bug4231()
bzero(bind, sizeof(bind)); bzero(bind, sizeof(bind));
bzero(tm, sizeof(tm)); bzero(tm, sizeof(tm));
bind[0].buffer_type= MYSQL_TYPE_TIME; bind[0].buffer_type= MYSQL_TYPE_DATE;
bind[0].buffer= &tm[0]; bind[0].buffer= &tm[0];
bind[1].buffer_type= MYSQL_TYPE_TIME; bind[1].buffer_type= MYSQL_TYPE_DATE;
bind[1].buffer= &tm[1]; bind[1].buffer= &tm[1];
mysql_stmt_bind_param(stmt, bind); mysql_stmt_bind_param(stmt, bind);
...@@ -10152,7 +10152,7 @@ static void test_bug4231() ...@@ -10152,7 +10152,7 @@ static void test_bug4231()
/* Set one of the dates to zero */ /* Set one of the dates to zero */
tm[0].year= tm[0].month= tm[0].day= 0; tm[0].year= tm[0].month= tm[0].day= 0;
tm[1]= tm[1]; tm[1]= tm[0];
mysql_stmt_execute(stmt); mysql_stmt_execute(stmt);
rc= mysql_stmt_fetch(stmt); rc= mysql_stmt_fetch(stmt);
DBUG_ASSERT(rc == 0); DBUG_ASSERT(rc == 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