Commit 9cf83855 authored by mskold@mysql.com's avatar mskold@mysql.com

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

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1
parents 81d5944f d063c87d
# Local macros for automake & autoconf
AC_DEFUN(MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY,[
AC_DEFUN([MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY], [
AC_CACHE_CHECK([HIST_ENTRY is declared in readline/readline.h], mysql_cv_hist_entry_declared,
AC_TRY_COMPILE(
[
......@@ -21,7 +21,7 @@ AC_DEFUN(MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY,[
)
])
AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[
AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [
AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface,
AC_TRY_COMPILE(
[
......@@ -42,7 +42,7 @@ AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[
)
])
AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[
AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [
AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface,
AC_TRY_COMPILE(
[
......@@ -65,7 +65,7 @@ AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[
# A local version of AC_CHECK_SIZEOF that includes sys/types.h
dnl MYSQL_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
AC_DEFUN(MYSQL_CHECK_SIZEOF,
AC_DEFUN([MYSQL_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
......@@ -94,7 +94,7 @@ undefine([AC_CV_NAME])dnl
])
#---START: Used in for client configure
AC_DEFUN(MYSQL_TYPE_ACCEPT,
AC_DEFUN([MYSQL_TYPE_ACCEPT],
[ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
AC_LANG_SAVE
......@@ -135,7 +135,7 @@ CXXFLAGS="$ac_save_CXXFLAGS"
#---END:
dnl Find type of qsort
AC_DEFUN(MYSQL_TYPE_QSORT,
AC_DEFUN([MYSQL_TYPE_QSORT],
[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
[AC_TRY_COMPILE([#include <stdlib.h>
#ifdef __cplusplus
......@@ -153,7 +153,7 @@ then
fi
])
AC_DEFUN(MYSQL_TIMESPEC_TS,
AC_DEFUN([MYSQL_TIMESPEC_TS],
[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts,
[AC_TRY_COMPILE([#include <pthread.h>
#ifdef __cplusplus
......@@ -172,7 +172,7 @@ then
fi
])
AC_DEFUN(MYSQL_TZNAME,
AC_DEFUN([MYSQL_TZNAME],
[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
[AC_TRY_COMPILE([#include <time.h>
#ifdef __cplusplus
......@@ -299,7 +299,7 @@ esac
dnl ------------------------------------------------------------------------
#---START: Used in for client configure
AC_DEFUN(MYSQL_CHECK_ULONG,
AC_DEFUN([MYSQL_CHECK_ULONG],
[AC_MSG_CHECKING(for type ulong)
AC_CACHE_VAL(ac_cv_ulong,
[AC_TRY_RUN([#include <stdio.h>
......@@ -317,7 +317,7 @@ then
fi
])
AC_DEFUN(MYSQL_CHECK_UCHAR,
AC_DEFUN([MYSQL_CHECK_UCHAR],
[AC_MSG_CHECKING(for type uchar)
AC_CACHE_VAL(ac_cv_uchar,
[AC_TRY_RUN([#include <stdio.h>
......@@ -335,7 +335,7 @@ then
fi
])
AC_DEFUN(MYSQL_CHECK_UINT,
AC_DEFUN([MYSQL_CHECK_UINT],
[AC_MSG_CHECKING(for type uint)
AC_CACHE_VAL(ac_cv_uint,
[AC_TRY_RUN([#include <stdio.h>
......@@ -354,7 +354,7 @@ fi
])
AC_DEFUN(MYSQL_CHECK_IN_ADDR_T,
AC_DEFUN([MYSQL_CHECK_IN_ADDR_T],
[AC_MSG_CHECKING(for type in_addr_t)
AC_CACHE_VAL(ac_cv_in_addr_t,
[AC_TRY_RUN([#include <stdio.h>
......@@ -376,7 +376,7 @@ fi
])
AC_DEFUN(MYSQL_PTHREAD_YIELD,
AC_DEFUN([MYSQL_PTHREAD_YIELD],
[AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
[AC_TRY_LINK([#define _GNU_SOURCE
#include <pthread.h>
......@@ -415,7 +415,7 @@ fi
#---END:
AC_DEFUN(MYSQL_CHECK_FP_EXCEPT,
AC_DEFUN([MYSQL_CHECK_FP_EXCEPT],
[AC_MSG_CHECKING(for type fp_except)
AC_CACHE_VAL(ac_cv_fp_except,
[AC_TRY_RUN([#include <stdio.h>
......@@ -456,7 +456,7 @@ fi
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
AC_DEFUN([AM_PROG_CC_STDC],
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
......@@ -500,7 +500,7 @@ esac
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
sleep 1
echo timestamp > conftestfile
......@@ -519,7 +519,7 @@ AC_MSG_RESULT(yes)])
# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty.
AC_DEFUN(MYSQL_CHECK_LIB_TERMCAP,
AC_DEFUN([MYSQL_CHECK_LIB_TERMCAP],
[
AC_CACHE_VAL(mysql_cv_termcap_lib,
[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
......@@ -540,7 +540,7 @@ AC_MSG_RESULT($TERMCAP_LIB)
])
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
AC_DEFUN(MYSQL_SIGNAL_CHECK,
AC_DEFUN([MYSQL_SIGNAL_CHECK],
[AC_REQUIRE([AC_TYPE_SIGNAL])
AC_MSG_CHECKING(for type of signal functions)
AC_CACHE_VAL(mysql_cv_signal_vintage,
......@@ -580,7 +580,7 @@ AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable])
fi
])
AC_DEFUN(MYSQL_CHECK_GETPW_FUNCS,
AC_DEFUN([MYSQL_CHECK_GETPW_FUNCS],
[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
AC_CACHE_VAL(mysql_cv_can_redecl_getpw,
[AC_TRY_COMPILE([#include <sys/types.h>
......@@ -593,7 +593,7 @@ AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present])
fi
])
AC_DEFUN(MYSQL_HAVE_TIOCGWINSZ,
AC_DEFUN([MYSQL_HAVE_TIOCGWINSZ],
[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
[AC_TRY_COMPILE([#include <sys/types.h>
......@@ -606,7 +606,7 @@ AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
fi
])
AC_DEFUN(MYSQL_HAVE_FIONREAD,
AC_DEFUN([MYSQL_HAVE_FIONREAD],
[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,
[AC_TRY_COMPILE([#include <sys/types.h>
......@@ -618,7 +618,7 @@ AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD])
fi
])
AC_DEFUN(MYSQL_HAVE_TIOCSTAT,
AC_DEFUN([MYSQL_HAVE_TIOCSTAT],
[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
[AC_TRY_COMPILE([#include <sys/types.h>
......@@ -631,7 +631,7 @@ AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1],
fi
])
AC_DEFUN(MYSQL_STRUCT_DIRENT_D_INO,
AC_DEFUN([MYSQL_STRUCT_DIRENT_D_INO],
[AC_REQUIRE([AC_HEADER_DIRENT])
AC_MSG_CHECKING(if struct dirent has a d_ino member)
AC_CACHE_VAL(mysql_cv_dirent_has_dino,
......@@ -665,7 +665,7 @@ AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1],
fi
])
AC_DEFUN(MYSQL_STRUCT_DIRENT_D_NAMLEN,
AC_DEFUN([MYSQL_STRUCT_DIRENT_D_NAMLEN],
[AC_REQUIRE([AC_HEADER_DIRENT])
AC_MSG_CHECKING(if struct dirent has a d_namlen member)
AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen,
......@@ -700,7 +700,7 @@ fi
])
AC_DEFUN(MYSQL_TYPE_SIGHANDLER,
AC_DEFUN([MYSQL_TYPE_SIGHANDLER],
[AC_MSG_CHECKING([whether signal handlers are of type void])
AC_CACHE_VAL(mysql_cv_void_sighandler,
[AC_TRY_COMPILE([#include <sys/types.h>
......@@ -719,7 +719,7 @@ AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])
fi
])
AC_DEFUN(MYSQL_CXX_BOOL,
AC_DEFUN([MYSQL_CXX_BOOL],
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(if ${CXX} supports bool types)
......@@ -738,7 +738,7 @@ AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])
fi
])dnl
AC_DEFUN(MYSQL_STACK_DIRECTION,
AC_DEFUN([MYSQL_STACK_DIRECTION],
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
[AC_TRY_RUN([#include <stdlib.h>
int find_stack_direction ()
......@@ -761,7 +761,7 @@ AC_DEFUN(MYSQL_STACK_DIRECTION,
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])dnl
AC_DEFUN(MYSQL_FUNC_ALLOCA,
AC_DEFUN([MYSQL_FUNC_ALLOCA],
[
# Since we have heard that alloca fails on IRIX never define it on a
# SGI machine
......@@ -830,7 +830,7 @@ else
fi
])
AC_DEFUN(MYSQL_CHECK_LONGLONG_TO_FLOAT,
AC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT],
[
AC_MSG_CHECKING(if conversion of longlong to float works)
AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
......@@ -855,7 +855,7 @@ fi
AC_MSG_RESULT($ac_cv_conv_longlong_to_float)
])
AC_DEFUN(MYSQL_CHECK_CPU,
AC_DEFUN([MYSQL_CHECK_CPU],
[AC_CACHE_CHECK([if compiler supports optimizations for current cpu],
mysql_cv_cpu,[
......@@ -902,7 +902,7 @@ else
fi
]]))
AC_DEFUN(MYSQL_CHECK_VIO, [
AC_DEFUN([MYSQL_CHECK_VIO], [
AC_ARG_WITH([vio],
[ --with-vio Include the Virtual IO support],
[vio="$withval"],
......@@ -921,7 +921,7 @@ AC_DEFUN(MYSQL_CHECK_VIO, [
AC_SUBST([vio_libs])
])
AC_DEFUN(MYSQL_FIND_OPENSSL, [
AC_DEFUN([MYSQL_FIND_OPENSSL], [
incs="$1"
libs="$2"
case "$incs---$libs" in
......@@ -976,7 +976,7 @@ AC_DEFUN(MYSQL_FIND_OPENSSL, [
])
AC_DEFUN(MYSQL_CHECK_OPENSSL, [
AC_DEFUN([MYSQL_CHECK_OPENSSL], [
AC_MSG_CHECKING(for OpenSSL)
AC_ARG_WITH([openssl],
[ --with-openssl Include the OpenSSL support],
......@@ -1040,7 +1040,7 @@ AC_MSG_CHECKING(for OpenSSL)
])
AC_DEFUN(MYSQL_CHECK_MYSQLFS, [
AC_DEFUN([MYSQL_CHECK_MYSQLFS], [
AC_ARG_WITH([mysqlfs],
[
--with-mysqlfs Include the corba-based MySQL file system],
......@@ -1068,7 +1068,7 @@ dnl get substituted.
AC_SUBST([fs_dirs])
])
AC_DEFUN(MYSQL_CHECK_ORBIT, [
AC_DEFUN([MYSQL_CHECK_ORBIT], [
AC_MSG_CHECKING(for ORBit)
orbit_config_path=`which orbit-config`
if test -n "$orbit_config_path" -a $? = 0
......@@ -1678,7 +1678,7 @@ dnl Written by Paul Eggert <eggert@twinsun.com>.
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
AC_DEFUN([AC_SYS_LARGEFILE_FLAGS],
[AC_CACHE_CHECK([for $1 value to request large file support],
ac_cv_sys_largefile_$1,
[if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
......@@ -1717,7 +1717,7 @@ changequote([, ])dnl
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND],
[case $2 in
no) ;;
?*)
......@@ -1729,7 +1729,7 @@ AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
[AC_CACHE_CHECK([for $1], $2,
[$2=no
changequote(, )dnl
......@@ -1748,7 +1748,7 @@ changequote([, ])dnl
AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
fi])
AC_DEFUN(MYSQL_SYS_LARGEFILE,
AC_DEFUN([MYSQL_SYS_LARGEFILE],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_ENABLE(largefile,
[ --disable-largefile Omit support for large files])
......
......@@ -2841,6 +2841,22 @@ com_status(String *buffer __attribute__((unused)),
usage(1); /* Print version */
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
if (mysql.net.vio && mysql.net.vio->ssl_arg &&
SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg))
......@@ -2874,7 +2890,11 @@ com_status(String *buffer __attribute__((unused)),
if ((id= mysql_insert_id(&mysql)))
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)))
{
MYSQL_ROW cur=mysql_fetch_row(result);
......@@ -2887,6 +2907,12 @@ com_status(String *buffer __attribute__((unused)),
}
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
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 $");
#include "el.h"
#if !defined(HAVE_TERMCAP_H) && defined(HAVE_TERM_H)
#include <term.h>
#endif
#include <sys/types.h>
#include <sys/ioctl.h>
......
......@@ -274,7 +274,7 @@ esac
# option, cache_name, variable,
# 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)
OLD_CFLAGS="[$]CFLAGS"
......@@ -297,7 +297,7 @@ AC_DEFUN(AC_SYS_COMPILER_FLAG,
])
# 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
AC_SYS_COMPILER_FLAG($2,$3,$4)
......@@ -305,7 +305,7 @@ AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG,
])
# 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
AC_SYS_COMPILER_FLAG($2,$3,$4)
......
......@@ -294,9 +294,11 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
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;
......
......@@ -26,3 +26,9 @@ FROM t1 GROUP BY new LIMIT 1;
number alpha new
1413006 idlfmv 1413006<------------------>idlfmv
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';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......
......@@ -395,7 +395,8 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......
......@@ -396,7 +396,8 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -408,7 +409,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......
......@@ -438,7 +438,8 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -450,7 +451,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......@@ -1631,7 +1633,8 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -1643,7 +1646,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......
......@@ -395,7 +395,8 @@ set @arg00='ABC';
set @arg01='two';
set @arg02='one';
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
1 ABC 1
2 ABC 1
......@@ -407,7 +408,8 @@ a @arg00 a
2 ABC 4
4 ABC 4
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;
a ? a
1 ABC 1
......
......@@ -25,3 +25,12 @@ FROM t1 GROUP BY new LIMIT 1;
SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new
FROM t1 GROUP BY new LIMIT 1;
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)
{
ndbout_c("Unable to setup transporter service port: %d!\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);
delete t->m_service;
return false;
......@@ -1199,7 +1199,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
{
ndbout_c("Unable to setup transporter service port: %d!\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);
delete m_transporter_service;
return false;
......
......@@ -54,7 +54,7 @@ static const char* helpText =
#endif
"START BACKUP Start 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 OFF Disable Cluster logging\n"
"CLUSTERLOG FILTER <severity> Toggle severity filter on/off\n"
......@@ -78,8 +78,10 @@ static const char* helpTextShow =
"---------------------------------------------------------------------------\n"
"SHOW prints NDB Cluster information\n\n"
"SHOW Print information about cluster\n"
#if 0
"SHOW CONFIG Print configuration (in initial config file format)\n"
"SHOW PARAMETERS Print information about configuration parameters\n\n"
#endif
;
#ifdef HAVE_GLOBAL_REPLICATION
......
......@@ -346,8 +346,10 @@ static bool
readLocalConfig(){
// Read local config file
LocalConfig lc;
if(!lc.init(glob.local_config_filename))
if(!lc.init(glob.local_config_filename)){
lc.printError();
return false;
}
glob.localNodeId = lc._ownNodeId;
return true;
......
......@@ -579,6 +579,7 @@ NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb)
m_ndb(ndb)
{
m_globalHash = 0;
m_local_table_data_size= 0;
}
NdbDictionaryImpl::NdbDictionaryImpl(Ndb &ndb,
......
......@@ -289,7 +289,8 @@ String *Item_func_concat::val_str(String *str)
str->copy(*res);
str->append(*res2);
}
res=str;
res= str;
use_as_buff= &tmp_value;
}
else if (res == &tmp_value)
{
......
......@@ -293,7 +293,7 @@ int purge_master_logs(THD* thd, const char* to_log)
char search_file_name[FN_REFLEN];
if (!mysql_bin_log.is_open())
{
send_ok(current_thd);
send_ok(thd);
return 0;
}
......@@ -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 res = mysql_bin_log.purge_logs_before_date(purge_time);
return purge_error_message(thd ,res);
if (!mysql_bin_log.is_open())
{
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()
bzero(bind, sizeof(bind));
bzero(tm, sizeof(tm));
bind[0].buffer_type= MYSQL_TYPE_TIME;
bind[0].buffer_type= MYSQL_TYPE_DATE;
bind[0].buffer= &tm[0];
bind[1].buffer_type= MYSQL_TYPE_TIME;
bind[1].buffer_type= MYSQL_TYPE_DATE;
bind[1].buffer= &tm[1];
mysql_stmt_bind_param(stmt, bind);
......@@ -10152,7 +10152,7 @@ static void test_bug4231()
/* Set one of the dates to zero */
tm[0].year= tm[0].month= tm[0].day= 0;
tm[1]= tm[1];
tm[1]= tm[0];
mysql_stmt_execute(stmt);
rc= mysql_stmt_fetch(stmt);
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