From f0614a9fec597ea478bf7c1c82a8532948ecc2e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:03:01 +0100 Subject: wl1744 - ndb on windows Add rules for creating dsp-files --- ndb/Makefile.am | 5 + ndb/config/win-includes | 8 ++ ndb/config/win-lib.am | 159 +++++++++++++++++++++++ ndb/config/win-libraries | 42 ++++++ ndb/config/win-name | 7 + ndb/config/win-sources | 8 ++ ndb/docs/Makefile.am | 2 + ndb/include/Makefile.am | 2 + ndb/src/Makefile.am | 14 ++ ndb/src/common/Makefile.am | 2 + ndb/src/common/debugger/Makefile.am | 14 ++ ndb/src/common/debugger/signaldata/Makefile.am | 13 ++ ndb/src/common/logger/Makefile.am | 13 ++ ndb/src/common/mgmcommon/Makefile.am | 14 ++ ndb/src/common/portlib/Makefile.am | 14 ++ ndb/src/common/transporter/Makefile.am | 14 ++ ndb/src/common/util/Makefile.am | 14 ++ ndb/src/cw/Makefile.am | 3 + ndb/src/cw/cpcd/Makefile.am | 14 ++ ndb/src/kernel/Makefile.am | 14 ++ ndb/src/kernel/blocks/Makefile.am | 2 + ndb/src/kernel/blocks/backup/Makefile.am | 14 ++ ndb/src/kernel/blocks/backup/restore/Makefile.am | 14 ++ ndb/src/kernel/blocks/cmvmi/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbacc/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbdict/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbdih/Makefile.am | 14 ++ ndb/src/kernel/blocks/dblqh/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtc/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtup/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtux/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbutil/Makefile.am | 14 ++ ndb/src/kernel/blocks/grep/Makefile.am | 14 ++ ndb/src/kernel/blocks/ndbcntr/Makefile.am | 14 ++ ndb/src/kernel/blocks/ndbfs/Makefile.am | 14 ++ ndb/src/kernel/blocks/qmgr/Makefile.am | 14 ++ ndb/src/kernel/blocks/suma/Makefile.am | 14 ++ ndb/src/kernel/blocks/trix/Makefile.am | 14 ++ ndb/src/kernel/error/Makefile.am | 14 ++ ndb/src/kernel/vm/Makefile.am | 14 ++ ndb/src/mgmapi/Makefile.am | 14 ++ ndb/src/mgmclient/Makefile.am | 2 + ndb/src/mgmsrv/Makefile.am | 14 ++ ndb/src/ndbapi/Makefile.am | 14 ++ ndb/test/Makefile.am | 2 + ndb/test/ndbapi/Makefile.am | 2 +- ndb/test/ndbapi/bank/Makefile.am | 2 + ndb/test/run-test/Makefile.am | 14 ++ ndb/test/src/Makefile.am | 14 ++ ndb/test/tools/Makefile.am | 2 + ndb/tools/Makefile.am | 2 + scripts/make_win_src_distribution.sh | 9 +- 52 files changed, 732 insertions(+), 3 deletions(-) create mode 100755 ndb/config/win-includes create mode 100644 ndb/config/win-lib.am create mode 100755 ndb/config/win-libraries create mode 100755 ndb/config/win-name create mode 100755 ndb/config/win-sources diff --git a/ndb/Makefile.am b/ndb/Makefile.am index 82f424fcfb4..abff73359fa 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -17,3 +17,8 @@ dist-hook: done; \ fi; \ done + +windoze: + for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done + +windoze-dsp: diff --git a/ndb/config/win-includes b/ndb/config/win-includes new file mode 100755 index 00000000000..fa5984fd25e --- /dev/null +++ b/ndb/config/win-includes @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's/-I\([^ ]*\)/\/I "\1"/g'` +sed -e "s!@includes@!$out!g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am new file mode 100644 index 00000000000..cae10b9e8d0 --- /dev/null +++ b/ndb/config/win-lib.am @@ -0,0 +1,159 @@ +# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=@name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 TLS" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_release\@name@.lib" +@release_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_debug\@name@.lib" +@debug_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@name@___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "@name@___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@name@___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "@name@___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" +@tls_debug_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@name@___Win32_TLS" +# PROP BASE Intermediate_Dir "@name@___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@name@___Win32_TLS" +# PROP Intermediate_Dir "@name@___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" +@tls_release_libs@ + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" +# Name "@name@ - Win32 TLS_DEBUG" +# Name "@name@ - Win32 TLS" + +# Begin Group "Source Files" +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +@sources@ + +# End Group + +# End Target +# End Project diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries new file mode 100755 index 00000000000..91951957340 --- /dev/null +++ b/ndb/config/win-libraries @@ -0,0 +1,42 @@ +#!/bin/sh + +dst=$1 +shift + +add_lib(){ + echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"` +} + +out_rel= +out_deb= +out_tls_rel= +out_tls_deb= +for i in $* +do + if [ `echo $i | grep -c gcc` -eq 0 ] + then + out_rel="${out_rel} `add_lib lib_release $i`" + out_deb="${out_deb} `add_lib lib_debug $i`" + out_tls_rel="${out_tls_rel} `add_lib lib_release $i _tls`" + out_tls_deb="${out_tls_deb} `add_lib lib_debug $i _tls`" + fi +done + +fix(){ + echo "# ADD BASE LIB32 $*\n# ADD LIB32 $*\n" +} + +if [ "$out_rel" ] +then + out_rel=`fix $out_rel` + out_deb=`fix $out_deb` + out_tls_rel=`fix $out_tls_rel` + out_tls_deb=`fix $out_tls_deb` +fi + +sed -e "s!@release_libs@!$out_rel!g" \ + -e "s!@debug_libs@!$out_deb!g" \ + -e "s!@tls_release_libs@!$out_tls_rel!g" \ + -e "s!@tls_debug_libs@!$out_tls_deb!g" \ + $dst > !tmp!$dst.$$ +mv !tmp!$dst.$$ $dst diff --git a/ndb/config/win-name b/ndb/config/win-name new file mode 100755 index 00000000000..036f2b9cc2e --- /dev/null +++ b/ndb/config/win-name @@ -0,0 +1,7 @@ +#!/bin/sh + +dst=$1 +shift + +sed -e "s/@name@/`echo $1 | sed 's/\.[l]*a//g'`/g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-sources b/ndb/config/win-sources new file mode 100755 index 00000000000..688ecb8ebc4 --- /dev/null +++ b/ndb/config/win-sources @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'` +sed -e "s/@sources@/$out/g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am index 554b2fb256e..c7e344b3dee 100644 --- a/ndb/docs/Makefile.am +++ b/ndb/docs/Makefile.am @@ -100,3 +100,5 @@ odbcdoc: DUMMY testdoc: DUMMY mkdir -p $(OUTDIR) cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test + +windoze-dsp: diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 7b3f80b5560..56f71ae6d0b 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -42,3 +42,5 @@ portlib transporter util dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index bed43438e91..07f6ea5d8d4 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -16,3 +16,17 @@ libndbclient_la_LIBADD = \ common/logger/liblogger.la \ common/portlib/libportlib.la \ common/util/libgeneral.la + +windoze-dsp: libndbclient.dsp + +libndbclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbclient_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(libndbclient_la_LIBADD) diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 8733205eca2..0059f3fb210 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -11,3 +11,5 @@ libcommon_la_LIBADD = \ portlib/libportlib.la \ logger/liblogger.la \ util/libgeneral.la + +windoze-dsp: diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index d0fb30717cd..08251eb9155 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrace.dsp + +libtrace.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index c855c5f8a18..bc18e17fbb0 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -32,3 +32,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: libsignaldataprint.dsp + +libsignaldataprint.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 0a48214c37c..90f3346b414 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -9,3 +9,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: liblogger.dsp + +liblogger.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(liblogger_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index ed6a526eb47..88b042af845 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -15,3 +15,17 @@ include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmsrvcommon.dsp + +libmgmsrvcommon.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 6f3a3fe01a9..fe69ef7346a 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -16,3 +16,17 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp munmaptest_SOURCES = munmaptest.cpp # Don't update the files from bitkeeper + +windoze-dsp: libportlib.dsp + +libportlib.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libportlib_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 9d91a210d46..3204a9a9254 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -20,3 +20,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtransporter.dsp + +libtransporter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 61fd7992002..cbc849a49f9 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -16,3 +16,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgeneral.dsp + +libgeneral.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/cw/Makefile.am b/ndb/src/cw/Makefile.am index b530922a3a7..7348fc9eab6 100644 --- a/ndb/src/cw/Makefile.am +++ b/ndb/src/cw/Makefile.am @@ -1 +1,4 @@ SUBDIRS = cpcd + +windoze-dsp: + diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 6af44a359fc..20ac8e6e578 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -16,3 +16,17 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_cpcd.dsp + +ndb_cpcd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_cpcd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 493ab4f9982..5b975d9d0eb 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -59,3 +59,17 @@ LDADD += \ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndbd.dsp + +ndbd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am index 0b2bc3b8c88..7ee90e6239f 100644 --- a/ndb/src/kernel/blocks/Makefile.am +++ b/ndb/src/kernel/blocks/Makefile.am @@ -15,3 +15,5 @@ SUBDIRS = \ suma \ grep \ dbtux + +windoze-dsp: diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 85bf5b12415..4726f291d01 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libbackup.dsp + +libbackup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am index 16550f13546..3a9baea8fbc 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am @@ -14,3 +14,17 @@ include $(top_srcdir)/ndb/config/common.mk.am INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ + +windoze-dsp: ndb_restore.dsp + +ndb_restore.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_restore_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index fdd43932682..f806183338f 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libcmvmi.dsp + +libcmvmi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index 7ccfbe22f76..40b0ecdee1f 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbacc.dsp + +libdbacc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index dc4c4fe4734..c97dcb62ba5 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdict.dsp + +libdbdict.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 2ee8017ec13..86eb4df5df1 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdih.dsp + +libdbdih.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index 3a58dba742e..3ea54b29659 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdblqh.dsp + +libdblqh.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index 4aa514c0aba..cf8f7c36fd3 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtc.dsp + +libdbtc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index 7e94a01d43b..a1cf3f0d234 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -25,3 +25,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtup.dsp + +libdbtup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index 7d012924522..a6bcad10a76 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -18,3 +18,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtux.dsp + +libdbtux.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 763875d578f..24ed1d48086 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libutil.dsp + +libutil.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libutil_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am index 31081c7b6a0..cbb1c1721c1 100644 --- a/ndb/src/kernel/blocks/grep/Makefile.am +++ b/ndb/src/kernel/blocks/grep/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgrep.dsp + +libgrep.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index 9230b55b374..de5e24e6be8 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbcntr.dsp + +libndbcntr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index c2b663c5042..b33508f6bee 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -11,3 +11,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbfs.dsp + +libndbfs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 52cadb3bd3d..280fd7caeec 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libqmgr.dsp + +libqmgr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 4dacb22af51..1101aa78c73 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libsuma.dsp + +libsuma.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 803da815cf0..85ff101b496 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrix.dsp + +libtrix.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index 4514d2d105c..fe78667caba 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: liberror.dsp + +liberror.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 4e9dbe36c78..038ea882dce 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -27,3 +27,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libkernel.dsp + +libkernel.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index 0f0e1cea5d8..fab9f5d762d 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -13,3 +13,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmapi.dsp + +libmgmapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index cd6ddb0ad57..88bd3c4f529 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -23,3 +23,5 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 4cb164d48fe..a78c4a85fd3 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -42,3 +42,17 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_mgmd.dsp + +ndb_mgmd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 06128e047b6..e3dcd682bba 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -47,3 +47,17 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbapi.dsp + +libndbapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index 2e0f30df9d4..b8753668c60 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -4,3 +4,5 @@ EXTRA_DIST = include dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 787589dd9b6..310854edf77 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -84,4 +84,4 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% - +windoze-dsp: diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am index 886d664aefb..d4f82a7f9c4 100644 --- a/ndb/test/ndbapi/bank/Makefile.am +++ b/ndb/test/ndbapi/bank/Makefile.am @@ -20,3 +20,5 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index c890536dcc6..bc245a1413f 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -23,3 +23,17 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: atrt.dsp + +atrt.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(test_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(atrt_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 56f3d6a1ec6..7d5904d897b 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -19,3 +19,17 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libNDBT.dsp + +libNDBT.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 3255267b636..a6a013bb263 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -27,3 +27,5 @@ ndb_cpcc_LDADD = $(LDADD) # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index fad9bf9ff84..59fc5c124be 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -37,3 +37,5 @@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..d9144ab3dce 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -188,7 +188,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ README INSTALL* LICENSE do if [ -f $i ] @@ -243,11 +243,16 @@ do copy_dir_files $i done +# +# Create project files for ndb +# +make -C ndb windoze + # # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase ndb do copy_dir_dirs $i done -- cgit v1.2.1 From 59ee75bd57b989cbfd9ccd8b986f00cdcbc599b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:13:26 +0100 Subject: wl1744 - fix compiler problems ndb/include/debugger/GrepError.hpp: prexif ndb/include/kernel/LogLevel.hpp: fix correct type prototype ndb/include/kernel/signaldata/FsCloseReq.hpp: remove usage of true ndb/include/mgmapi/mgmapi.h: use Uint64 instead of long long ndb/include/mgmcommon/IPCConfig.hpp: correct type ndb/include/portlib/NdbTCP.h: fix #elif ndb/include/transporter/TransporterRegistry.hpp: correct type ndb/include/util/Parser.hpp: correct type made stuff public as vc++ couldn't handle template friends ndb/include/util/SimpleProperties.hpp: correct type ndb/src/common/debugger/EventLogger.cpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/common/debugger/GrepError.cpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/common/debugger/signaldata/FsCloseReq.cpp: removed usage of true ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp: removed usage of true ndb/src/common/logger/LogHandlerList.hpp: use ndb_global ndb/src/common/mgmcommon/ConfigRetriever.cpp: removed ConfigRetriever::get_config(file) from windows ndb/src/common/transporter/TransporterRegistry.cpp: interface is a reserved word in vc++ ndb/src/kernel/blocks/grep/Grep.hpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/kernel/vm/Configuration.cpp: Use BaseString::snprintf ndb/src/kernel/vm/Configuration.hpp: correct type ndb/src/kernel/vm/SimplePropertiesSection.cpp: correct type ndb/src/mgmapi/mgmapi_configuration.cpp: use Uin6t4 ndb/src/mgmapi/mgmapi_configuration.hpp: use Uin6t4 ndb/src/mgmsrv/ConfigInfo.cpp: Prefix ndb/src/mgmsrv/ConfigInfo.hpp: prefix ndb/src/ndbapi/Ndb.cpp: removed usued include ndb/src/ndbapi/NdbImpl.hpp: prefix ndb/src/ndbapi/ObjectMap.hpp: Better typecast --- ndb/include/debugger/GrepError.hpp | 8 +- ndb/include/kernel/LogLevel.hpp | 2 +- ndb/include/kernel/signaldata/FsCloseReq.hpp | 2 +- ndb/include/mgmapi/mgmapi.h | 2 +- ndb/include/mgmcommon/IPCConfig.hpp | 2 +- ndb/include/portlib/NdbTCP.h | 2 +- ndb/include/transporter/TransporterRegistry.hpp | 2 +- ndb/include/util/Parser.hpp | 6 +- ndb/include/util/SimpleProperties.hpp | 20 +- ndb/src/common/debugger/EventLogger.cpp | 30 +- ndb/src/common/debugger/GrepError.cpp | 4 +- ndb/src/common/debugger/signaldata/FsCloseReq.cpp | 2 +- .../common/debugger/signaldata/FsReadWriteReq.cpp | 2 +- ndb/src/common/logger/LogHandlerList.hpp | 1 + ndb/src/common/mgmcommon/ConfigRetriever.cpp | 7 +- ndb/src/common/transporter/TransporterRegistry.cpp | 18 +- ndb/src/kernel/blocks/grep/Grep.hpp | 8 +- ndb/src/kernel/vm/Configuration.cpp | 2 +- ndb/src/kernel/vm/Configuration.hpp | 2 +- ndb/src/kernel/vm/SimplePropertiesSection.cpp | 4 +- ndb/src/mgmapi/mgmapi_configuration.cpp | 3 +- ndb/src/mgmapi/mgmapi_configuration.hpp | 2 +- ndb/src/mgmsrv/ConfigInfo.cpp | 716 ++++++++++----------- ndb/src/mgmsrv/ConfigInfo.hpp | 10 +- ndb/src/ndbapi/Ndb.cpp | 2 +- ndb/src/ndbapi/NdbImpl.hpp | 2 +- ndb/src/ndbapi/ObjectMap.hpp | 2 +- 27 files changed, 434 insertions(+), 429 deletions(-) diff --git a/ndb/include/debugger/GrepError.hpp b/ndb/include/debugger/GrepError.hpp index ab6a7b272a5..beedbd95c80 100644 --- a/ndb/include/debugger/GrepError.hpp +++ b/ndb/include/debugger/GrepError.hpp @@ -24,8 +24,8 @@ */ class GrepError { public: - enum Code { - NO_ERROR = 0, + enum GE_Code { + GE_NO_ERROR = 0, SUBSCRIPTION_ID_NOMEM = 1, SUBSCRIPTION_ID_NOT_FOUND = 2, SUBSCRIPTION_ID_NOT_UNIQUE = 3, @@ -82,12 +82,12 @@ public: }; struct ErrorDescription { - Code errCode; + GE_Code errCode; const char * name; }; static const ErrorDescription errorDescriptions[]; static const Uint32 noOfErrorDescs; - static const char * getErrorDesc(GrepError::Code err); + static const char * getErrorDesc(GrepError::GE_Code err); }; diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 467f0604edd..5981ca4701a 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -89,7 +89,7 @@ public: return memcmp(this, &l, sizeof(* this)) == 0; } - LogLevel& operator=(const class EventSubscribeReq & req); + LogLevel& operator=(const struct EventSubscribeReq & req); private: /** diff --git a/ndb/include/kernel/signaldata/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp index c42afa143e6..10d094fb30b 100644 --- a/ndb/include/kernel/signaldata/FsCloseReq.hpp +++ b/ndb/include/kernel/signaldata/FsCloseReq.hpp @@ -75,7 +75,7 @@ inline void FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){ // ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag"); - if (removefile == true) + if (removefile) fileflag = 1; else fileflag = 0; diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 6dcf58b44e2..582e8f1a3e6 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -730,7 +730,7 @@ extern "C" { int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*, int param, unsigned * value); int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*, - int param, unsigned long long * value); + int param, Uint64 * value); int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int param, const char ** value); #ifdef __cplusplus diff --git a/ndb/include/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp index ebe65b53b59..1e23cdf9807 100644 --- a/ndb/include/mgmcommon/IPCConfig.hpp +++ b/ndb/include/mgmcommon/IPCConfig.hpp @@ -59,7 +59,7 @@ public: void print() const { props->print(); } static Uint32 configureTransporters(Uint32 nodeId, - const class ndb_mgm_configuration &, + const struct ndb_mgm_configuration &, class TransporterRegistry &); private: diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 4dc8435eef1..8138a2ef354 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -40,7 +40,7 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#elif NDB_WIN32 +#elif defined NDB_WIN32 /** * Include files needed diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index ac6291f9e57..a2014ffe8d4 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -224,7 +224,7 @@ public: const char *m_interface; }; Vector m_transporter_interface; - void add_transporter_interface(const char *interface, unsigned short port); + void add_transporter_interface(const char *interf, unsigned short port); protected: private: diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp index 65cf24db633..c117498e1ba 100644 --- a/ndb/include/util/Parser.hpp +++ b/ndb/include/util/Parser.hpp @@ -23,7 +23,7 @@ #include "NdbOut.hpp" class ParserImpl; -template class ParserRow; +template struct ParserRow; //#define PARSER_DEBUG #ifdef PARSER_DEBUG @@ -130,11 +130,11 @@ public: * The void* equivalent implementation */ class ParserImpl { +public: class Dummy {}; typedef ParserRow DummyRow; typedef Parser::Context Context; - template friend class Parser; -private: + ParserImpl(const DummyRow rows[], class InputStream & in, bool b_cmd, bool b_empty, bool b_iarg); diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index d5ebb16bb09..356f3406f38 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -38,20 +38,20 @@ public: /** * Value types */ - enum ValueType { + enum ValueType { Uint32Value = 0, StringValue = 1, BinaryValue = 2, InvalidValue = 3 - }; - + }; + /** * Struct for defining mapping to be used with unpack */ struct SP2StructMapping { Uint16 Key; Uint32 Offset; - SimpleProperties::ValueType Type; + ValueType Type; Uint32 minValue; Uint32 maxValue; Uint32 Length_Offset; // Offset used for looking up length of @@ -233,7 +233,7 @@ private: */ class SimplePropertiesSectionReader : public SimpleProperties::Reader { public: - SimplePropertiesSectionReader(class SegmentedSectionPtr &, + SimplePropertiesSectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); virtual void reset(); @@ -248,8 +248,8 @@ private: Uint32 m_pos; Uint32 m_len; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; - class SectionSegment * m_currentSegment; + struct SectionSegment * m_head; + struct SectionSegment * m_currentSegment; }; inline @@ -275,15 +275,15 @@ public: /** * This "unlinks" the writer from the memory */ - void getPtr(class SegmentedSectionPtr & dst); + void getPtr(struct SegmentedSectionPtr & dst); private: Int32 m_pos; Uint32 m_sz; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; + struct SectionSegment * m_head; Uint32 m_prevPtrI; // Prev to m_currentSegment - class SectionSegment * m_currentSegment; + struct SectionSegment * m_currentSegment; }; #endif diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8a09be9a0a7..8f186a9efe7 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1028,7 +1028,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::SSCoord:Error code: %d Error message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1045,7 +1045,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartMetaRef: @@ -1061,7 +1061,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartDataRef: @@ -1076,7 +1076,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncMetaRef: @@ -1091,7 +1091,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncDataRef: @@ -1108,7 +1108,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubRemoveRef: @@ -1123,7 +1123,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err) + GrepError::getErrorDesc((GrepError::GE_Code)err) ); break; } @@ -1137,7 +1137,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::PSCoord: Error code: %d Error Message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1154,7 +1154,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartMetaRef: @@ -1170,7 +1170,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartDataRef: @@ -1185,7 +1185,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncMetaRef: @@ -1200,7 +1200,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncDataRef: @@ -1217,7 +1217,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubRemoveRef: @@ -1232,7 +1232,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::Rep_Disconnect: @@ -1244,7 +1244,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, " Error code: %d Error Message: %s", nodeId, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } diff --git a/ndb/src/common/debugger/GrepError.cpp b/ndb/src/common/debugger/GrepError.cpp index ec0c26a5855..20aeaa6dd77 100644 --- a/ndb/src/common/debugger/GrepError.cpp +++ b/ndb/src/common/debugger/GrepError.cpp @@ -21,7 +21,7 @@ */ const GrepError::ErrorDescription GrepError::errorDescriptions[] = { - { GrepError::NO_ERROR, + { GrepError::GE_NO_ERROR, "No error" }, { GrepError::SUBSCRIPTION_ID_NOMEM, "Not enough resources to allocate the subscription" }, @@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) / * gets the corresponding error message to an err code */ const char * -GrepError::getErrorDesc(GrepError::Code err) { +GrepError::getErrorDesc(GrepError::GE_Code err) { for(Uint32 i = 0; iuserReference); fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag); - if (sig->getRemoveFileFlag(sig->fileFlag) == true) + if (sig->getRemoveFileFlag(sig->fileFlag)) fprintf(output, "Remove file"); else fprintf(output, "Don't remove file"); diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp index 9b32fab87ba..a9f240d3cb4 100644 --- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp @@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, fprintf(output, " UserReference: H\'%.8x", sig->userReference); fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag); - if (sig->getSyncFlag(sig->operationFlag) == true) + if (sig->getSyncFlag(sig->operationFlag)) fprintf(output, "Sync,"); else fprintf(output, "No sync,"); diff --git a/ndb/src/common/logger/LogHandlerList.hpp b/ndb/src/common/logger/LogHandlerList.hpp index 7c001a28a76..21344023560 100644 --- a/ndb/src/common/logger/LogHandlerList.hpp +++ b/ndb/src/common/logger/LogHandlerList.hpp @@ -18,6 +18,7 @@ #define LOGHANDLERLIST_H class LogHandler; +#include /** * Provides a simple linked list of log handlers. diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index d8417ac146a..d03d6fbdb6e 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -178,9 +178,10 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){ return conf; } - + ndb_mgm_configuration * ConfigRetriever::getConfig(const char * filename){ +#ifndef NDB_WIN32 struct stat sbuf; const int res = stat(filename, &sbuf); @@ -217,8 +218,10 @@ ConfigRetriever::getConfig(const char * filename){ return 0; } delete [] buf2; - return (ndb_mgm_configuration*)cvf.m_cfg; +#else + return 0; +#endif } void diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index cacbbed00f1..4dbd9588512 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1167,31 +1167,31 @@ TransporterRegistry::stop_clients() } void -TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port) +TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port) { DBUG_ENTER("TransporterRegistry::add_transporter_interface"); - DBUG_PRINT("enter",("interface=%s, port= %d", interface, port)); - if (interface && strlen(interface) == 0) - interface= 0; + DBUG_PRINT("enter",("interface=%s, port= %d", interf, port)); + if (interf && strlen(interf) == 0) + interf= 0; for (unsigned i= 0; i < m_transporter_interface.size(); i++) { Transporter_interface &tmp= m_transporter_interface[i]; if (port != tmp.m_service_port) continue; - if (interface != 0 && tmp.m_interface != 0 && - strcmp(interface, tmp.m_interface) == 0) + if (interf != 0 && tmp.m_interface != 0 && + strcmp(interf, tmp.m_interface) == 0) { DBUG_VOID_RETURN; // found match, no need to insert } - if (interface == 0 && tmp.m_interface == 0) + if (interf == 0 && tmp.m_interface == 0) { DBUG_VOID_RETURN; // found match, no need to insert } } Transporter_interface t; t.m_service_port= port; - t.m_interface= interface; + t.m_interface= interf; m_transporter_interface.push_back(t); DBUG_PRINT("exit",("interface and port added")); DBUG_VOID_RETURN; @@ -1200,7 +1200,7 @@ TransporterRegistry::add_transporter_interface(const char *interface, unsigned s bool TransporterRegistry::start_service(SocketServer& socket_server) { - if (m_transporter_interface.size() > 0 && nodeIdSpecified != true) + if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified"); return false; diff --git a/ndb/src/kernel/blocks/grep/Grep.hpp b/ndb/src/kernel/blocks/grep/Grep.hpp index eeabac36966..7d3dd916ecc 100644 --- a/ndb/src/kernel/blocks/grep/Grep.hpp +++ b/ndb/src/kernel/blocks/grep/Grep.hpp @@ -380,16 +380,16 @@ public: Uint32 subId, Uint32 subKey, BlockReference to, - GrepError::Code err); + GrepError::GE_Code err); void sendSubRemoveRef_SS(Signal * signal, SubCoordinator sub, - GrepError::Code err); + GrepError::GE_Code err); void sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); void setRepRef(BlockReference rr) { m_repRef = rr; }; @@ -496,7 +496,7 @@ public: void sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); //protected: diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index b3a436275f7..795670a1322 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -556,7 +556,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ noOfDBNodes++; // No of NDB processes if(nodeId > MAX_NDB_NODES){ - snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", + BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index e4cd64f5ca8..34e70ca3121 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -21,7 +21,7 @@ #include class ConfigRetriever; -class LocalConfig; +struct LocalConfig; class Configuration { public: diff --git a/ndb/src/kernel/vm/SimplePropertiesSection.cpp b/ndb/src/kernel/vm/SimplePropertiesSection.cpp index d442ff2e698..070563be36b 100644 --- a/ndb/src/kernel/vm/SimplePropertiesSection.cpp +++ b/ndb/src/kernel/vm/SimplePropertiesSection.cpp @@ -19,7 +19,7 @@ #include "LongSignal.hpp" SimplePropertiesSectionReader::SimplePropertiesSectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ @@ -190,7 +190,7 @@ SimplePropertiesSectionWriter::putWords(const Uint32 * src, Uint32 len){ } void -SimplePropertiesSectionWriter::getPtr(class SegmentedSectionPtr & dst){ +SimplePropertiesSectionWriter::getPtr(struct SegmentedSectionPtr & dst){ // Set last ptr and size if(m_pos >= 0){ dst.p = m_head; diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp index ae7fe2c294c..7bac2d10b92 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.cpp +++ b/ndb/src/mgmapi/mgmapi_configuration.cpp @@ -1,3 +1,4 @@ +#include #include #include "mgmapi_configuration.hpp" #include @@ -138,7 +139,7 @@ ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter, extern "C" int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter, - int param, unsigned long long * value){ + int param, Uint64 * value){ return iter->get(param, value); } diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp index c7feffd3a4e..9e94b3311bf 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.hpp +++ b/ndb/src/mgmapi/mgmapi_configuration.hpp @@ -21,7 +21,7 @@ struct ndb_mgm_configuration_iterator { int find(int param, unsigned value); int get(int param, unsigned * value) const ; - int get(int param, unsigned long long * value) const ; + int get(int param, Uint64 * value) const ; int get(int param, const char ** value) const ; // diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ad346b30ead..5f1f0cccb23 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -256,9 +256,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "COMPUTER", "COMPUTER", "Computer section", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, 0, 0, 0 }, @@ -267,9 +267,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "COMPUTER", "Name of computer", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -278,9 +278,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "COMPUTER", "Hostname of computer (e.g. mysql.com)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -289,9 +289,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ByteOrder", "COMPUTER", 0, - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -304,9 +304,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SYSTEM", "SYSTEM", "System section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CFG_SECTION_SYSTEM, 0, 0 }, @@ -315,9 +315,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Name", "SYSTEM", "Name of system (NDB Cluster)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -326,9 +326,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReplicationRole", "SYSTEM", "Role in Global Replication (None, Primary, or Standby)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -337,9 +337,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrimaryMGMNode", "SYSTEM", "Node id of Primary "MGM_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -349,9 +349,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ConfigGenerationNumber", "SYSTEM", "Configuration generation number", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -364,9 +364,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { DB_TOKEN, DB_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_DB, 0, 0 }, @@ -376,9 +376,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", DB_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -387,9 +387,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", DB_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -398,9 +398,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", DB_TOKEN, "Number identifying the database node ("DB_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -410,9 +410,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ServerPort", DB_TOKEN, "Port used to setup transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "1", STR_VALUE(MAX_INT_RNIL) }, @@ -422,9 +422,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfReplicas", DB_TOKEN, "Number of copies of all data in the database (1-4)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", "4" }, @@ -434,9 +434,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfAttributes", DB_TOKEN, "Total number of attributes stored in database. I.e. sum over all tables", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -446,9 +446,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTables", DB_TOKEN, "Total number of tables stored in the database", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "8", STR_VALUE(MAX_INT_RNIL) }, @@ -458,9 +458,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOrderedIndexes", DB_TOKEN, "Total number of ordered indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -470,9 +470,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfUniqueHashIndexes", DB_TOKEN, "Total number of unique hash indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -482,9 +482,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfIndexes", DB_TOKEN, "Total number of indexes that can be defined in the system", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -494,9 +494,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentIndexOperations", DB_TOKEN, "Total number of index operations that can execute simultaneously on one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "0", STR_VALUE(MAX_INT_RNIL) @@ -507,9 +507,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTriggers", DB_TOKEN, "Total number of triggers that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "768", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -519,9 +519,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfFiredTriggers", DB_TOKEN, "Total number of triggers that can fire simultaneously in one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -531,9 +531,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", DB_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -542,9 +542,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedMessages", DB_TOKEN, "Max number of error messages in error log and max number of trace files", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "25", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -554,9 +554,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LockPagesInMainMemory", DB_TOKEN, "If set to yes, then NDB Cluster data will not be swapped out to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -566,9 +566,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenWatchDogCheck", DB_TOKEN, "Time between execution checks inside a database node", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "6000", "70", STR_VALUE(MAX_INT_RNIL) }, @@ -578,9 +578,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StopOnError", DB_TOKEN, "If set to N, "DB_TOKEN_PRINT" automatically restarts/recovers in case of node failure", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -590,9 +590,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RestartOnErrorInsert", DB_TOKEN, "See src/kernel/vm/Emulator.hpp NdbRestartType for details", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2", "0", "4" }, @@ -602,9 +602,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentOperations", DB_TOKEN, "Max number of operation records in transaction coordinator", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32k", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -614,9 +614,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalOperations", DB_TOKEN, "Max number of operation records defined in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -626,9 +626,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalScans", DB_TOKEN, "Max number of fragment scans in parallel in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -638,9 +638,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSizePerLocalScan", DB_TOKEN, "Used to calculate the number of lock records for scan with hold lock", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -650,9 +650,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentTransactions", DB_TOKEN, "Max number of transaction executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4096", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -662,9 +662,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentScans", DB_TOKEN, "Max number of scans executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256", "2", "500" }, @@ -674,9 +674,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TransactionBufferMemory", DB_TOKEN, "Dynamic buffer space (in bytes) for key and attribute data allocated for each "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "1K", STR_VALUE(MAX_INT_RNIL) }, @@ -686,9 +686,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "IndexMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing indexes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "18M", "1M", "1024G" }, @@ -698,9 +698,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing data", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "80M", "1M", "1024G" }, @@ -710,9 +710,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoIndexBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for index part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -722,9 +722,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoDataBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for data part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "16M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -734,9 +734,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RedoBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing REDO logs", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -746,9 +746,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LongMessageBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for internal long messages", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "512k", STR_VALUE(MAX_INT_RNIL)}, @@ -758,9 +758,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartialTimeout", DB_TOKEN, "Time to wait before trying to start wo/ all nodes. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "30000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -770,9 +770,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartitionedTimeout", DB_TOKEN, "Time to wait before trying to start partitioned. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "60000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -782,9 +782,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartFailureTimeout", DB_TOKEN, "Time to wait before terminating. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -794,9 +794,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbDb", DB_TOKEN, "Time between "DB_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "DB_TOKEN_PRINT" considered dead after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -806,9 +806,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbApi", DB_TOKEN, "Time between "API_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "API_TOKEN_PRINT" connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -818,9 +818,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenLocalCheckpoints", DB_TOKEN, "Time between taking snapshots of the database (expressed in 2log of bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "0", "31" }, @@ -830,9 +830,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenGlobalCheckpoints", DB_TOKEN, "Time between doing group commit of transactions to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2000", "10", "32000" }, @@ -842,9 +842,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfFragmentLogFiles", DB_TOKEN, "No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -854,9 +854,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOpenFiles", DB_TOKEN, "Max number of files open per "DB_TOKEN_PRINT" node.(One thread is created per file)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "20", "256" }, @@ -867,9 +867,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenInactiveTransactionAbortCheck", DB_TOKEN, "Time between inactive transaction checks", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "1000", STR_VALUE(MAX_INT_RNIL) }, @@ -883,9 +883,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "to execute or send another part (query, statement) of the transaction.\n" "If the application takes too long time, the transaction gets aborted.\n" "Timeout set to 0 means that we don't timeout at all on application wait.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_INT_RNIL), "0", STR_VALUE(MAX_INT_RNIL) }, @@ -898,9 +898,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "This is the time the transaction coordinator waits for each database node\n" "of the transaction to execute a request. If the database node takes too\n" "long time, the transaction gets aborted.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1200", "50", STR_VALUE(MAX_INT_RNIL) }, @@ -910,9 +910,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -922,9 +922,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -934,9 +934,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -946,9 +946,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -959,9 +959,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Diskless", DB_TOKEN, "Run wo/ disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -971,9 +971,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Discless", DB_TOKEN, "Diskless", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -985,9 +985,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationTimeout", DB_TOKEN, "Max time (milliseconds) database partion waits for arbitration signal", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -997,9 +997,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", DB_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1008,9 +1008,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "FileSystemPath", DB_TOKEN, "Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1019,9 +1019,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStartup", DB_TOKEN, "Node startup info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "15" }, @@ -1031,9 +1031,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelShutdown", DB_TOKEN, "Node shutdown info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1043,9 +1043,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStatistic", DB_TOKEN, "Transaction, operation, transporter info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1055,9 +1055,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelCheckpoint", DB_TOKEN, "Local and Global checkpoint info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1067,9 +1067,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelNodeRestart", DB_TOKEN, "Node restart, node failure info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1079,9 +1079,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelConnection", DB_TOKEN, "Node connect/disconnect info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1091,9 +1091,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelError", DB_TOKEN, "Transporter, heartbeat errors printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1103,9 +1103,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelInfo", DB_TOKEN, "Heartbeat and log info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1118,9 +1118,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ParallelBackups", DB_TOKEN, "Maximum number of parallel backups", - ConfigInfo::NOTIMPLEMENTED, + ConfigInfo::CI_NOTIMPLEMENTED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "1", "1" }, @@ -1130,9 +1130,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataDir", DB_TOKEN, "Path to where to store backups", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1141,9 +1141,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupMemory", DB_TOKEN, "Total memory allocated for backups per node (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4M", // sum of BackupDataBufferSize and BackupLogBufferSize "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1153,9 +1153,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataBufferSize", DB_TOKEN, "Default size of databuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1165,9 +1165,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupLogBufferSize", DB_TOKEN, "Default size of logbuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1177,9 +1177,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupWriteSize", DB_TOKEN, "Default size of filesystem writes made by backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32K", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1192,9 +1192,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "REP", "REP", "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_REP, 0, 0 }, @@ -1204,9 +1204,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "REP", "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1215,9 +1215,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", "REP", "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1226,9 +1226,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "REP", "Number identifying replication node (REP)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1238,9 +1238,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", "REP", "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1249,9 +1249,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalRepRep", "REP", "Time between REP-REP heartbeats. Connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -1264,9 +1264,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { API_TOKEN, API_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_API, 0, 0 }, @@ -1276,9 +1276,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", API_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1287,9 +1287,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", API_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1298,9 +1298,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", API_TOKEN, "Number identifying application node ("API_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1310,9 +1310,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", API_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1321,9 +1321,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", API_TOKEN, "If 0, then "API_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "2" }, @@ -1333,9 +1333,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", API_TOKEN, "When asked to arbitrate, arbitrator waits this long before voting (msec)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1345,9 +1345,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxScanBatchSize", "API", "The maximum collective batch size for one scan", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_SCAN_BATCH_SIZE), "32k", "16M" }, @@ -1357,9 +1357,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchByteSize", "API", "The default batch size in bytes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(SCAN_BATCH_SIZE), "1k", "1M" }, @@ -1369,9 +1369,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSize", "API", "The default batch size in number of records", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -1384,9 +1384,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MGM_TOKEN, MGM_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_MGM, 0, 0 }, @@ -1396,9 +1396,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", MGM_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1407,9 +1407,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", MGM_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1418,9 +1418,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", MGM_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1429,9 +1429,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", MGM_TOKEN, "Number identifying the management server node ("MGM_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1441,9 +1441,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogDestination", MGM_TOKEN, "String describing where logmessages are sent", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1452,9 +1452,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", MGM_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1463,9 +1463,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedEvents", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "100", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1475,9 +1475,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", MGM_TOKEN, "Port number to give commands to/fetch configurations from management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, NDB_BASE_PORT, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1487,9 +1487,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumberStats", MGM_TOKEN, "Port number used to get statistical information from a management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2199", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1499,9 +1499,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", MGM_TOKEN, "If 0, then "MGM_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "2" }, @@ -1511,9 +1511,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1526,9 +1526,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TCP", "TCP", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_TCP, 0, 0 }, @@ -1538,9 +1538,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1549,9 +1549,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1560,9 +1560,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1571,9 +1571,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1582,9 +1582,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "TCP", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1595,9 +1595,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "TCP", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1607,9 +1607,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "TCP", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1619,9 +1619,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendBufferMemory", "TCP", "Bytes of buffer for signals sent from this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1631,9 +1631,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveBufferMemory", "TCP", "Bytes of buffer for signals received by this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1643,9 +1643,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Proxy", "TCP", "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1654,9 +1654,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "TCP", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1665,9 +1665,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "TCP", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1680,9 +1680,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SHM", "SHM", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SHM, 0, 0 }, @@ -1691,9 +1691,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1702,9 +1702,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "SHM", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1714,9 +1714,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1725,9 +1725,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "SHM", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1738,9 +1738,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SHM", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1750,9 +1750,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmKey", "SHM", "A shared memory key", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1762,9 +1762,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmSize", "SHM", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "4K", STR_VALUE(MAX_INT_RNIL) }, @@ -1774,9 +1774,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SHM", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1785,9 +1785,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SHM", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1799,9 +1799,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SCI", "SCI", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SCI, 0, 0 }, @@ -1811,9 +1811,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1823,9 +1823,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1835,9 +1835,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1846,9 +1846,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1857,9 +1857,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "SCI", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1869,9 +1869,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId0", "SCI", "SCI-node id for adapter 0 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1881,9 +1881,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId1", "SCI", "SCI-node id for adapter 1 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1893,9 +1893,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId0", "SCI", "SCI-node id for adapter 0 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1905,9 +1905,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId1", "SCI", "SCI-node id for adapter 1 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1917,9 +1917,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "SCI", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1929,9 +1929,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SCI", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1941,9 +1941,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendLimit", "SCI", "Transporter send buffer contents are sent when this no of bytes is buffered", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "128", "32K" }, @@ -1953,9 +1953,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SharedBufferSize", "SCI", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "64K", STR_VALUE(MAX_INT_RNIL) }, @@ -1965,9 +1965,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SCI", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1976,9 +1976,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SCI", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1990,9 +1990,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "OSE", "OSE", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_OSE, 0, 0 }, @@ -2002,9 +2002,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2013,9 +2013,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2024,9 +2024,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2036,9 +2036,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2048,9 +2048,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "OSE", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -2060,9 +2060,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "OSE", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -2072,9 +2072,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioASignalSize", "OSE", "Size of priority A signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2084,9 +2084,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioBSignalSize", "OSE", "Size of priority B signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2096,9 +2096,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveArraySize", "OSE", "Number of OSE signals checked for correct ordering (in no of OSE signals)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "10", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2108,9 +2108,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "OSE", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2119,9 +2119,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "OSE", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, }; @@ -2169,7 +2169,7 @@ ConfigInfo::ConfigInfo() } switch (param._type) { - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._min, tmp_bool)); @@ -2178,8 +2178,8 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_bool); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._min, tmp_uint64)); @@ -2188,10 +2188,10 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_uint64); break; } - case SECTION: + case CI_SECTION: pinfo.put("SectionType", (Uint32)UintPtr(param._default)); break; - case STRING: + case CI_STRING: break; } @@ -2209,7 +2209,7 @@ ConfigInfo::ConfigInfo() // Replace section with modified section m_info.put(param._section, section, true); - if(param._type != ConfigInfo::SECTION){ + if(param._type != ConfigInfo::CI_SECTION){ Properties * p; if(!m_systemDefaults.getCopy(param._section, &p)){ p = new Properties(true); @@ -2218,20 +2218,20 @@ ConfigInfo::ConfigInfo() param._default != MANDATORY){ switch (param._type) { - case SECTION: + case CI_SECTION: break; - case STRING: + case CI_STRING: require(p->put(param._fname, param._default)); break; - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._default, default_bool)); require(p->put(param._fname, default_bool)); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64)); @@ -2253,7 +2253,7 @@ ConfigInfo::ConfigInfo() exit(-1); } - if(m_ParamInfo[i]._type == ConfigInfo::SECTION) + if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION) continue; const Properties * p = getInfo(m_ParamInfo[i]._section); @@ -2272,12 +2272,12 @@ ConfigInfo::ConfigInfo() * Getters ****************************************************************************/ inline void warning(const char * src, const char * arg){ - ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; + ndbout << "Illegal call to ConfigInfo::CI_" << src << "() - " << arg << endl; abort(); } const Properties * -ConfigInfo::getInfo(const char * section) const { +ConfigInfo::CI_getInfo(const char * section) const { const Properties * p; if(!m_info.get(section, &p)){ return 0; @@ -2391,41 +2391,41 @@ ConfigInfo::getType(const Properties * section, const char* fname) const { return (ConfigInfo::Type) getInfoInt(section, fname, "Type"); } -ConfigInfo::Status -ConfigInfo::getStatus(const Properties * section, const char* fname) const { - return (ConfigInfo::Status) getInfoInt(section, fname, "Status"); +ConfigInfo::CI_Status +ConfigInfo::CI_getStatus(const Properties * section, const char* fname) const { + return (ConfigInfo::CI_Status) getInfoInt(section, fname, "Status"); } /**************************************************************************** * Printers ****************************************************************************/ -void ConfigInfo::print() const { +void ConfigInfo::CI_print() const { Properties::Iterator it(&m_info); for (const char* n = it.first(); n != NULL; n = it.next()) { print(n); } } -void ConfigInfo::print(const char* section) const { +void ConfigInfo::CI_print(const char* section) const { ndbout << "****** " << section << " ******" << endl << endl; const Properties * sec = getInfo(section); Properties::Iterator it(sec); for (const char* n = it.first(); n != NULL; n = it.next()) { // Skip entries with different F- and P-names - if (getStatus(sec, n) == ConfigInfo::INTERNAL) continue; - if (getStatus(sec, n) == ConfigInfo::DEPRICATED) continue; - if (getStatus(sec, n) == ConfigInfo::NOTIMPLEMENTED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_INTERNAL) continue; + if (getStatus(sec, n) == ConfigInfo::CI_DEPRICATED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; print(sec, n); } } -void ConfigInfo::print(const Properties * section, +void ConfigInfo::CI_print(const Properties * section, const char* parameter) const { ndbout << parameter; // ndbout << getDescription(section, parameter) << endl; switch (getType(section, parameter)) { - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: ndbout << " (Boolean value)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == false) { @@ -2440,8 +2440,8 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::INT: - case ConfigInfo::INT64: + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64: ndbout << " (Non-negative Integer)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2456,7 +2456,7 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: ndbout << " (String)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2466,7 +2466,7 @@ void ConfigInfo::print(const Properties * section, } ndbout << endl; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -2743,29 +2743,29 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + ConfigInfo::CI_Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ - case ConfigInfo::INT: - case ConfigInfo::BOOL:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_BOOL:{ Uint32 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT64:{ Uint64 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put64(name, val); break; } - case ConfigInfo::STRING:{ + case ConfigInfo::CI_STRING:{ const char * val; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -3163,9 +3163,9 @@ transform(InitConfigFileParser::Context & ctx, PropertiesType oldType; require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); - ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); + ConfigInfo::CI_Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) - && (newType == ConfigInfo::INT || newType == ConfigInfo::INT64 || newType == ConfigInfo::BOOL))){ + && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s" "- [%s] starting at line: %d", @@ -3185,9 +3185,9 @@ transform(InitConfigFileParser::Context & ctx, return false; } - if(newType == ConfigInfo::INT || newType == ConfigInfo::BOOL){ + if(newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_BOOL){ require(dst.put(newName, (Uint32)newVal)); - } else if(newType == ConfigInfo::INT64) { + } else if(newType == ConfigInfo::CI_INT64) { require(dst.put64(newName, newVal)); } return true; @@ -3269,7 +3269,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ require(sec->get("Status", &status)); require(sec->get("SectionType", &typeVal)); - if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){ + if(id == KEY_INTERNAL || status == ConfigInfo::CI_INTERNAL){ ndbout_c("skipping section %s", ctx.fname); break; } @@ -3326,7 +3326,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ } static bool -sanity_checks(Vector§ions, +sanity_checks(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3349,7 +3349,7 @@ sanity_checks(Vector§ions, } static bool -add_node_connections(Vector§ions, +add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3401,7 +3401,7 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::ConfigRuleSection s; + ConfigInfo::CI_ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3418,7 +3418,7 @@ add_node_connections(Vector§ions, if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::ConfigRuleSection s; + ConfigInfo::CI_ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3435,7 +3435,7 @@ add_node_connections(Vector§ions, } -static bool add_server_ports(Vector§ions, +static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3475,7 +3475,7 @@ static bool add_server_ports(Vector§ions, } static bool -check_node_vs_replicas(Vector§ions, +check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3602,4 +3602,4 @@ check_node_vs_replicas(Vector§ions, return true; } -template class Vector; +template class Vector; diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index 512505cbd30..dff8b34bf4a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -38,11 +38,11 @@ static const char* UNDEFINED = 0; // Default value for undefined */ class ConfigInfo { public: - enum Type { BOOL, INT, INT64, STRING, SECTION }; - enum Status { USED, ///< Active - DEPRICATED, ///< Can be, but shouldn't - NOTIMPLEMENTED, ///< Is ignored. - INTERNAL ///< Not configurable by the user + enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION }; + enum Status { CI_USED, ///< Active + CI_DEPRICATED, ///< Can be, but shouldn't + CI_NOTIMPLEMENTED, ///< Is ignored. + CI_INTERNAL ///< Not configurable by the user }; /** diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 75ae539fc8b..06aa7365179 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -22,7 +22,7 @@ Name: Ndb.cpp ******************************************************************************/ #include -#include + #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 1fb1969b589..04446491cb6 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -107,7 +107,7 @@ Uint32 convertEndian(Uint32 Data); enum WaitSignalType { NO_WAIT = 0, WAIT_NODE_FAILURE = 1, // Node failure during wait - WAIT_TIMEOUT = 2, // Timeout during wait + WST_WAIT_TIMEOUT = 2, // Timeout during wait WAIT_TC_SEIZE = 3, WAIT_TC_RELEASE = 4, diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 12bede3aa3f..21407279f0b 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -29,7 +29,7 @@ class NdbObjectIdMap //: NdbLockable { public: - STATIC_CONST( InvalidId = ~0 ); + STATIC_CONST( InvalidId = ~(Uint32)0 ); NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10); ~NdbObjectIdMap(); -- cgit v1.2.1 From 6049821cd0db658d96122ba4c54b39c2b3de8d35 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:39:12 +0100 Subject: wl1744 - win compile fixes ndb/include/kernel/signaldata/RepImpl.hpp: more win-compile-fixes ndb/include/mgmapi/mgmapi.h: more win-compile-fixes ndb/include/ndbapi/NdbConnection.hpp: more win-compile-fixes ndb/src/common/util/Properties.cpp: more win-compile-fixes ndb/src/kernel/blocks/dbdict/Dbdict.cpp: more win-compile-fixes ndb/src/kernel/blocks/dbdict/Dbdict.hpp: more win-compile-fixes ndb/src/kernel/blocks/dbdih/Dbdih.hpp: more win-compile-fixes ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: more win-compile-fixes ndb/src/kernel/blocks/grep/Grep.cpp: more win-compile-fixes ndb/src/mgmsrv/Config.cpp: more win-compile-fixes ndb/src/mgmsrv/ConfigInfo.cpp: more win-compile-fixes ndb/src/mgmsrv/InitConfigFileParser.cpp: more win-compile-fixes ndb/src/ndbapi/NdbBlob.cpp: more win-compile-fixes ndb/src/ndbapi/NdbConnection.cpp: more win-compile-fixes ndb/src/ndbapi/NdbImpl.hpp: more win-compile-fixes ndb/src/ndbapi/NdbOperationExec.cpp: more win-compile-fixes ndb/test/ndbapi/testOperations.cpp: more win-compile-fixes sql/ha_ndbcluster.cc: more win-compile-fixes --- ndb/include/kernel/signaldata/RepImpl.hpp | 12 +++++------ ndb/include/mgmapi/mgmapi.h | 1 + ndb/include/ndbapi/NdbConnection.hpp | 2 +- ndb/src/common/util/Properties.cpp | 2 +- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 6 +++--- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 2 +- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 2 +- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 2 +- ndb/src/kernel/blocks/grep/Grep.cpp | 36 +++++++++++++++---------------- ndb/src/mgmsrv/Config.cpp | 16 +++++++------- ndb/src/mgmsrv/ConfigInfo.cpp | 34 ++++++++++++++--------------- ndb/src/mgmsrv/InitConfigFileParser.cpp | 16 +++++++------- ndb/src/ndbapi/NdbBlob.cpp | 6 +++--- ndb/src/ndbapi/NdbConnection.cpp | 4 ++-- ndb/src/ndbapi/NdbImpl.hpp | 2 +- ndb/src/ndbapi/NdbOperationExec.cpp | 6 +++--- ndb/test/ndbapi/testOperations.cpp | 2 +- sql/ha_ndbcluster.cc | 2 +- 18 files changed, 77 insertions(+), 76 deletions(-) diff --git a/ndb/include/kernel/signaldata/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp index affffe46f9c..0de1389a4a9 100644 --- a/ndb/include/kernel/signaldata/RepImpl.hpp +++ b/ndb/include/kernel/signaldata/RepImpl.hpp @@ -93,7 +93,7 @@ public: Uint32 subscriptionId; Uint32 subscriptionKey; Uint32 senderNodeId; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciReq @@ -151,7 +151,7 @@ public: Uint32 lastPSGCI; Uint32 firstSSGCI; Uint32 lastSSGCI; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciBufferReq { @@ -213,7 +213,7 @@ public: Uint32 lastSSGCI; Uint32 currentGCIBuffer; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferReq @@ -252,7 +252,7 @@ public: Uint32 nodeGrp; Uint32 tableId; Uint32 force; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferConf @@ -310,7 +310,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearPSGciBufferConf @@ -367,7 +367,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearSSGciBufferConf diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 582e8f1a3e6..ad98de1e322 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -49,6 +49,7 @@ * @{ */ +#include #include "mgmapi_config_parameters.h" #ifdef __cplusplus diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 7af5d27b922..5043cb0e26d 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -50,7 +50,7 @@ enum AbortOption { TryCommit = 0, ///< Missing explanation #endif AbortOnError = 0, ///< Abort transaction on failed operation - IgnoreError = 2 ///< Transaction continues on failed operation + AO_IgnoreError = 2 ///< Transaction continues on failed operation }; typedef AbortOption CommitType; diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 4443fd45bba..0edcda0e726 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -881,7 +881,7 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top, case PropertiesType_Properties: assert(0); } - if(res3 != true){ + if(!res3){ return false; } _items--; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 882557daae1..35ea878f94b 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -528,7 +528,7 @@ Dbdict::writeTableFile(Signal* signal, Uint32 tableId, Uint32 sz = tabInfoPtr.sz + ZPAGE_HEADER_SIZE; c_writeTableRecord.noOfPages = DIV(sz, ZSIZE_OF_PAGES_IN_WORDS); - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback = * callback; c_writeTableRecord.pageId = 0; @@ -647,7 +647,7 @@ void Dbdict::closeWriteTableConf(Signal* signal, case WriteTableRecord::WRITE_RESTART_FROM_OWN : ndbrequire(false); break; - case WriteTableRecord::CALLBACK: + case WriteTableRecord::TWR_CALLBACK: jam(); execute(signal, c_writeTableRecord.m_callback, 0); return; @@ -2381,7 +2381,7 @@ Dbdict::restartCreateTab_readTableConf(Signal* signal, ndbrequire(c_writeTableRecord.tableWriteState == WriteTableRecord::IDLE); c_writeTableRecord.noOfPages = c_readTableRecord.noOfPages; c_writeTableRecord.pageId = c_readTableRecord.pageId; - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback.m_callbackData = callbackData; c_writeTableRecord.m_callback.m_callbackFunction = safe_cast(&Dbdict::restartCreateTab_writeTableConf); diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 19c03a86e22..5a61c0739a6 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -639,7 +639,7 @@ private: WRITE_ADD_TABLE_SLAVE = 2, WRITE_RESTART_FROM_MASTER = 3, WRITE_RESTART_FROM_OWN = 4, - CALLBACK = 5 + TWR_CALLBACK = 5 }; TableWriteState tableWriteState; Callback m_callback; diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 14fa262f871..66acdf32059 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1469,7 +1469,7 @@ private: Uint32 c_blockCommitNo; bool getBlockCommit() const { - return c_blockCommit == true || cgckptflag == true; + return c_blockCommit || cgckptflag; } /** diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index d8b3ee10532..e7aec9e670c 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6366,7 +6366,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) *------------------------------------------------------------------*/ char buf[96]; buf[0] = 0; char buf2[96]; - snprintf(buf, sizeof(buf), "TC %d: %d ops:", + BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:", __LINE__, apiConnectptr.i); for(Uint32 i = 0; igetDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err; + GrepError::GE_Code err; Uint32 sendersBlockRef = signal->getSendersBlockRef(); if(sendersBlockRef == SUMA_REF) @@ -624,7 +624,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) { ndbrequire(false); /* Added since errorcode err unhandled * TODO: fix correct errorcode */ - err= GrepError::NO_ERROR; // remove compiler warning + err= GrepError::GE_NO_ERROR; // remove compiler warning } SubCoordinatorPtr subPtr; @@ -824,7 +824,7 @@ Grep::PSPart::execSUB_CREATE_REF(Signal* signal) jamEntry(); SubCreateRef * const ref = (SubCreateRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); sendRefToPSCoord(signal, *subPtr.p, err /*error*/); @@ -867,7 +867,7 @@ Grep::PSCoord::execGREP_CREATE_CONF(Signal* signal) GrepEvent::GrepPS_SubCreateConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -889,7 +889,7 @@ Grep::PSCoord::execGREP_CREATE_REF(Signal* signal) SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); } @@ -1046,7 +1046,7 @@ Grep::PSPart::execSUB_START_REF(Signal* signal) { SubStartRef * const ref = (SubStartRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1102,7 +1102,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartMetaConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); break; @@ -1118,7 +1118,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartDataConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -1145,7 +1145,7 @@ Grep::PSCoord::execGREP_START_REF(Signal* signal) jamEntry(); GrepStartRef * const ref = (GrepStartRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubCoordinatorPtr subPtr; @@ -1301,7 +1301,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal) jamEntry(); SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - /* GrepError::Code err = (GrepError::Code)ref->err;*/ + /* GrepError::GE_Code err = (GrepError::GE_Code)ref->err;*/ SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1342,7 +1342,7 @@ Grep::PSCoord::execGREP_REMOVE_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubRemoveConf, subId, subKey, - GrepError::NO_ERROR); + GrepError::GE_NO_ERROR); GrepSubRemoveConf * grepConf = (GrepSubRemoveConf *) conf; grepConf->subscriptionId = subId; @@ -1375,7 +1375,7 @@ Grep::PSCoord::execGREP_REMOVE_REF(Signal* signal) subPtr.p = c_runningSubscriptions.getPtr(subPtr.i); if(subData == subPtr.i) { - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); c_runningSubscriptions.release(subPtr); return; } @@ -1633,7 +1633,7 @@ Grep::PSPart::execSUB_SYNC_REF(Signal* signal) { jamEntry(); SubSyncRef * const ref = (SubSyncRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; @@ -1677,7 +1677,7 @@ Grep::PSCoord::execGREP_SYNC_CONF(Signal* signal) /* @todo Johan: Add firstGCI here. /Lars */ m_grep->sendEventRep(signal, EventReport::GrepSubscriptionInfo, event, subId, subKey, - (Uint32)GrepError::NO_ERROR, + (Uint32)GrepError::GE_NO_ERROR, lastGCI); /************************* @@ -1707,7 +1707,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { GrepSyncRef * const ref = (GrepSyncRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); sendRefToSS(signal, *subPtr.p, err /*error*/, part); @@ -1718,7 +1718,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { void Grep::PSCoord::sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { /** @@ -1843,7 +1843,7 @@ Grep::PSCoord::sendRefToSS(Signal * signal, void Grep::PSPart::sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { jam(); diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index f9c6a23f909..5ff9cbe04ad 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -53,27 +53,27 @@ Config::printAllNameValuePairs(NdbOut &out, if(!section->contains(n)) continue; - if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL) + if (m_info.getStatus(section, n) == ConfigInfo::CI_INTERNAL) continue; - if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_DEPRICATED) continue; - if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; out << n << ": "; switch (m_info.getType(section, n)) { - case ConfigInfo::INT: + case ConfigInfo::CI_INT: MGM_REQUIRE(prop->get(n, &int_value)); out << int_value; break; - case ConfigInfo::INT64: + case ConfigInfo::CI_INT64: MGM_REQUIRE(prop->get(n, &int_64)); out << int_64; break; - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: MGM_REQUIRE(prop->get(n, &int_value)); if (int_value) { out << "Y"; @@ -81,11 +81,11 @@ Config::printAllNameValuePairs(NdbOut &out, out << "N"; } break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(prop->get(n, &str_value)); out << str_value; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: out << "SECTION"; break; } diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 5f1f0cccb23..0a41db0e044 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2272,12 +2272,12 @@ ConfigInfo::ConfigInfo() * Getters ****************************************************************************/ inline void warning(const char * src, const char * arg){ - ndbout << "Illegal call to ConfigInfo::CI_" << src << "() - " << arg << endl; + ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; abort(); } const Properties * -ConfigInfo::CI_getInfo(const char * section) const { +ConfigInfo::getInfo(const char * section) const { const Properties * p; if(!m_info.get(section, &p)){ return 0; @@ -2391,23 +2391,23 @@ ConfigInfo::getType(const Properties * section, const char* fname) const { return (ConfigInfo::Type) getInfoInt(section, fname, "Type"); } -ConfigInfo::CI_Status -ConfigInfo::CI_getStatus(const Properties * section, const char* fname) const { - return (ConfigInfo::CI_Status) getInfoInt(section, fname, "Status"); +ConfigInfo::Status +ConfigInfo::getStatus(const Properties * section, const char* fname) const { + return (ConfigInfo::Status) getInfoInt(section, fname, "Status"); } /**************************************************************************** * Printers ****************************************************************************/ -void ConfigInfo::CI_print() const { +void ConfigInfo::print() const { Properties::Iterator it(&m_info); for (const char* n = it.first(); n != NULL; n = it.next()) { print(n); } } -void ConfigInfo::CI_print(const char* section) const { +void ConfigInfo::print(const char* section) const { ndbout << "****** " << section << " ******" << endl << endl; const Properties * sec = getInfo(section); Properties::Iterator it(sec); @@ -2420,7 +2420,7 @@ void ConfigInfo::CI_print(const char* section) const { } } -void ConfigInfo::CI_print(const Properties * section, +void ConfigInfo::print(const Properties * section, const char* parameter) const { ndbout << parameter; // ndbout << getDescription(section, parameter) << endl; @@ -2743,7 +2743,7 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::CI_Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ case ConfigInfo::CI_INT: @@ -3163,7 +3163,7 @@ transform(InitConfigFileParser::Context & ctx, PropertiesType oldType; require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); - ConfigInfo::CI_Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); + ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; @@ -3326,7 +3326,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ } static bool -sanity_checks(Vector§ions, +sanity_checks(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3349,7 +3349,7 @@ sanity_checks(Vector§ions, } static bool -add_node_connections(Vector§ions, +add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3401,7 +3401,7 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::CI_ConfigRuleSection s; + ConfigInfo::ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3418,7 +3418,7 @@ add_node_connections(Vector§ions, if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::CI_ConfigRuleSection s; + ConfigInfo::ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3435,7 +3435,7 @@ add_node_connections(Vector§ions, } -static bool add_server_ports(Vector§ions, +static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3475,7 +3475,7 @@ static bool add_server_ports(Vector§ions, } static bool -check_node_vs_replicas(Vector§ions, +check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3602,4 +3602,4 @@ check_node_vs_replicas(Vector§ions, return true; } -template class Vector; +template class Vector; diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index fdfe7823fc2..bf74f220b58 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -260,10 +260,10 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { return false; } ConfigInfo::Status status = m_info->getStatus(ctx.m_currentInfo, fname); - if (status == ConfigInfo::NOTIMPLEMENTED) { + if (status == ConfigInfo::CI_NOTIMPLEMENTED) { ctx.reportWarning("[%s] %s not yet implemented", ctx.fname, fname); } - if (status == ConfigInfo::DEPRICATED) { + if (status == ConfigInfo::CI_DEPRICATED) { const char * desc = m_info->getDescription(ctx.m_currentInfo, fname); if(desc){ ctx.reportWarning("[%s] %s is depricated, use %s instead", @@ -316,7 +316,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, const ConfigInfo::Type type = m_info->getType(ctx.m_currentInfo, fname); switch(type){ - case ConfigInfo::BOOL: { + case ConfigInfo::CI_BOOL: { bool value_bool; if (!convertStringToBool(value, value_bool)) { ctx.reportError("Illegal boolean value for parameter %s", fname); @@ -325,8 +325,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, MGM_REQUIRE(ctx.m_currentSection->put(pname, value_bool)); break; } - case ConfigInfo::INT: - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64:{ Uint64 value_int; if (!convertStringToUint64(value, value_int)) { ctx.reportError("Illegal integer value for parameter %s", fname); @@ -339,17 +339,17 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, m_info->getMax(ctx.m_currentInfo, fname)); return false; } - if(type == ConfigInfo::INT){ + if(type == ConfigInfo::CI_INT){ MGM_REQUIRE(ctx.m_currentSection->put(pname, (Uint32)value_int)); } else { MGM_REQUIRE(ctx.m_currentSection->put64(pname, value_int)); } break; } - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(ctx.m_currentSection->put(pname, value)); break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: abort(); } return true; diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 53c0a0e07f9..da0a4f73c3e 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -975,7 +975,7 @@ NdbBlob::deletePartsUnknown(Uint32 part) setErrorCode(tOp); return -1; } - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; n++; } DBG("deletePartsUnknown: executeNoBlobs [in] bat=" << bat); @@ -1223,7 +1223,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } if (isWriteOp()) { - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; } theHeadInlineReadOp = tOp; // execute immediately @@ -1269,7 +1269,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } if (isWriteOp()) { - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; } theHeadInlineReadOp = tOp; // execute immediately diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 4f6468eb4ae..7710a3354d3 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -1578,7 +1578,7 @@ from other transactions. (theLastExecOpInList->theCommitIndicator == 1)){ - if (m_abortOption == IgnoreError && theError.code != 0){ + if (m_abortOption == AO_IgnoreError && theError.code != 0){ /** * There's always a TCKEYCONF when using IgnoreError */ @@ -1832,7 +1832,7 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure) //decide the success of the whole transaction since a simple //operation is not really part of that transaction. //------------------------------------------------------------------------ - if (abortOption == IgnoreError){ + if (abortOption == AO_IgnoreError){ /** * There's always a TCKEYCONF when using IgnoreError */ diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 04446491cb6..baac0ee2846 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -146,7 +146,7 @@ NdbWaiter::wait(int waitTime) NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); } else { if (waitTime <= 0) { - m_state = WAIT_TIMEOUT; + m_state = WST_WAIT_TIMEOUT; break; } NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index cccc3b6409f..afa3609e11c 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -199,7 +199,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen); // A simple read is always ignore error - abortOption = tSimpleIndicator ? IgnoreError : abortOption; + abortOption = tSimpleIndicator ? AO_IgnoreError : abortOption; tcKeyReq->setAbortOption(tReqInfo, abortOption); Uint8 tDistrKeyIndicator = theDistrKeyIndicator; @@ -548,14 +548,14 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) theStatus = Finished; // blobs want this - if (m_abortOption != IgnoreError) + if (m_abortOption != AO_IgnoreError) theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theError.code = aSignal->readData(4); theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption); if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read - return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError); + return theNdbCon->OpCompleteFailure(ao, m_abortOption != AO_IgnoreError); /** * If TCKEYCONF has arrived diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index f31906dd737..949f08281a5 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -171,7 +171,7 @@ runTwoOperations(NDBT_Context* ctx, NDBT_Step* step){ // Insert, read CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(runOp(hugoOps, pNdb, op1, val1) == 0); - AbortOption oa = (res1 == 0) ? AbortOnError : IgnoreError; + AbortOption oa = (res1 == 0) ? AbortOnError : AO_IgnoreError; CHECK(hugoOps.execute_NoCommit(pNdb, oa) == res1); CHECK(checkVal(hugoOps, op1, val1, res1) == 0); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0d2b1676e3a..ba59772ca9b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -183,7 +183,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,IgnoreError,1); + return trans->execute(NoCommit, AO_IgnoreError,1); } /* -- cgit v1.2.1 From 63b4095284d7dfbf8ae7233ad9bcebe260ec92ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 14:18:49 +0100 Subject: wl1744 - nbd windoze port ndb/include/logger/SysLogHandler.hpp: win-port ndb/include/ndb_global.h: win-port ndb/include/portlib/PortDefs.h: win-port ndb/src/common/mgmcommon/NdbConfig.c: win-port ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: win-port ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: win-port ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: win-port ndb/src/kernel/main.cpp: win-port ndb/src/kernel/vm/Configuration.cpp: win-port ndb/src/kernel/vm/Emulator.cpp: win-port ndb/src/mgmsrv/CommandInterpreter.cpp: win-port ndb/src/mgmsrv/main.cpp: win-port scripts/make_win_src_distribution.sh: win-port --- ndb/include/logger/SysLogHandler.hpp | 4 ++- ndb/include/ndb_global.h | 45 +++++++++++++++---------------- ndb/include/portlib/PortDefs.h | 43 ----------------------------- ndb/src/common/mgmcommon/NdbConfig.c | 23 ++++++++-------- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 2 ++ ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 +-- ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 2 +- ndb/src/kernel/main.cpp | 20 +++++++++----- ndb/src/kernel/vm/Configuration.cpp | 8 +++--- ndb/src/kernel/vm/Emulator.cpp | 4 ++- ndb/src/mgmsrv/CommandInterpreter.cpp | 9 ++++--- ndb/src/mgmsrv/main.cpp | 4 ++- scripts/make_win_src_distribution.sh | 2 +- 13 files changed, 71 insertions(+), 99 deletions(-) diff --git a/ndb/include/logger/SysLogHandler.hpp b/ndb/include/logger/SysLogHandler.hpp index 4f13308d61b..0dfc1cb2d43 100644 --- a/ndb/include/logger/SysLogHandler.hpp +++ b/ndb/include/logger/SysLogHandler.hpp @@ -18,7 +18,9 @@ #define SYSLOGHANDLER_H #include "LogHandler.hpp" +#ifndef NDB_WIN32 #include +#endif /** * Logs messages to syslog. The default identity is 'NDB'. @@ -62,7 +64,7 @@ public: * @param pIdentity a syslog identity. * @param facility syslog facility, defaults to LOG_USER */ - SysLogHandler(const char* pIdentity, int facility = LOG_USER); + SysLogHandler(const char* pIdentity, int facility); /** * Destructor. diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index bdd4e503cc5..775d69b38e5 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -2,16 +2,23 @@ #ifndef NDBGLOBAL_H #define NDBGLOBAL_H -#include - -/** signal & SIG_PIPE */ -#include +#include #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #define NDB_WIN32 +#include +#include +#include + +#define PATH_MAX 256 +#define DIR_SEPARATOR "\\" + +#pragma warning(disable: 4503 4786) + #else #undef NDB_WIN32 -#endif +#include +#include #ifdef _AIX #undef _H_STRINGS @@ -47,23 +54,22 @@ #include #endif -#ifdef NDB_WIN32 -#include -#include - -#define DIR_SEPARATOR "\\" -#define PATH_MAX 256 +#define DIR_SEPARATOR "/" -#pragma warning(disable: 4503 4786) -#else +#endif -#define DIR_SEPARATOR "/" +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); #endif static const char table_name_separator = '/'; -#if defined(_AIX) || defined(NDB_VC98) +#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98) #define STATIC_CONST(x) enum { x } #else #define STATIC_CONST(x) static const Uint32 x @@ -84,15 +90,6 @@ extern int ndb_init(void); extern void ndb_end(int); #define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - #ifdef SCO #ifndef PATH_MAX diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h index b61bb627e65..a115c60cfe1 100644 --- a/ndb/include/portlib/PortDefs.h +++ b/ndb/include/portlib/PortDefs.h @@ -22,55 +22,12 @@ $Id: PortDefs.h,v 1.5 2003/10/07 07:59:59 mikael Exp $ */ -#ifdef NDB_WIN32 -#include - - -struct tms -{ - time_t tms_utime; /* user time */ - time_t tms_stime; /* system time */ - time_t tms_cutime; /* user time of children */ - time_t tms_cstime; /* system time of children */ -}; - -struct timespec -{ - long tv_sec; /* Seconds */ - long tv_nsec; /* Nanoseconds */ -}; - -#define strcasecmp(a,b) _strcmpi(a,b) - -/* Exports a WIN32 getopt function */ -extern int optind; -extern char *optarg; -int getopt(int, char **, char *opts); -#endif /* NDB_WIN32 */ #ifdef NDB_ALPHA #ifdef NDB_GCC /* only for NDB_ALPHA */ extern int gnuShouldNotUseRPCC(); #define RPCC() gnuShouldNotUseRPCC(); #else -#ifdef NDB_WIN32 -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - u_int64 __asm(char *, ...); - double __dasm(char *, ...); - float __fasm(char *, ...); - void _AcquireSpinLock(long *); - void _ReleaseSpinLock(long *); - int __ADD_ATOMIC_LONG2(void *, int); -#ifdef __cplusplus -}; -#endif /* __cplusplus */ -#pragma intrinsic (__asm, __dasm, __fasm) -#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock) -#pragma intrinsic(__ADD_ATOMIC_LONG2) -#endif /* NDB_WIN32 */ - #define RPCC() ((int)__asm(" rpcc v0;")) #define MB() __asm(" mb;"); #define WMB() __asm(" wmb;"); diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c index e92f8fa8392..15dbcff8a56 100644 --- a/ndb/src/common/mgmcommon/NdbConfig.c +++ b/ndb/src/common/mgmcommon/NdbConfig.c @@ -18,6 +18,7 @@ #include #include #include +#include static const char *datadir_path= 0; @@ -48,7 +49,7 @@ NdbConfig_AllocHomePath(int _len) const char *path= NdbConfig_get_path(&path_len); int len= _len+path_len; char *buf= NdbMem_Allocate(len); - snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); + basestring_snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); return buf; } @@ -67,7 +68,7 @@ NdbConfig_NdbCfgName(int with_ndb_home){ len= strlen(buf); } else buf= NdbMem_Allocate(128); - snprintf(buf+len, 128, "Ndb.cfg"); + basestring_snprintf(buf+len, 128, "Ndb.cfg"); return buf; } @@ -77,9 +78,9 @@ char *get_prefix_buf(int len, int node_id) char tmp_buf[sizeof("ndb_pid#########")+1]; char *buf; if (node_id > 0) - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); else - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); tmp_buf[sizeof(tmp_buf)-1]= 0; buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf)); @@ -91,7 +92,7 @@ char* NdbConfig_ErrorFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_error.log"); + basestring_snprintf(buf+len, 128, "_error.log"); return buf; } @@ -99,7 +100,7 @@ char* NdbConfig_ClusterLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_cluster.log"); + basestring_snprintf(buf+len, 128, "_cluster.log"); return buf; } @@ -107,7 +108,7 @@ char* NdbConfig_SignalLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_signal.log"); + basestring_snprintf(buf+len, 128, "_signal.log"); return buf; } @@ -115,7 +116,7 @@ char* NdbConfig_TraceFileName(int node_id, int file_no){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.%u", file_no); + basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no); return buf; } @@ -123,7 +124,7 @@ char* NdbConfig_NextTraceFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.next"); + basestring_snprintf(buf+len, 128, "_trace.log.next"); return buf; } @@ -131,7 +132,7 @@ char* NdbConfig_PidFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, ".pid"); + basestring_snprintf(buf+len, 128, ".pid"); return buf; } @@ -139,6 +140,6 @@ char* NdbConfig_StdoutFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_out.log"); + basestring_snprintf(buf+len, 128, "_out.log"); return buf; } diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 234d832655c..c4127ba9283 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -150,6 +150,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) ndbrequire(false); } +#ifndef NDB_WIN32 if(ERROR_INSERTED(9996)){ simulate_error_during_shutdown= SIGSEGV; ndbrequire(false); @@ -159,6 +160,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) simulate_error_during_shutdown= SIGSEGV; kill(getpid(), SIGABRT); } +#endif }//execNDB_TAMPER() void Cmvmi::execSET_LOGLEVELORD(Signal* signal) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 76aa745c3e0..9fd69378359 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -12944,7 +12944,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) Uint32 nodeOrder[MAX_REPLICAS]; const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder); char buf[100]; - snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); + BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); for(Uint32 k = 0; k < noOfReplicas; k++){ char tmp[100]; BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); @@ -13155,7 +13155,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) getFragstore(tabPtr.p, fid, fragPtr); char buf[100], buf2[100]; - snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", + BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", fid, fragPtr.p->noLcpReplicas); Uint32 num=0; diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 56e3d3abbed..21b0a2cb54f 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal) jam(); report(request, signal); theRequestPool->put(request); - return &request; + return true; } return false; } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 926647838c9..2901320633c 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -77,11 +77,13 @@ int main(int argc, char** argv) } { // Do configuration - signal(SIGPIPE, SIG_IGN); +#ifndef NDB_WIN32 + signal(SIGPIPE, SIG_IGN); +#endif theConfig->fetch_configuration(local_config); } - - chdir(NdbConfig_get_path(0)); + + my_setwd(NdbConfig_get_path(0), MYF(0)); if (theConfig->getDaemonMode()) { // Become a daemon @@ -95,6 +97,7 @@ int main(int argc, char** argv) } } +#ifndef NDB_WIN32 for(pid_t child = fork(); child != 0; child = fork()){ /** * Parent @@ -145,6 +148,9 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); +#else + g_eventLogger.info("Ndb started"); +#endif theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); @@ -276,7 +282,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){ void catchsigs(bool ignore){ -#if ! defined NDB_SOFTOSE && !defined NDB_OSE +#if !defined NDB_WIN32 && !defined NDB_SOFTOSE && !defined NDB_OSE static const int signals_shutdown[] = { #ifdef SIGBREAK @@ -318,7 +324,6 @@ catchsigs(bool ignore){ SIGTRAP #endif }; -#endif static const int signals_ignore[] = { SIGPIPE @@ -331,6 +336,7 @@ catchsigs(bool ignore){ handler_register(signals_error[i], handler_error, ignore); for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++) handler_register(signals_ignore[i], SIG_IGN, ignore); +#endif } extern "C" @@ -349,8 +355,10 @@ handler_error(int signum){ if (thread_id != 0 && thread_id == my_thread_id()) { // Shutdown thread received signal - signal(signum, SIG_DFL); +#ifndef NDB_WIN32 + signal(signum, SIG_DFL); kill(getpid(), signum); +#endif while(true) NdbSleep_MilliSleep(10); } diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 795670a1322..05a5aaf1c76 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -278,13 +278,13 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, memset(buf2, 0,sizeof(buf2)); #ifdef NDB_WIN32 char* szFilePart; - if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) - || (::GetFileAttributes(alloc_path)&FILE_ATTRIBUTE_READONLY)) + if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) || + (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)); #else - if((::realpath(path, buf2) == NULL)|| + if((::realpath(path, buf2) == NULL)|| (::access(buf2, W_OK) != 0)) #endif - { + { ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); } diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index a5897cd4064..adf3c438945 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -179,12 +179,14 @@ NdbShutdown(NdbShutdownType type, exit(-1); #endif } - + +#ifndef NDB_WIN32 if (simulate_error_during_shutdown) { kill(getpid(), simulate_error_during_shutdown); while(true) NdbSleep_MilliSleep(10); } +#endif globalEmulatorData.theWatchDog->doStop(); diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 2a054a01f1e..c6ea9f662bb 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -28,7 +28,7 @@ #include "ConfigInfo.hpp" #include - +#include static const char* helpTexts[] = { "HELP Print help text", @@ -492,7 +492,7 @@ void CommandInterpreter::executeClusterLog(char* parameters) { noArgs = true; } while (item != NULL) { - snprintf(name, 12, item); + BaseString::snprintf(name, 12, item); if (strcmp(item, "ALL") == 0) { severity = 7; @@ -740,9 +740,10 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, char * tmpString = strdup(parameters); char * tmpPtr = 0; char * item = strtok_r(tmpString, " ", &tmpPtr); + int error; while(item != NULL){ - if (0x0 <= strtoll(item, NULL, 0) && strtoll(item, NULL, 0) <= 0xffffffff) { - pars[no] = strtoll(item, NULL, 0); + if (0x0 <= my_strtoll10(item, NULL, &error) && my_strtoll10(item, NULL, &error) <= 0xffffffff) { + pars[no] = my_strtoll10(item, NULL, &error); } else { ndbout << "Illegal value in argument to signal." << endl << "(Value must be between 0 and 0xffffffff.)" diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 15767e4766d..5712ade8ea1 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -231,7 +231,7 @@ int main(int argc, char** argv) local_config, glob.cluster_config); - chdir(NdbConfig_get_path(0)); + my_setwd(NdbConfig_get_path(0), MYF(0)); glob.cluster_config = 0; glob.localNodeId= glob.mgmObject->getOwnNodeId(); @@ -294,7 +294,9 @@ int main(int argc, char** argv) } } +#ifndef NDB_WIN32 signal(SIGPIPE, SIG_IGN); +#endif { BaseString error_string; if(!glob.mgmObject->start(error_string)){ diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index d9144ab3dce..62a9fb54b59 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -246,7 +246,7 @@ done # # Create project files for ndb # -make -C ndb windoze +make -C $SOURCE/ndb windoze # # Input directories to be copied recursively -- cgit v1.2.1 From c3a066e4035a16a666e71a55f47c14c29649e580 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 18:16:58 +0300 Subject: Fix for bug #6077: Problem with make test from 4.1.7 and bk portability fix(UnixWare) mysql-test/r/ps_1general.result: portability fix(UnixWare) mysql-test/t/key_cache.test: portability fix(UnixWare) mysql-test/t/ps_1general.test: portability fix(UnixWare) sql/field.cc: portability fix(UnixWare) --- mysql-test/r/ps_1general.result | 4 ++-- mysql-test/t/key_cache.test | 6 +++--- mysql-test/t/ps_1general.test | 4 ++-- sql/field.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index ccf2945d488..8cf03653b4d 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -272,11 +272,11 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL +t2 MyISAM 9 Fixed 0 0 # # # 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 9 Dynamic 2 220 # # # 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 9d3125efa61..3b0dcfb9198 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -71,7 +71,7 @@ show status like 'key_blocks_used'; # Following results differs on 64 and 32 bit systems because of different # pointer sizes, which takes up different amount of space in key cache ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -84,7 +84,7 @@ update t1 set p=2 where p=1; update t2 set i=2 where i=1; show status like 'key_blocks_used'; ---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED +--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED 1820 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; cache index t1 key (`primary`) in keycache1; @@ -146,7 +146,7 @@ cache index t1,t2 in default; drop table t1,t2,t3; show status like 'key_blocks_used'; ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; # Cleanup diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 9e4acc2bf24..dd1036f683d 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -289,13 +289,13 @@ prepare stmt4 from ' show index from t2 from test '; execute stmt4; prepare stmt4 from ' show table status from test like ''t2%'' '; # egalize date and time values ---replace_column 12 # 13 # 14 # +--replace_column 7 # 8 # 9 # 12 # 13 # 14 # # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values ---replace_column 12 # 13 # 14 # +--replace_column 7 # 8 # 9 # 12 # 13 # 14 # # Bug#4288 execute stmt4; prepare stmt4 from ' show status like ''Threads_running'' '; diff --git a/sql/field.cc b/sql/field.cc index deb38048d42..569d11eb758 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2145,7 +2145,7 @@ int Field_longlong::store(double nr) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (nr >= (double) LONGLONG_MAX) + else if (nr >= (double) (ulonglong) LONGLONG_MAX) { res=(longlong) LONGLONG_MAX; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); -- cgit v1.2.1 From fe2a47b24061b80f9e43c418294184abdcf7ab06 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 21:31:41 +0100 Subject: wl1744 - ndb windoze port ndb/include/ndb_types.h: ndb windoze ndb/src/common/util/version.c: ndb windoze ndb/src/mgmsrv/ConfigInfo.cpp: ndb windoze ndb/src/ndbapi/ndberror.c: ndb windoze --- ndb/include/ndb_types.h | 8 +++++--- ndb/src/common/util/version.c | 5 +++-- ndb/src/mgmsrv/ConfigInfo.cpp | 1 + ndb/src/ndbapi/ndberror.c | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 64b3f517934..b5db23946f0 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -40,15 +40,17 @@ typedef __SIZE_TYPE__ UintPtr; #ifdef HAVE_INTTYPES_H #include #endif -typedef uintptr_t UintPtr; -#endif - #if defined(WIN32) || defined(NDB_WIN32) typedef unsigned __int64 Uint64; typedef signed __int64 Int64; +typedef Uint32 UintPtr; +typedef UintPtr ssize_t; #else typedef unsigned long long Uint64; typedef signed long long Int64; +typedef uintptr_t UintPtr; +#endif #endif + #endif diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 82acd949c46..dc549457d14 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -17,6 +17,7 @@ #include #include #include +#include Uint32 getMajor(Uint32 version) { return (version >> 16) & 0xFF; @@ -38,14 +39,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) { const char * getVersionString(Uint32 version, const char * status) { char buff[100]; if (status && status[0] != 0) - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d (%s)", getMajor(version), getMinor(version), getBuild(version), status); else - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d", getMajor(version), getMinor(version), diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 0a41db0e044..16721b560f0 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -21,6 +21,7 @@ #include #include #include "InitConfigFileParser.hpp" +#include #define MAX_LINE_LENGTH 255 #define KEY_INTERNAL 0 diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 17a80082023..d293df0303b 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,6 +17,7 @@ #include #include +#include typedef struct ErrorBundle { int code; @@ -594,7 +595,7 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ndberror_update(&error); len = - snprintf(str, size-1, "%s: %s: %s", error.message, + basestring_snprintf(str, size-1, "%s: %s: %s", error.message, ndberror_status_message(error.status), ndberror_classification_message(error.classification)); str[size-1]= '\0'; -- cgit v1.2.1 From 78f9a1fc1cae1bb6c67a4645cc2ac6003a8070a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 21:43:12 +0100 Subject: wl1744 - ndb windows port move versing handling into ndb_version.h.in (from config.h) configure.in: generate ndb/include/ndb_version.h during configure ndb/Makefile.am: extra target for just creating dsp files --- configure.in | 1 + ndb/Makefile.am | 3 +++ ndb/include/ndb_version.h.in | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 ndb/include/ndb_version.h.in diff --git a/configure.in b/configure.in index cd2daf10690..8f5bbaf0c19 100644 --- a/configure.in +++ b/configure.in @@ -3147,6 +3147,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl + ndb/include/ndb_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl zlib/Makefile dnl diff --git a/ndb/Makefile.am b/ndb/Makefile.am index abff73359fa..e4f21ac8040 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -22,3 +22,6 @@ windoze: for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done windoze-dsp: + +all-windoze-dsp: windoze + tar cvfz ndb-win-dsp.tar.gz `find . -name '*.dsp'` diff --git a/ndb/include/ndb_version.h.in b/ndb/include/ndb_version.h.in new file mode 100644 index 00000000000..d7f43eae40a --- /dev/null +++ b/ndb/include/ndb_version.h.in @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_VERSION_H +#define NDB_VERSION_H + +#include +#include + +/* NDB build version */ +#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@ + +/* NDB major version */ +#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@ + +/* NDB minor version */ +#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@ + +/* NDB status version */ +#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@" + + +#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) + +#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) + +#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) + +#define NDB_VERSION ndbGetOwnVersion() + +/** + * Version id + * + * Used by transporter and when communicating with + * managment server + */ +/*#define NDB_VERSION_ID 0*/ + +#endif + -- cgit v1.2.1 From d55be176d78a9cf853a92280b577fd2d33869bfb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 08:15:52 +0100 Subject: wl1744- ndb windows move ports into ndb_global BitKeeper/deleted/.del-ndb_version.h~c759dd144f698ea: Delete: ndb/include/ndb_version.h BitKeeper/deleted/.del-ndb_global.h~c4762a8c8f5136c6: Delete: ndb/include/ndb_global.h configure.in: also generate ndb_global ndb/include/ndb_types.h: fix ndb/src/common/mgmcommon/Makefile.am: put port into ndb_global ndb/src/mgmsrv/ConfigInfo.cpp: win ndb/src/mgmsrv/Makefile.am: moved ports into ndb_global ndb/src/ndbapi/ndberror.c: use my_snprintf --- configure.in | 2 +- ndb/include/ndb_global.h | 105 --------------------------------- ndb/include/ndb_global.h.in | 109 +++++++++++++++++++++++++++++++++++ ndb/include/ndb_types.h | 10 +++- ndb/include/ndb_version.h | 42 -------------- ndb/src/common/mgmcommon/Makefile.am | 2 - ndb/src/mgmsrv/ConfigInfo.cpp | 4 +- ndb/src/mgmsrv/Makefile.am | 4 +- ndb/src/ndbapi/ndberror.c | 9 ++- 9 files changed, 124 insertions(+), 163 deletions(-) delete mode 100644 ndb/include/ndb_global.h create mode 100644 ndb/include/ndb_global.h.in delete mode 100644 ndb/include/ndb_version.h diff --git a/configure.in b/configure.in index 4d7640f206f..55cd7edfca8 100644 --- a/configure.in +++ b/configure.in @@ -3132,6 +3132,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/test/ndbapi/bank/Makefile dnl ndb/test/tools/Makefile dnl ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl + ndb/include/ndb_version.h ndb/include/ndb_global.h dnl ) fi @@ -3153,7 +3154,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl - ndb/include/ndb_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl zlib/Makefile dnl diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h deleted file mode 100644 index 775d69b38e5..00000000000 --- a/ndb/include/ndb_global.h +++ /dev/null @@ -1,105 +0,0 @@ - -#ifndef NDBGLOBAL_H -#define NDBGLOBAL_H - -#include - -#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) -#define NDB_WIN32 -#include -#include -#include - -#define PATH_MAX 256 -#define DIR_SEPARATOR "\\" - -#pragma warning(disable: 4503 4786) - -#else -#undef NDB_WIN32 -#include -#include - -#ifdef _AIX -#undef _H_STRINGS -#endif -#include -#include -#include -#include -#ifdef HAVE_STDARG_H -#include -#endif -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#include -#ifdef HAVE_SYS_STAT_H - #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) - #undef _INCLUDE_AES_SOURCE - #include - #define _INCLUDE_AES_SOURCE - #else - #include - #endif -#endif -#include -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif - -#define DIR_SEPARATOR "/" - -#endif - -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - -static const char table_name_separator = '/'; - -#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98) -#define STATIC_CONST(x) enum { x } -#else -#define STATIC_CONST(x) static const Uint32 x -#endif - -#ifdef __cplusplus -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* call in main() - does not return on error */ -extern int ndb_init(void); -extern void ndb_end(int); -#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} - -#ifdef SCO - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -#endif /* SCO */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in new file mode 100644 index 00000000000..af7f9383461 --- /dev/null +++ b/ndb/include/ndb_global.h.in @@ -0,0 +1,109 @@ + +#ifndef NDBGLOBAL_H +#define NDBGLOBAL_H + +#include + +#define NDB_PORT "@ndb_port@" +#define NDB_TCP_BASE_PORT "@ndb_port_base@" + +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) +#define NDB_WIN32 +#include +#include +#include + +#define PATH_MAX 256 +#define DIR_SEPARATOR "\\" +#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" + +#pragma warning(disable: 4503 4786) + +#else +#undef NDB_WIN32 +#include +#include + +#ifdef _AIX +#undef _H_STRINGS +#endif +#include +#include +#include +#include +#ifdef HAVE_STDARG_H +#include +#endif +#ifdef TIME_WITH_SYS_TIME +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#include +#ifdef HAVE_SYS_STAT_H + #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) + #undef _INCLUDE_AES_SOURCE + #include + #define _INCLUDE_AES_SOURCE + #else + #include + #endif +#endif +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#define DIR_SEPARATOR "/" + +#endif + +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif + +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +#endif + +static const char table_name_separator = '/'; + +#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98) +#define STATIC_CONST(x) enum { x } +#else +#define STATIC_CONST(x) static const Uint32 x +#endif + +#ifdef __cplusplus +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* call in main() - does not return on error */ +extern int ndb_init(void); +extern void ndb_end(int); +#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} + +#ifdef SCO + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +#endif /* SCO */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index b5db23946f0..0d603cc2ab3 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -40,16 +40,20 @@ typedef __SIZE_TYPE__ UintPtr; #ifdef HAVE_INTTYPES_H #include #endif +#if defined(WIN32) || defined(NDB_WIN32) +typedef Uint32 UintPtr; +#else +typedef uintptr_t UintPtr; +#endif +#endif + #if defined(WIN32) || defined(NDB_WIN32) typedef unsigned __int64 Uint64; typedef signed __int64 Int64; -typedef Uint32 UintPtr; typedef UintPtr ssize_t; #else typedef unsigned long long Uint64; typedef signed long long Int64; -typedef uintptr_t UintPtr; -#endif #endif diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h deleted file mode 100644 index 56362020ebf..00000000000 --- a/ndb/include/ndb_version.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NDB_VERSION_H -#define NDB_VERSION_H - -#include -#include - -#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) - -#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) - -#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) - -#define NDB_VERSION_TAG_STRING "$Name: $" - -#define NDB_VERSION ndbGetOwnVersion() - -/** - * Version id - * - * Used by transporter and when communicating with - * managment server - */ -/*#define NDB_VERSION_ID 0*/ - -#endif - diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index 995fda3654d..ebb89f8a251 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -7,8 +7,6 @@ libmgmsrvcommon_la_SOURCES = \ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv -DEFS_LOC = -DNDB_PORT="\"@ndb_port@\"" - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index e88e487b689..41280b907c4 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3011,7 +3011,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) && !ctx.m_systemDefaults->get("PortNumber", &base)) { - base= strtoll(NDB_BASE_PORT,0,0); + base= strtoll(NDB_TCP_BASE_PORT,0,0); // ctx.reportError("Cannot retrieve base port number"); // return false; } @@ -3443,7 +3443,7 @@ static bool add_server_ports(Vector§ions, #if 0 Properties * props= ctx.m_config; Properties computers(true); - Uint32 port_base = NDB_BASE_PORT; + Uint32 port_base = NDB_TCP_BASE_PORT; Uint32 nNodes; ctx.m_userProperties.get("NoOfNodes", &nNodes); diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index a6000c24d97..4b66e3cc7bc 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -32,9 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ - -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \ - -DNDB_PORT="\"@ndb_port@\"" \ - -DNDB_BASE_PORT="\"@ndb_port_base@\"" + -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index d293df0303b..750ed720f78 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,7 +17,6 @@ #include #include -#include typedef struct ErrorBundle { int code; @@ -595,10 +594,10 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ndberror_update(&error); len = - basestring_snprintf(str, size-1, "%s: %s: %s", error.message, - ndberror_status_message(error.status), - ndberror_classification_message(error.classification)); + my_snprintf(str, size-1, "%s: %s: %s", error.message, + ndberror_status_message(error.status), + ndberror_classification_message(error.classification)); str[size-1]= '\0'; - + return len; } -- cgit v1.2.1 From 3a98b7831826418d656f8dc4d8f9ca2592e51c36 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 20:12:12 +0100 Subject: Result of WL#2225 Extend the test cases for PS + develop a basic test routine for PS The basic test routine mysql-test/include/patchwork-check.inc Test cases for the the basic test routine mysql-test/t/tool_test.test mysql-test/r/tool_test.result Test cases for prepared statements with functions mysql-test/t/ps_12func.test mysql-test/r/ps_12func.result Some statements are set to comment, because of open bugs. Fresh MySQL V4.1 and V5.0 souces produce in the moment (~11-Nov-2004) the same result files. --- mysql-test/include/patchwork-check.inc | 330 +++ mysql-test/r/ps_12func.result | 4748 ++++++++++++++++++++++++++++++++ mysql-test/r/tool_test.result | 223 ++ mysql-test/t/ps_12func.test | 867 ++++++ mysql-test/t/tool_test.test | 105 + 5 files changed, 6273 insertions(+) create mode 100644 mysql-test/include/patchwork-check.inc create mode 100644 mysql-test/r/ps_12func.result create mode 100644 mysql-test/r/tool_test.result create mode 100644 mysql-test/t/ps_12func.test create mode 100644 mysql-test/t/tool_test.test diff --git a/mysql-test/include/patchwork-check.inc b/mysql-test/include/patchwork-check.inc new file mode 100644 index 00000000000..b11db7fa50d --- /dev/null +++ b/mysql-test/include/patchwork-check.inc @@ -0,0 +1,330 @@ +###################### patchwork-check.inc ############################# +# # +# Basic routine for the generation and execution of prepared and non # +# prepared SQL statements. # +# # +# Purpose: Simplify the check of complex statements with different # +# sets of parameters (data type, value) # +# # +######################################################################## + +# +# NOTE: PLEASE BE VERY CAREFULL, WHEN CHANGING OR USING ;-) THIS ROUTINE. +# +# Please be aware, that this routine +# - will be sourced by several test case files stored within the +# directory 'mysql-test/t'. So every change here will affect +# several test cases. +# - does not check its own prequisites +# - modifies the content and the data type of the +# uservariables @var_1 ... @var_ +# +# Please preserve the '___' naming of the the auxiliary variables. +# These names should avoid that a test case writer accidently creates a +# variable with the same name. +# + +# naming conventions: +# stmt_c_ --> statement with constants like "select 1 " +# stmt_uv_ --> statement with uservariables like "select @var_1 " +# stmt_ph_ --> prepared statement with placeholders like "select ? " + + +# +# Explanation how to use this routine by an example: +# +# Content of the caller script: +# .... +# set @stmt_part1= 'SELECT f1 + ' +# set @stmt_part2= ' from t1 where f2= ' ; +# set @stmt_part3= '' ; +# set @string_1= "1"; set @type_1= "BIGINT"; +# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; +# set @max_var_number= 2; +# --source include/patchwork-check.inc +# +# # The next testing rounds could start with +# set @string_1= "NULL"; set @type_1= "BIGINT"; +# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; +# --source include/patchwork-check.inc +# +# set @string_1= "1"; set @type_1= "BIGINT"; +# set @string_2= "NULL"; set @type_2= "LONGTEXT"; +# --source include/patchwork-check.inc +# +# Statements and uservariables to be produced and executed by this routine +# 1. Statements with constants +# 1.1 stmt1= SELECT f1 + 1 from t1 where f2= -2.3E-4 ; +# 1.2 stmt1 as prepared statement +# 2. Statements with uservariables +# @var_n should be of data type @type_n (if possible) and have the +# content @string_n . +# 2.1 stmt2= SELECT f1 + @var_1 from t1 where f2= @var_2 +# 2.2 stmt2 as prepared statement +# 3. prepared statement with placeholders +# prepare stmt1 from 'SELECT f1 + ? from t1 where f2= ?' +# execute stmt1 using @var_1, @var_2 +# +# Every prepared statement variant of the "patchwork" is 3 times executed. +# +# +# Please have also also a look into +# - t/tooltest.test , which checks or +# - t/ps_12func.test , which contains test cases using +# this routine. +# + + +############## +# +# Prerequisites: +# +# The caller script must set the following uservariables: +# +# The statement pieces: @stmt_part1, @stmt_part2, ... , @stmt_part +# +# The parameter values: @string_1, ... , @string_ +# The parameter value should fit to the data type ! +# UPPER(@stmt_part1) = 'NULL' will cause (SQL) NULL as content. +# +# The parameter data types: @type_1, ... , @type_ +# valid types are: BIGINT, DOUBLE, LONGTEXT, LONGBLOB +# +# Attention: All other type assignments will lead to a +# uservariable of type LONGTEXT !! +# +# The number of parameter values must be published via +# set @max_var_number= ; +# +# Attention: This routine does not perform any check of the content +# of these variables. +# + +############## +# +# How is intended uservariable generated: +# +# Step 1: generate a uservariable of the intended type +# +# UPPER(@type_) statement +# BIGINT set @var_= 0 +# DOUBLE' set @var_idx_= 0.0 +# LONGTEXT' set @var_= "INIT" +# LONGBLOB' set @var_= CAST("INIT" AS BINARY) +# set @var_= "INIT" +# +# Step 2: assign the value to the uservariable +# +# IF ( UPPER(@string_) != 'NULL') +# UPPER(@type_) +# BIGINT set @var_= CEIL(@string_) +# DOUBLE set @var_= @string_ + 0.0 +# LONGTEXT set @var_= @string_ +# LONGBLOB set @var_= CAST(@string_ AS BINARY) +# set @var_= @string_ +# ELSE +# set @var_= NULL +# + + +# +# How to debug this routine if something goes wrong: +# +# 1. Put the line '--disable_abort_on_error' into the caller script +# --> There will be no abort of mysqltest, if a statement fails. +# You will get a protocol (in most cases). +# 2. Put the line 'set $__debug_= 1 ;' into the caller script . +# The next call of patchwork-check.inc will print +# the type and content of generated uservariables and statements. +# 3. disable the '--disable_query_log' option some lines below +# +# and please be patient towards this routine, it is far away from being perfect. +# + + +# Suppress the majority of the huge output concerning the statement and +# uservariable generation +--disable_query_log + +let $__idx_= 1 ; +eval set @__stmt_c_= @stmt_part_$__idx_ ; +# If the number of variables is greater 0, we need also +# - the statement with uservariables (stmt_uv) and +# - the prepared statement with placeholders (stmt_ph) and +# - the execute for the prepared statement with placeholders (execute_stmt_ph) +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + eval set @__stmt_uv_= @stmt_part_$__idx_ ; + eval set @__stmt_ph_= @stmt_part_$__idx_ ; + set @__execute_stmt_ph= 'execute __stmt_ph_ using ' ; + let $__num_= `select @max_var_number`; + while ($__num_) + { + ##### Generate the Uservariables + eval set @__my_init_= CASE UPPER(@type_$__idx_) + WHEN 'BIGINT' THEN 'set @var_$__idx_= 0' + WHEN 'DOUBLE' THEN 'set @var_$__idx_= 0.0' + WHEN 'LONGTEXT' THEN 'set @var_$__idx_= "INIT"' + WHEN 'LONGBLOB' THEN 'set @var_$__idx_= CAST("INIT" AS BINARY)' + ELSE 'set @var_$__idx_= "INIT"' END; + # select @__my_init_ as "@__my_init_ is: " ; + let $__my_init_= `select @__my_init_`; + eval $__my_init_ ; + + eval set @__my_init_= CASE UPPER(@type_$__idx_) + WHEN 'BIGINT' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CEIL(@string_$__idx_),NULL)" + WHEN 'DOUBLE' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_ + 0.0,NULL)" + WHEN 'LONGTEXT' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" + WHEN 'LONGBLOB' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CAST(@string_$__idx_ AS BINARY),NULL)" + ELSE + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" END; + let $__my_init_= `select @__my_init_`; + eval $__my_init_ ; + + ##### concat the variable to the statements + ## with Constants + # 1. replace ugly NULLs like 'NuLl' with 'NULL' for better readability + # 2. Strings to be inserted into the statement must be quoted + eval set @__stmt_c_= concat( + @__stmt_c_, + IF(UPPER(@string_$__idx_)='NULL','NULL', + IF(UPPER(@type_$__idx_)='LONGTEXT' or UPPER(@type_$__idx_)='LONGBLOB', + concat('''',@string_$__idx_,''''), @string_$__idx_ + ))) ; + ## with Uservariables + eval set @__stmt_uv_= concat(@__stmt_uv_, '@var_$__idx_') ; + ## with placeholders + eval set @__stmt_ph_= concat(@__stmt_ph_, '?') ; + + ##### complete the execute for the prepared statement with placeholders + eval set @__execute_stmt_ph= concat(@__execute_stmt_ph, '@var_$__idx_,') ; + + inc $__idx_ ; + ##### concat the next part of the statement to the statements + eval set @__stmt_c_= concat(@__stmt_c_, @stmt_part_$__idx_ ); + eval set @__stmt_uv_= concat(@__stmt_uv_, @stmt_part_$__idx_ ); + eval set @__stmt_ph_= concat(@__stmt_ph_, @stmt_part_$__idx_ ); + + dec $__num_ ; + } + # @__execute_stmt_ph contains a trailing ',' which must be cut away + set @__execute_stmt_ph= substr(@__execute_stmt_ph,1,length(@__execute_stmt_ph) - 1); + dec $__with_var_ ; +} + +while ($__debug_) +{ + ### Print debug informations for patchwork with variables + let $__with_var_= `select @max_var_number > 0`; + while ($__with_var_) + { + ### Print out the content of the statement variables + eval select "--------------------------------------" + as "the content of the statement variables" + union select concat('@__stmt_c_ is: ',@__stmt_c_) + union select concat('@__stmt_uv_ is: ',@__stmt_uv_) + union select concat('@__stmt_ph_ is: ',@__stmt_ph_) + union select concat('@__execute_stmt_ph is: ',@__execute_stmt_ph); + + + ### Print out the content of the uservariables + select '--------------------------------------' + as "the content of the parameter variables"; + set @__parameter_= 'select '; + let $__num_= `select @max_var_number`; + let $__idx_= 1 ; + while ($__num_) + { + eval select @type_$__idx_ as type, + @string_$__idx_ as string, + @var_$__idx_ as uservariable ; + eval set @__parameter_= concat(@__parameter_, '@var_$__idx_ ,'); + inc $__idx_ ; + + dec $__num_ ; + } + # @__parameter_ contains a trailing ',' which must be cut away + set @__parameter_= substr(@__parameter_,1,length(@__parameter_) - 1); + let $__aux_= `select @__parameter_` ; + eval $__aux_ ; + + + ### Create a table from the uservariables and print out the column types + let $__aux_= `select concat('CREATE TABLE t9 AS ',@__parameter_)` ; + --disable_warnings + drop table if exists t9; + --enable_warnings + eval $__aux_ ; + show create table t9; + drop table t9; + + dec $__with_var_ ; + } + ### Print debug informations for patchwork without variables + ### stmt_uv, stmt_ph, execute_stmt_ph and uservariables do NOT exist + let $__with_var_= `select @max_var_number = 0`; + while ($__with_var_) + { + ### Print out the content of the statement variables + eval select "--------------------------------------" + as "the content of the statement variable" + union select concat('@__stmt_c_ is: ',@__stmt_c_) ; + + dec $__with_var_ ; + } + + + dec $__debug_ ; +} + +## copy the statements and the execute into $variables +# (__stmt_ph_ is not needed) +## + generate the prepared statements +--enable_query_log +let $__stmt_c_= `select @__stmt_c_`; +eval prepare __stmt_c_ from @__stmt_c_ ; +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + let $__stmt_uv_= `select @__stmt_uv_`; + eval prepare __stmt_uv_ from @__stmt_uv_ ; + let $__execute_ph= `select @__execute_stmt_ph`; + eval prepare __stmt_ph_ from @__stmt_ph_ ; + dec $__with_var_ ; +} + + +##### The execution of all statements +## statement with Constants +eval $__stmt_c_ ; +## prepared statement with Constants +execute __stmt_c_ ; +# Try to detect if the prior executes damaged the parse tree by +# two additional executes . +execute __stmt_c_ ; +execute __stmt_c_ ; +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + ## statement with Uservariables + eval $__stmt_uv_ ; + ## prepared statement with Uservariables + execute __stmt_uv_ ; + # Try to detect if the prior executes damaged the parse tree by + # two additional executes . + execute __stmt_uv_ ; + execute __stmt_uv_ ; + ## prepared statement with placeholders + eval $__execute_ph ; + # Try to detect if the prior executes damaged the parse tree by + # two additional executes . + eval $__execute_ph ; + eval $__execute_ph ; + + dec $__with_var_ ; +} diff --git a/mysql-test/r/ps_12func.result b/mysql-test/r/ps_12func.result new file mode 100644 index 00000000000..881d5392edd --- /dev/null +++ b/mysql-test/r/ps_12func.result @@ -0,0 +1,4748 @@ +use test; + +###### Variations on ROUND(X,D) ###### + +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ') as my_col' ; +set @max_var_number= 2; +set @string_1= '11.298' ; +set @type_1= 'DOUBLE' ; +set @type_2= 'BIGINT' ; +set @string_2= '1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '3' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,3) as my_col ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +set @string_2= '4' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,4) as my_col ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +set @string_2= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,0) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +set @string_2= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-1) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-2) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '-3' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-3) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '1.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.0) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '3.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,3.0) as my_col ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +set @string_2= '4.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,4.0) as my_col ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +set @string_2= '0.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,0.0) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +set @string_2= '-1.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-1.0) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-2.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '-3.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-3.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '1.1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.1) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '1.9' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.9) as my_col ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '-11' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-11) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '11.49' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.49) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '10.51' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(10.51) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '0.0' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(0.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '-11.49' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-11.49) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @string_1= '-10.51' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-10.51) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @stmt_part_2= 'select ROUND() as my_col' ; +set @max_var_number= 0; +prepare __stmt_c_ from @__stmt_c_ ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +select ROUND( ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE + +###### Variations on CONCAT_WS(separator,str1,str2,...) ###### + +set @stmt_part_1= 'select CONCAT_WS(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ') as my_col' ; +set @max_var_number= 3; +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My','QL') as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'LONGBLOB' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @type_2= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @type_2= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'NULL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @type_3= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @stmt_part_1= "select CONCAT_WS('S',IF(" ; +set @stmt_part_2= ' IS NULL, ' ; +set @stmt_part_3= ' , ' ; +set @stmt_part_4= "),'QL') as my_col" ; +set @max_var_number= 3; +set @string_1= 'My' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',IF('My' IS NULL, 'X' , 'My'),'QL') as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CONCAT_WS('S',IF(@var_1 IS NULL, @var_2 , @var_3),'QL') as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; + +###### Variations on CHAR(N,...) ###### + +set @stmt_part_1= 'select CHAR(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ',' ; +set @stmt_part_6= ') as my_col' ; +set @max_var_number= 5; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR(77,121,83,81,76) as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CHAR(@var_1 ,@var_2,@var_3,@var_4,@var_5) as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= 'NULL' ; +set @type_5= 'BIGINT' ; +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; + +###### Variations on CHAR_LENGTH ###### + +set @stmt_part_1= 'select CHAR_LENGTH(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +set @string_1= 'MySQL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH('MySQL') as my_col ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL + +###### Variations on FIELD(str,str1,str2,str3,...) ###### + +set @stmt_part_1= 'select FIELD(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ') as my_col' ; +set @max_var_number= 4; +set @string_1= 'Hit' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '1it' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'Hit' ; +set @type_3= 'LONGTEXT' ; +set @string_4= '3it' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD('Hit','1it','Hit','3it') as my_col ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +set @string_1= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD(NULL,'1it','Hit','3it') as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +set @string_3= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD(NULL,'1it',NULL,'3it') as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 + +###### Variations on INSERT(str,pos,len,newstr) ###### + +set @stmt_part_1= "select INSERT(" ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ") as my_col" ; +set @max_var_number= 4; +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,4,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_2= '+30.0E-1' ; +set @type_2= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',+30.0E-1,4,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '+40.0E-1' ; +set @type_3= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,+40.0E-1,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT(NULL,3,4,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',NULL,4,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,NULL,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,4,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +set @string_2= '15' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',15,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_2= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',0,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_2= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',-1,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +set @string_3= '10' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,10,'1234') as my_col ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +set @string_3= '5' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,5,'1234') as my_col ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +set @string_3= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,0,'1234') as my_col ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +set @string_3= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,-1,'1234') as my_col ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 + +###### Variations on BIN(N) ###### + +set @stmt_part_1= "select BIN(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; +set @string_1= '12' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(12) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select BIN(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '2147483648' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(2147483648) as my_col ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +select BIN(@var_1 ) as my_col ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select BIN(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= '-1' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(-1) as my_col ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +select BIN(@var_1 ) as my_col ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +set @string_1= '9000000000000000000' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(9000000000000000000) as my_col ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +select BIN(@var_1 ) as my_col ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +set @string_1= '12.9E-0' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(12.9E-0) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +set @string_1= '0.129E+2' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(0.129E+2) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 + +###### Variations on BIT_LENGT(str) ###### + +set @stmt_part_1= "select BIT_LENGTH(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; +set @string_1= 'text' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIT_LENGTH('text') as my_col ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +select BIT_LENGTH(@var_1 ) as my_col ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIT_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select BIT_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL + +###### Variations on CONV(N,from_base,to_base) ###### + +set @stmt_part_1= "select CONV(" ; +set @stmt_part_2= "," ; +set @stmt_part_3= "," ; +set @stmt_part_4= ") as my_col" ; +set @max_var_number= 3; +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(-37,10,10) as my_col ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); +set @type_1= 'LONGTEXT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV('18446744073709551579',10,10) as my_col ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,-10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(-37,10,-10) as my_col ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,11) as my_col ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,11,10) as my_col ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(10,10,11) as my_col ; +my_col +A +execute __stmt_c_ ; +my_col +A +execute __stmt_c_ ; +my_col +A +execute __stmt_c_ ; +my_col +A +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +set @string_1= 'A' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV('A',11,10) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(11,10,11) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(10,11,10) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '36' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,36) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '36' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(11,36,10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(NULL,10,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '37' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,NULL,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_2= '10' ; +set @string_3= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_3= '10' ; +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '37' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,37,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,1,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,0,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '-1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,-1,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '37' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,37) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '1' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,1) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '0' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,0,0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-1' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,-1) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-37' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,-37) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL diff --git a/mysql-test/r/tool_test.result b/mysql-test/r/tool_test.result new file mode 100644 index 00000000000..7be7645d8eb --- /dev/null +++ b/mysql-test/r/tool_test.result @@ -0,0 +1,223 @@ +use test ; +set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; +set @max_var_number= 0; +the content of the statement variable +-------------------------------------- +@__stmt_c_ is: SELECT 1 as "my_fine_statement" +prepare __stmt_c_ from @__stmt_c_ ; +SELECT 1 as "my_fine_statement" ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +set @stmt_part_1= 'SELECT ' ; +set @stmt_part_2= ' + ' ; +set @stmt_part_3= ' + ' ; +set @stmt_part_4= ' + ' ; +set @stmt_part_5= ' + ' ; +set @stmt_part_6= ' + ' ; +set @stmt_part_7= ' + ' ; +set @stmt_part_8= ' + ' ; +set @stmt_part_9= ' as "my_fine_statement"' ; +set @max_var_number= 8; +set @string_1= '1' ; +set @type_1= 'BIGINT' ; +set @string_2= 'nULL' ; +set @type_2= 'BIGINT' ; +set @string_3= '2.0' ; +set @type_3= 'DOUBLE' ; +set @string_4= 'NuLL' ; +set @type_4= 'DOUBLE' ; +set @string_5= 'TEXT' ; +set @type_5= 'LONGTEXT' ; +set @string_6= 'NUlL' ; +set @type_6= 'LONGTEXT' ; +set @string_7= 'BLOB' ; +set @type_7= 'LONGBLOB' ; +set @string_8= 'NULl' ; +set @type_8= 'LONGBLOB' ; +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; +the content of the statement variables +-------------------------------------- +@__stmt_c_ is: SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" +@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" +@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" +@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 +the content of the parameter variables +-------------------------------------- +type string uservariable +BIGINT 1 1 +type string uservariable +BIGINT nULL NULL +type string uservariable +DOUBLE 2.0 2 +type string uservariable +DOUBLE NuLL NULL +type string uservariable +LONGTEXT TEXT TEXT +type string uservariable +LONGTEXT NUlL NULL +type string uservariable +LONGBLOB BLOB BLOB +type string uservariable +LONGBLOB NULl NULL +@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 +1 NULL 2 NULL TEXT NULL BLOB NULL +Table Create Table +t9 CREATE TABLE `t9` ( + `@var_1` bigint(20) default NULL, + `@var_2` bigint(20) default NULL, + `@var_3` double default NULL, + `@var_4` double default NULL, + `@var_5` longtext, + `@var_6` longtext, + `@var_7` longblob, + `@var_8` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +set @string_1= '1.0' ; +set @type_1= 'DOUBLE' ; +set @string_2= '3.0' ; +set @type_2= 'DOUBLE' ; +set @string_3= '2' ; +set @type_3= 'BIGINT' ; +set @string_4= '4' ; +set @type_4= 'BIGINT' ; +set @string_5= '5' ; +set @type_5= 'BIGINT' ; +set @string_6= '6' ; +set @type_6= 'DOUBLE' ; +set @string_7= '7' ; +set @type_7= 'DOUBLE' ; +set @string_8= '8' ; +set @type_8= 'DOUBLE' ; +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; +the content of the statement variables +-------------------------------------- +@__stmt_c_ is: SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" +@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" +@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" +@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 +the content of the parameter variables +-------------------------------------- +type string uservariable +DOUBLE 1.0 1 +type string uservariable +DOUBLE 3.0 3 +type string uservariable +BIGINT 2 2 +type string uservariable +BIGINT 4 4 +type string uservariable +BIGINT 5 5 +type string uservariable +DOUBLE 6 6 +type string uservariable +DOUBLE 7 7 +type string uservariable +DOUBLE 8 8 +@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 +1 3 2 4 5 6 7 8 +Table Create Table +t9 CREATE TABLE `t9` ( + `@var_1` double default NULL, + `@var_2` double default NULL, + `@var_3` bigint(20) default NULL, + `@var_4` bigint(20) default NULL, + `@var_5` bigint(20) default NULL, + `@var_6` double default NULL, + `@var_7` double default NULL, + `@var_8` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 diff --git a/mysql-test/t/ps_12func.test b/mysql-test/t/ps_12func.test new file mode 100644 index 00000000000..65abffe946c --- /dev/null +++ b/mysql-test/t/ps_12func.test @@ -0,0 +1,867 @@ +##################### ps_12func.test ##################### +# # +# Prepared Statement tests of functions # +# # +# Non prepared variants are also checked # +# # +# Checked functions: # +# # +# ROUND(X,D) and ROUND(X) # +# CONCAT_WS(separator,str1,str2,...) # +# CHAR(N,...) # +# CHAR_LENGTH(str) # +# FIELD(str,str1,str2,str3,...) # +# INSERT(str,pos,len,newstr) # +# BIN(N) # +# BIT_LENGTH(str) # +# CONV(N,from_base,to_base) # +# # +########################################################## + +use test; + +# "--disable_abort_on_error" is definitely needed, because there are some tests +# which intentional produce statements with wrong syntax and it is not +# possible to put a "--error " just before the execution calls +# within patchwork-test.inc . +--disable_abort_on_error + +##### ROUND(X,D) +--disable_query_log +select concat('###### Variations on ROUND(X,D) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ') as my_col' ; +set @max_var_number= 2; + + +#------------------------------------------------------------------ +# first parameter 11.298 (DOUBLE) , ROUND( m.n , p ) m = 2 ; n = 3 +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= '11.298' ; +set @type_1= 'DOUBLE' ; +## data type BIGINT, if possible +set @type_2= 'BIGINT' ; +# p < n +set @string_2= '1' ; +--source include/patchwork-check.inc +# p = n +set @string_2= '3' ; +--source include/patchwork-check.inc +# p > n +set @string_2= '4' ; +--source include/patchwork-check.inc +# p = 0 +set @string_2= '0' ; +--source include/patchwork-check.inc +# -p < m +set @string_2= '-1' ; +--source include/patchwork-check.inc +# -p = m +set @string_2= '-2' ; +--source include/patchwork-check.inc +# -p > m +set @string_2= '-3' ; +--source include/patchwork-check.inc +# -p = NULL +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +## data type DOUBLE, if possible +set @type_2= 'DOUBLE' ; +# p < n +set @string_2= '1.0' ; +--source include/patchwork-check.inc +# p = n +set @string_2= '3.0' ; +--source include/patchwork-check.inc +# p > n +set @string_2= '4.0' ; +--source include/patchwork-check.inc +# p = 0 +set @string_2= '0.0' ; +--source include/patchwork-check.inc +# -p < m +set @string_2= '-1.0' ; +--source include/patchwork-check.inc +# -p = m +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +# -p > m +set @string_2= '-3.0' ; +--source include/patchwork-check.inc +# ugly values +set @string_2= '1.1' ; +--source include/patchwork-check.inc +set @string_2= '1.9' ; +--source include/patchwork-check.inc +# -p = NULL +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +## data type LONGBLOB, content NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type BIGINT, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type DOUBLE, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type LONGBLOB, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# ROUND(D) Returns the argument X, rounded to the nearest integer. +#------------------------------------------------------------------ +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +## test cases with BIGINT +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '-11' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +## test cases with BIGINT +set @string_1= '11.49' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '10.51' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '0.0' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '-11.49' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '-10.51' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +## Incomplete statement +set @stmt_part_2= 'select ROUND() as my_col' ; +set @max_var_number= 0; +--source include/patchwork-check.inc + +##### CONCAT_WS(separator,str1,str2,...) +# Example: CONCAT_WS('S','My','QL') +--disable_query_log +select concat('###### Variations on CONCAT_WS(separator,str1,str2,...) ######') +as '' union select ''; +--enable_query_log +set @stmt_part_1= 'select CONCAT_WS(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ') as my_col' ; +set @max_var_number= 3; + +### common case +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +### The separator (first parameter) is NULL. +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + +### The first string (second parameter) is NULL. +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'LONGBLOB' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_2= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_2= 'DOUBLE' ; +--source include/patchwork-check.inc + +### The second string (third parameter) is NULL. +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'NULL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_3= 'DOUBLE' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# some complicated things +#------------------------------------------------------------------ +# select concat_ws('S',IF(parameter1=NULL,parameter2,parameter3),'QL') +set @stmt_part_1= "select CONCAT_WS('S',IF(" ; +set @stmt_part_2= ' IS NULL, ' ; +set @stmt_part_3= ' , ' ; +set @stmt_part_4= "),'QL') as my_col" ; +set @max_var_number= 3; + +# common case +set @string_1= 'My' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc + +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +# deactivated because of +# Bug#6297 : prepared statement, wrong handling of IS NULL +# let $__debug_= 1; +# --source include/patchwork-check.inc + +##### CHAR(N,...) +# Example(Manual): SELECT CHAR(77,121,83,81,'76'); +--disable_query_log +select concat('###### Variations on CHAR(N,...) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select CHAR(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ',' ; +set @stmt_part_6= ') as my_col' ; +set @max_var_number= 5; + +### common case +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +# Only the first parameter is NULL. +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +##### ugly maybe wrong result +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Only one non first/last parameter is NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Two neighbour parameters in the middle are NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Only the last parameter is NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= 'NULL' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## The first parameter is NULL with bad type. +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + + +##### CHAR_LENGTH(str) +--disable_query_log +select concat('###### Variations on CHAR_LENGTH ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select CHAR_LENGTH(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; + +### common case +set @string_1= 'MySQL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + + +##### FIELD(str,str1,str2,str3,...) +--disable_query_log +select concat('###### Variations on FIELD(str,str1,str2,str3,...) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select FIELD(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ') as my_col' ; +set @max_var_number= 4; + +### common case +set @string_1= 'Hit' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '1it' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'Hit' ; +set @type_3= 'LONGTEXT' ; +set @string_4= '3it' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +# string to search for is NULL, all other strings not NULL +set @string_1= 'NULL' ; +# Bug#6321: strange error, string function FIELD(, .. +--source include/patchwork-check.inc +# string to search for and one of the other is NULL +set @string_3= 'NULL' ; +# Bug#6321: strange error, string function FIELD(, .. +--source include/patchwork-check.inc + + +##### INSERT(str,pos,len,newstr) +# Manual Example: SELECT INSERT('Quadratic', 3, 4, 'What') -> 'QuWhattic' +--disable_query_log +select concat('###### Variations on INSERT(str,pos,len,newstr) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select INSERT(" ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ") as my_col" ; +set @max_var_number= 4; + +### common case (modified manual example) +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Try DOUBLE instead of BIGINT for pos and len +#------------------------------------------------------------------ +set @string_2= '+30.0E-1' ; +set @type_2= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '+40.0E-1' ; +set @type_3= 'DOUBLE' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Variations on the second parameter (start position) +#------------------------------------------------------------------ +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +# start position > length of the first string (9) +set @string_2= '15' ; +--source include/patchwork-check.inc +# start position = 0 +set @string_2= '0' ; +--source include/patchwork-check.inc +# start position < 0 +set @string_2= '-1' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Variations on the third parameter (# of chars of string one to be replaced) +#------------------------------------------------------------------ +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +## chars to be replaced > length of the second string +# start pos (3) + replace length(10) > length of first string(9) +set @string_3= '10' ; +--source include/patchwork-check.inc +# start pos (3) + chars to be replaced (5) < length of first string(9) +set @string_3= '5' ; +--source include/patchwork-check.inc +# chars to be replaced = 0 +set @string_3= '0' ; +--source include/patchwork-check.inc +# chars to be replaced < 0 +set @string_3= '-1' ; +--source include/patchwork-check.inc + + +##### BIN(N) +# manual example: SELECT BIN(12); -> '1100' +--disable_query_log +select concat('###### Variations on BIN(N) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select BIN(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; + +set @string_1= '12' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +#### Variations on the parameter +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '2147483648' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '-1' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9000000000000000000' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '12.9E-0' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '0.129E+2' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + +##### BIT_LENGTH(str) +# Manual example: SELECT BIT_LENGTH('text'); -> 32 +--disable_query_log +select concat('###### Variations on BIT_LENGT(str) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select BIT_LENGTH(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; + +set @string_1= 'text' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + +# try NULL +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + + +##### CONV(N,from_base,to_base) +# Manual example: SELECT CONV(-17,10,-18); -> '-H' +--disable_query_log +select concat('###### Variations on CONV(N,from_base,to_base) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select CONV(" ; +set @stmt_part_2= "," ; +set @stmt_part_3= "," ; +set @stmt_part_4= ") as my_col" ; +set @max_var_number= 3; + +#------------------------------------------------------------------ +# Manual: If to_base is a negative number, N is regarded as a signed number. +# Otherwise, N is treated as unsigned. +# Experiments with positive/negative number/to_base +#------------------------------------------------------------------ +# number positive written, to_base positive +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number negative written, to_base positive +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# The last result (unsigned) BIGINT 18446744073709551579 might be surprising. +# The next statements could give an explanation. +set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); +set @type_1= 'LONGTEXT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number positive written, to_base negative +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number negative written, to_base negative +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# conversions to and from the exotic 11 based number system +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= 'A' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Try the maximum base value 36 +#------------------------------------------------------------------ +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '36' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '36' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '37' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc +set @string_2= '10' ; +set @string_3= 'NULL' ; +--source include/patchwork-check.inc +set @string_3= '10' ; + +#------------------------------------------------------------------ +# The rule for from_base is: 2 <= from_base <= 36 +# Try values outside of this range. +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '37' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '-1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# The rule for to_base is: 2<= ABS(to_base) <= 36 +# Try values outside of this range. +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '37' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '1' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '0' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-1' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-37' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + + diff --git a/mysql-test/t/tool_test.test b/mysql-test/t/tool_test.test new file mode 100644 index 00000000000..b28eae2c17d --- /dev/null +++ b/mysql-test/t/tool_test.test @@ -0,0 +1,105 @@ +########################### tool_test.test ############################# +# # +# Test sequences for the check of mysqltest based test tools # +# # +# Checked routines: # +# include/patchwork-check.inc # +# # +######################################################################## + +##### Check of include/patchwork-check.inc +# +use test ; +--disable_abort_on_error + +#----------------------------------------------------------------------- +# Simple test (special case): +# The statement is made of only one piece and does not contain variables. +#----------------------------------------------------------------------- +set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; +set @max_var_number= 0; +# switch debug output on (Attention: patchwork-check.inc will switch it off) +let $__debug_= 1; +--source include/patchwork-check.inc + +#----------------------------------------------------------------------- +# Test case with many statement pieces and variables of all in +# include/patchwork-check.inc available data types. +#----------------------------------------------------------------------- +set @stmt_part_1= 'SELECT ' ; +set @stmt_part_2= ' + ' ; +set @stmt_part_3= ' + ' ; +set @stmt_part_4= ' + ' ; +set @stmt_part_5= ' + ' ; +set @stmt_part_6= ' + ' ; +set @stmt_part_7= ' + ' ; +set @stmt_part_8= ' + ' ; +set @stmt_part_9= ' as "my_fine_statement"' ; +set @max_var_number= 8; + +set @string_1= '1' ; +set @type_1= 'BIGINT' ; +set @string_2= 'nULL' ; +set @type_2= 'BIGINT' ; +set @string_3= '2.0' ; +set @type_3= 'DOUBLE' ; +set @string_4= 'NuLL' ; +set @type_4= 'DOUBLE' ; +set @string_5= 'TEXT' ; +set @type_5= 'LONGTEXT' ; +set @string_6= 'NUlL' ; +set @type_6= 'LONGTEXT' ; +set @string_7= 'BLOB' ; +set @type_7= 'LONGBLOB' ; +set @string_8= 'NULl' ; +set @type_8= 'LONGBLOB' ; + +# Initialization of all uservariables to the data type LONGTEXT and content, +# which will not be repeated within the following tests. +# 'include/patchwork-check.inc' MUST destroy all these settings. +# That is why this initialization is NOT needed within test cases +# calling include/patchwork-check.inc . +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; + +# switch debug output on (Attention: patchwork-check.inc will switch it off) +let $__debug_= 1; +--source include/patchwork-check.inc + +### Execute the statement with more useful content of the variables. +set @string_1= '1.0' ; +set @type_1= 'DOUBLE' ; +set @string_2= '3.0' ; +set @type_2= 'DOUBLE' ; +set @string_3= '2' ; +set @type_3= 'BIGINT' ; +set @string_4= '4' ; +set @type_4= 'BIGINT' ; +set @string_5= '5' ; +set @type_5= 'BIGINT' ; +set @string_6= '6' ; +set @type_6= 'DOUBLE' ; +set @string_7= '7' ; +set @type_7= 'DOUBLE' ; +set @string_8= '8' ; +set @type_8= 'DOUBLE' ; + +# Initialization +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; + +# switch debug output on (Attention: include/patchwork-check.inc switches it off) +let $__debug_= 1; +--source include/patchwork-check.inc -- cgit v1.2.1 From 44af4e4a99e866dd6ee29809a1f1efd4f18ce3f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:25:55 +0100 Subject: wl1744 - ndb on windoze ndb/Makefile.am: ndb-windows ndb/src/Makefile.am: ndb-windows ndb/src/common/debugger/Makefile.am: ndb-windows ndb/src/common/debugger/signaldata/Makefile.am: ndb-windows ndb/src/common/logger/Makefile.am: ndb-windows ndb/src/common/mgmcommon/Makefile.am: ndb-windows ndb/src/common/portlib/Makefile.am: ndb-windows ndb/src/common/transporter/Makefile.am: ndb-windows ndb/src/common/util/File.cpp: ndb-windows ndb/src/common/util/Makefile.am: ndb-windows ndb/src/cw/cpcd/Makefile.am: ndb-windows ndb/src/kernel/Makefile.am: ndb-windows ndb/src/kernel/blocks/backup/Makefile.am: ndb-windows ndb/src/kernel/blocks/backup/restore/Makefile.am: ndb-windows ndb/src/kernel/blocks/cmvmi/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbacc/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbdict/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbdih/Makefile.am: ndb-windows ndb/src/kernel/blocks/dblqh/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtc/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtup/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtux/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbutil/Makefile.am: ndb-windows ndb/src/kernel/blocks/grep/Makefile.am: ndb-windows ndb/src/kernel/blocks/ndbcntr/Makefile.am: ndb-windows ndb/src/kernel/blocks/ndbfs/Makefile.am: ndb-windows ndb/src/kernel/blocks/qmgr/Makefile.am: ndb-windows ndb/src/kernel/blocks/suma/Makefile.am: ndb-windows ndb/src/kernel/blocks/trix/Makefile.am: ndb-windows ndb/src/kernel/error/Makefile.am: ndb-windows ndb/src/kernel/vm/Makefile.am: ndb-windows ndb/src/mgmapi/Makefile.am: ndb-windows ndb/src/mgmsrv/InitConfigFileParser.cpp: ndb-windows ndb/src/mgmsrv/Makefile.am: ndb-windows ndb/src/mgmsrv/MgmtSrvr.cpp: ndb-windows ndb/src/ndbapi/Makefile.am: ndb-windows ndb/src/ndbapi/ndberror.c: ndb-windows ndb/test/include/NdbSchemaOp.hpp: ndb-windows ndb/test/run-test/Makefile.am: ndb-windows ndb/test/src/CpcClient.cpp: ndb-windows ndb/test/src/Makefile.am: ndb-windows ndb/test/src/NdbRestarter.cpp: ndb-windows ndb/test/src/getarg.c: ndb-windows --- ndb/Makefile.am | 4 +- ndb/src/Makefile.am | 5 +- ndb/src/common/debugger/Makefile.am | 2 +- ndb/src/common/debugger/signaldata/Makefile.am | 2 +- ndb/src/common/logger/Makefile.am | 9 +- ndb/src/common/mgmcommon/Makefile.am | 2 +- ndb/src/common/portlib/Makefile.am | 14 +- ndb/src/common/portlib/win32/NdbCondition.c | 184 ++++++++++++++++++ ndb/src/common/portlib/win32/NdbDaemon.c | 44 +++++ ndb/src/common/portlib/win32/NdbEnv.c | 33 ++++ ndb/src/common/portlib/win32/NdbHost.c | 53 +++++ ndb/src/common/portlib/win32/NdbMem.c | 237 +++++++++++++++++++++++ ndb/src/common/portlib/win32/NdbMutex.c | 78 ++++++++ ndb/src/common/portlib/win32/NdbSleep.c | 35 ++++ ndb/src/common/portlib/win32/NdbTCP.c | 39 ++++ ndb/src/common/portlib/win32/NdbThread.c | 118 +++++++++++ ndb/src/common/portlib/win32/NdbTick.c | 64 ++++++ ndb/src/common/transporter/Makefile.am | 2 +- ndb/src/common/util/File.cpp | 11 +- ndb/src/common/util/Makefile.am | 2 +- ndb/src/cw/cpcd/Makefile.am | 14 +- ndb/src/kernel/Makefile.am | 6 +- ndb/src/kernel/blocks/backup/Makefile.am | 2 +- ndb/src/kernel/blocks/backup/restore/Makefile.am | 8 +- ndb/src/kernel/blocks/cmvmi/Makefile.am | 2 +- ndb/src/kernel/blocks/dbacc/Makefile.am | 2 +- ndb/src/kernel/blocks/dbdict/Makefile.am | 2 +- ndb/src/kernel/blocks/dbdih/Makefile.am | 2 +- ndb/src/kernel/blocks/dblqh/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtc/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtup/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtux/Makefile.am | 2 +- ndb/src/kernel/blocks/dbutil/Makefile.am | 8 +- ndb/src/kernel/blocks/grep/Makefile.am | 2 +- ndb/src/kernel/blocks/ndbcntr/Makefile.am | 2 +- ndb/src/kernel/blocks/ndbfs/Makefile.am | 2 +- ndb/src/kernel/blocks/qmgr/Makefile.am | 2 +- ndb/src/kernel/blocks/suma/Makefile.am | 2 +- ndb/src/kernel/blocks/trix/Makefile.am | 2 +- ndb/src/kernel/error/Makefile.am | 2 +- ndb/src/kernel/vm/Makefile.am | 2 +- ndb/src/mgmapi/Makefile.am | 2 +- ndb/src/mgmsrv/InitConfigFileParser.cpp | 1 + ndb/src/mgmsrv/Makefile.am | 6 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 1 + ndb/src/ndbapi/Makefile.am | 2 +- ndb/src/ndbapi/ndberror.c | 1 + ndb/test/include/NdbSchemaOp.hpp | 2 + ndb/test/run-test/Makefile.am | 14 +- ndb/test/src/CpcClient.cpp | 3 - ndb/test/src/Makefile.am | 2 +- ndb/test/src/NdbRestarter.cpp | 2 +- ndb/test/src/getarg.c | 2 +- 53 files changed, 964 insertions(+), 82 deletions(-) create mode 100644 ndb/src/common/portlib/win32/NdbCondition.c create mode 100644 ndb/src/common/portlib/win32/NdbDaemon.c create mode 100644 ndb/src/common/portlib/win32/NdbEnv.c create mode 100644 ndb/src/common/portlib/win32/NdbHost.c create mode 100644 ndb/src/common/portlib/win32/NdbMem.c create mode 100644 ndb/src/common/portlib/win32/NdbMutex.c create mode 100644 ndb/src/common/portlib/win32/NdbSleep.c create mode 100644 ndb/src/common/portlib/win32/NdbTCP.c create mode 100644 ndb/src/common/portlib/win32/NdbThread.c create mode 100644 ndb/src/common/portlib/win32/NdbTick.c diff --git a/ndb/Makefile.am b/ndb/Makefile.am index e4f21ac8040..a0b8efa7bb4 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -24,4 +24,6 @@ windoze: windoze-dsp: all-windoze-dsp: windoze - tar cvfz ndb-win-dsp.tar.gz `find . -name '*.dsp'` + find . -name '*.dsp' | xargs unix2dos + $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw + tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp'` diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index 07f6ea5d8d4..6f3ca744b0e 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -28,5 +28,6 @@ libndbclient.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libndbclient_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(libndbclient_la_LIBADD) + @$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD) + @touch dummy.cpp diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index 08251eb9155..e25a11c9bee 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -22,4 +22,4 @@ libtrace.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index bc18e17fbb0..9146d552568 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -44,4 +44,4 @@ libsignaldataprint.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 90f3346b414..0af21f9fbde 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -1,8 +1,9 @@ noinst_LTLIBRARIES = liblogger.la -liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ - ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp +SOURCE_WIN = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ + ConsoleLogHandler.cpp FileLogHandler.cpp +liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am @@ -20,5 +21,5 @@ liblogger.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(liblogger_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(SOURCE_WIN) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index ebb89f8a251..b322af03268 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -26,4 +26,4 @@ libmgmsrvcommon.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index fe69ef7346a..7717e1fcc27 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -16,6 +16,16 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp munmaptest_SOURCES = munmaptest.cpp # Don't update the files from bitkeeper +WIN_src = win32/NdbCondition.c \ + win32/NdbDaemon.c \ + win32/NdbEnv.c \ + win32/NdbHost.c \ + win32/NdbMem.c \ + win32/NdbMutex.c \ + win32/NdbSleep.c \ + win32/NdbTCP.c \ + win32/NdbThread.c \ + win32/NdbTick.c windoze-dsp: libportlib.dsp @@ -28,5 +38,5 @@ libportlib.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libportlib_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c new file mode 100644 index 00000000000..12b508cf33b --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -0,0 +1,184 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include +#include +#include + +#include "NdbCondition.h" +#include + + +struct NdbCondition +{ + long nWaiters; + NdbMutex* pNdbMutexWaitersLock; + HANDLE hSemaphore; + HANDLE hEventWaitersDone; + int bWasBroadcast; +}; + + +struct NdbCondition* +NdbCondition_Create(void) +{ + int result = 0; + struct NdbCondition* pNdbCondition = (struct NdbCondition*)malloc(sizeof(struct NdbCondition)); + if(!pNdbCondition) + return 0; + + pNdbCondition->nWaiters = 0; + pNdbCondition->bWasBroadcast = 0; + if(!(pNdbCondition->hSemaphore = CreateSemaphore(0, 0, MAXLONG, 0))) + result = -1; + else if(!(pNdbCondition->pNdbMutexWaitersLock = NdbMutex_Create())) + result = -1; + else if(!(pNdbCondition->hEventWaitersDone = CreateEvent(0, 0, 0, 0))) + result = -1; + + assert(!result); + return pNdbCondition; +} + + +int +NdbCondition_Wait(struct NdbCondition* p_cond, + NdbMutex* p_mutex) +{ + int result; + int bLastWaiter; + if(!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject (p_cond->hSemaphore, INFINITE); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result==WAIT_OBJECT_0 && bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_WaitTimeout(struct NdbCondition* p_cond, + NdbMutex* p_mutex, + int msecs) +{ + int result; + int bLastWaiter; + if (!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(msecs<0) + msecs = 0; + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject(p_cond->hSemaphore, msecs); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result!=WAIT_OBJECT_0) + result = -1; + + if(bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_Signal(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = (p_cond->nWaiters > 0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(bHaveWaiters) + return (ReleaseSemaphore(p_cond->hSemaphore, 1, 0) ? 0 : -1); + else + return 0; +} + + +int NdbCondition_Broadcast(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + int result = 0; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = 0; + if(p_cond->nWaiters > 0) + { + p_cond->bWasBroadcast = !0; + bHaveWaiters = 1; + } + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(bHaveWaiters) + { + if(!ReleaseSemaphore(p_cond->hSemaphore, p_cond->nWaiters, 0)) + result = -1; + else if(WaitForSingleObject (p_cond->hEventWaitersDone, INFINITE) != WAIT_OBJECT_0) + result = -1; + p_cond->bWasBroadcast = 0; + } + return result; +} + + +int NdbCondition_Destroy(struct NdbCondition* p_cond) +{ + int result; + if(!p_cond) + return 1; + + CloseHandle(p_cond->hEventWaitersDone); + NdbMutex_Destroy(p_cond->pNdbMutexWaitersLock); + result = (CloseHandle(p_cond->hSemaphore) ? 0 : -1); + + free(p_cond); + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c new file mode 100644 index 00000000000..b96d4c20260 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "NdbDaemon.h" + +#define NdbDaemon_ErrorSize 500 +long NdbDaemon_DaemonPid; +int NdbDaemon_ErrorCode; +char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; + +int +NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) +{ + // XXX do something + return 0; +} + +#ifdef NDB_DAEMON_TEST + +int +main() +{ + if (NdbDaemon_Make("test.pid", "test.log", 0) == -1) { + fprintf(stderr, "NdbDaemon_Make: %s\n", NdbDaemon_ErrorText); + return 1; + } + sleep(10); + return 0; +} + +#endif diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c new file mode 100644 index 00000000000..0df703a5e97 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbEnv.h" +#include +#include + +const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) +{ + char* p = NULL; + p = getenv(name); + + if (p != NULL && buf != NULL){ + strncpy(buf, p, buflen); + buf[buflen-1] = 0; + } + return p; +} + diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c new file mode 100644 index 00000000000..f91dd1a531c --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbHost.h" +#include +#include + + +int NdbHost_GetHostName(char* buf) +{ + /* We must initialize TCP/IP if we want to call gethostname */ + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD( 2, 0 ); + err = WSAStartup( wVersionRequested, &wsaData ); + if ( err != 0 ) { + /** + * Tell the user that we couldn't find a usable + * WinSock DLL. + */ + return -1; + } + + /* Get host name */ + if(gethostname(buf, MAXHOSTNAMELEN)) + { + return -1; + } + return 0; +} + + +int NdbHost_GetProcessId(void) +{ + return _getpid(); +} + diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c new file mode 100644 index 00000000000..274dc31353f --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -0,0 +1,237 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +#include "NdbMem.h" + + +struct AWEINFO +{ + SIZE_T dwSizeInBytesRequested; + ULONG_PTR nNumberOfPagesRequested; + ULONG_PTR nNumberOfPagesActual; + ULONG_PTR nNumberOfPagesFreed; + ULONG_PTR* pnPhysicalMemoryPageArray; + void* pRegionReserved; +}; + +const size_t cNdbMem_nMaxAWEinfo = 256; +size_t gNdbMem_nAWEinfo = 0; + +struct AWEINFO* gNdbMem_pAWEinfo = 0; + + +void ShowLastError(const char* szContext, const char* szFunction) +{ + DWORD dwError = GetLastError(); + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR)&lpMsgBuf, + 0, + NULL + ); + printf("%s : %s failed : %lu : %s\n", szContext, szFunction, dwError, (char*)lpMsgBuf); + LocalFree(lpMsgBuf); +} + + + +void NdbMem_Create() +{ + // Address Windowing Extensions + struct PRIVINFO + { + DWORD Count; + LUID_AND_ATTRIBUTES Privilege[1]; + } Info; + + HANDLE hProcess = GetCurrentProcess(); + HANDLE hToken; + if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken)) + { + ShowLastError("NdbMem_Create", "OpenProcessToken"); + } + + Info.Count = 1; + Info.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED; + if(!LookupPrivilegeValue(0, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid))) + { + ShowLastError("NdbMem_Create", "LookupPrivilegeValue"); + } + + if(!AdjustTokenPrivileges(hToken, FALSE, (PTOKEN_PRIVILEGES)&Info, 0, 0, 0)) + { + ShowLastError("NdbMem_Create", "AdjustTokenPrivileges"); + } + + if(!CloseHandle(hToken)) + { + ShowLastError("NdbMem_Create", "CloseHandle"); + } + + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + +void* NdbMem_Allocate(size_t size) +{ + // Address Windowing Extensions + struct AWEINFO* pAWEinfo; + HANDLE hProcess; + SYSTEM_INFO sysinfo; + + if(!gNdbMem_pAWEinfo) + { + gNdbMem_pAWEinfo = VirtualAlloc(0, + sizeof(struct AWEINFO)*cNdbMem_nMaxAWEinfo, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + } + + assert(gNdbMem_nAWEinfo < cNdbMem_nMaxAWEinfo); + pAWEinfo = gNdbMem_pAWEinfo+gNdbMem_nAWEinfo++; + + hProcess = GetCurrentProcess(); + GetSystemInfo(&sysinfo); + pAWEinfo->nNumberOfPagesRequested = (size+sysinfo.dwPageSize-1)/sysinfo.dwPageSize; + pAWEinfo->pnPhysicalMemoryPageArray = VirtualAlloc(0, + sizeof(ULONG_PTR)*pAWEinfo->nNumberOfPagesRequested, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + pAWEinfo->nNumberOfPagesActual = pAWEinfo->nNumberOfPagesRequested; + if(!AllocateUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesActual), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "AllocateUserPhysicalPages"); + return 0; + } + if(pAWEinfo->nNumberOfPagesRequested != pAWEinfo->nNumberOfPagesActual) + { + ShowLastError("NdbMem_Allocate", "nNumberOfPagesRequested != nNumberOfPagesActual"); + return 0; + } + + pAWEinfo->dwSizeInBytesRequested = size; + pAWEinfo->pRegionReserved = VirtualAlloc(0, pAWEinfo->dwSizeInBytesRequested, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE); + if(!pAWEinfo->pRegionReserved) + { + ShowLastError("NdbMem_Allocate", "VirtualAlloc"); + return 0; + } + + if(!MapUserPhysicalPages(pAWEinfo->pRegionReserved, pAWEinfo->nNumberOfPagesActual, pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "MapUserPhysicalPages"); + return 0; + } + + /* + printf("allocate AWE memory: %lu bytes, %lu pages, address %lx\n", + pAWEinfo->dwSizeInBytesRequested, + pAWEinfo->nNumberOfPagesActual, + pAWEinfo->pRegionReserved); + */ + return pAWEinfo->pRegionReserved; +} + + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return NdbMem_Allocate(size); +} + + +void NdbMem_Free(void* ptr) +{ + // VirtualFree(ptr, 0, MEM_DECOMMIT|MEM_RELEASE); + + // Address Windowing Extensions + struct AWEINFO* pAWEinfo = 0; + size_t i; + HANDLE hProcess; + + for(i=0; inNumberOfPagesActual, 0)) + { + ShowLastError("NdbMem_Free", "MapUserPhysicalPages"); + } + + if(!VirtualFree(ptr, 0, MEM_RELEASE)) + { + ShowLastError("NdbMem_Free", "VirtualFree"); + } + + pAWEinfo->nNumberOfPagesFreed = pAWEinfo->nNumberOfPagesActual; + if(!FreeUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesFreed), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Free", "FreeUserPhysicalPages"); + } + + VirtualFree(pAWEinfo->pnPhysicalMemoryPageArray, 0, MEM_DECOMMIT|MEM_RELEASE); +} + + +int NdbMem_MemLockAll() +{ + /* + HANDLE hProcess = GetCurrentProcess(); + SIZE_T nMinimumWorkingSetSize; + SIZE_T nMaximumWorkingSetSize; + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + + SetProcessWorkingSetSize(hProcess, 50000000, 100000000); + + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + */ + return -1; +} + +int NdbMem_MemUnlockAll() +{ + //VirtualUnlock(); + return -1; +} + diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c new file mode 100644 index 00000000000..c93384d91db --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -0,0 +1,78 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include +#include +#include + +#include "NdbMutex.h" + + +NdbMutex* NdbMutex_Create(void) +{ + NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex)); + if(!pNdbMutex) + return 0; + + InitializeCriticalSection(pNdbMutex); + return pNdbMutex; +} + + +int NdbMutex_Destroy(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + DeleteCriticalSection(p_mutex); + free(p_mutex); + return 0; +} + + +int NdbMutex_Lock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + EnterCriticalSection (p_mutex); + return 0; +} + + +int NdbMutex_Unlock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + LeaveCriticalSection(p_mutex); + return 0; +} + + +int NdbMutex_Trylock(NdbMutex* p_mutex) +{ + int result = -1; + if(p_mutex) + { + result = (TryEnterCriticalSection(p_mutex) ? 0 : -1); + } + return result; +} + diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c new file mode 100644 index 00000000000..ac0f44dd07f --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbSleep.h" + +#include + + +int +NdbSleep_MilliSleep(int milliseconds) +{ + Sleep(milliseconds); + return 0; +} + +int +NdbSleep_SecSleep(int seconds) +{ + return NdbSleep_MilliSleep(seconds*1000); +} + diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c new file mode 100644 index 00000000000..483a53bd606 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbTCP.h" + +int +Ndb_getInAddr(struct in_addr * dst, const char *address) +{ + struct hostent * hostPtr; + + /* Try it as aaa.bbb.ccc.ddd. */ + dst->s_addr = inet_addr(address); + if (dst->s_addr != -1) { + return 0; + } + + hostPtr = gethostbyname(address); + if (hostPtr != NULL) { + dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + return 0; + } + + return -1; +} + diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c new file mode 100644 index 00000000000..ae3c74be70d --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -0,0 +1,118 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +#include "NdbThread.h" + + +#define MAX_THREAD_NAME 16 + +typedef unsigned (WINAPI* NDB_WIN32_THREAD_FUNC)(void*); + + +struct NdbThread +{ + HANDLE hThread; + unsigned nThreadId; + char thread_name[MAX_THREAD_NAME]; +}; + + +struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, + NDB_THREAD_ARG *p_thread_arg, + const NDB_THREAD_STACKSIZE thread_stack_size, + const char* p_thread_name, + NDB_THREAD_PRIO thread_prio) +{ + struct NdbThread* tmpThread; + unsigned initflag; + int nPriority = 0; + + if(!p_thread_func) + return 0; + + tmpThread = (struct NdbThread*)malloc(sizeof(struct NdbThread)); + if(!tmpThread) + return 0; + + strncpy((char*)&tmpThread->thread_name, p_thread_name, MAX_THREAD_NAME); + + switch(thread_prio) + { + case NDB_THREAD_PRIO_HIGHEST: nPriority=THREAD_PRIORITY_HIGHEST; break; + case NDB_THREAD_PRIO_HIGH: nPriority=THREAD_PRIORITY_ABOVE_NORMAL; break; + case NDB_THREAD_PRIO_MEAN: nPriority=THREAD_PRIORITY_NORMAL; break; + case NDB_THREAD_PRIO_LOW: nPriority=THREAD_PRIORITY_BELOW_NORMAL; break; + case NDB_THREAD_PRIO_LOWEST: nPriority=THREAD_PRIORITY_LOWEST; break; + } + initflag = (nPriority ? CREATE_SUSPENDED : 0); + + tmpThread->hThread = (HANDLE)_beginthreadex(0, thread_stack_size, + (NDB_WIN32_THREAD_FUNC)p_thread_func, p_thread_arg, + initflag, &tmpThread->nThreadId); + + if(nPriority && tmpThread->hThread) + { + SetThreadPriority(tmpThread->hThread, nPriority); + ResumeThread (tmpThread->hThread); + } + + assert(tmpThread->hThread); + return tmpThread; +} + + +void NdbThread_Destroy(struct NdbThread** p_thread) +{ + CloseHandle((*p_thread)->hThread); + (*p_thread)->hThread = 0; + free(*p_thread); + *p_thread = 0; +} + + +int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) +{ + void *local_status = 0; + if (status == 0) + status = &local_status; + + if(WaitForSingleObject(p_wait_thread->hThread, INFINITE) == WAIT_OBJECT_0 + && GetExitCodeThread(p_wait_thread->hThread, (LPDWORD)status)) + { + CloseHandle(p_wait_thread->hThread); + p_wait_thread->hThread = 0; + return 0; + } + return -1; +} + + +void NdbThread_Exit(int status) +{ + _endthreadex((DWORD) status); +} + + +int NdbThread_SetConcurrencyLevel(int level) +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c new file mode 100644 index 00000000000..e3a67d8437d --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include "NdbTick.h" + +/* +#define FILETIME_PER_MICROSEC 10 +#define FILETIME_PER_MILLISEC 10000 +#define FILETIME_PER_SEC 10000000 + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + return (ullTime / FILETIME_PER_MILLISEC); +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + *secs = (ullTime / FILETIME_PER_SEC); + *micros = (Uint32)((ullTime % FILETIME_PER_SEC) / FILETIME_PER_MICROSEC); + return 0; +} +*/ + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + return (liCount.QuadPart*1000) / liFreq.QuadPart; +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + *secs = liCount.QuadPart / liFreq.QuadPart; + liCount.QuadPart -= *secs * liFreq.QuadPart; + *micros = (liCount.QuadPart*1000000) / liFreq.QuadPart; + return 0; +} diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 3204a9a9254..d76b1b6048b 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -33,4 +33,4 @@ libtransporter.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index f3faa8c4f7f..15698db3bc9 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -17,8 +17,8 @@ #include #include - #include +#include // // PUBLIC @@ -28,9 +28,14 @@ bool File_class::exists(const char* aFileName) { bool rc = true; - + +#ifdef USE_MY_STAT_STRUCT + struct my_stat stmp; +#else struct stat stmp; - if (::stat(aFileName, &stmp) != 0) +#endif + + if (my_stat(aFileName, &stmp, MYF(0)) != 0) { rc = false; } diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index cbc849a49f9..a62c8186174 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -29,4 +29,4 @@ libgeneral.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 20ac8e6e578..75f557b2af7 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -17,16 +17,4 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: ndb_cpcd.dsp - -ndb_cpcd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ - $(top_srcdir)/ndb/config/win-name \ - $(top_srcdir)/ndb/config/win-includes \ - $(top_srcdir)/ndb/config/win-sources \ - $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) - @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_cpcd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) +windoze-dsp: diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 5b975d9d0eb..55d3c5a578f 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -63,13 +63,13 @@ LDADD += \ windoze-dsp: ndbd.dsp ndbd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ + cat $(top_srcdir)/ndb/config/win-prg.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 4726f291d01..a1f8ff31746 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -23,4 +23,4 @@ libbackup.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am index 3a9baea8fbc..e172b9ea323 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am @@ -18,13 +18,13 @@ ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ windoze-dsp: ndb_restore.dsp ndb_restore.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_restore_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index f806183338f..dc2e12746fd 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -21,4 +21,4 @@ libcmvmi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index 40b0ecdee1f..e44524c3edd 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -21,4 +21,4 @@ libdbacc.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index c97dcb62ba5..9a0d68f8148 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -22,4 +22,4 @@ libdbdict.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 86eb4df5df1..d6ad380b806 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -20,4 +20,4 @@ libdbdih.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index 3ea54b29659..854860b269c 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -22,4 +22,4 @@ libdblqh.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index cf8f7c36fd3..98ee2639bac 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -20,4 +20,4 @@ libdbtc.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index a1cf3f0d234..e51410e6be3 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -38,4 +38,4 @@ libdbtup.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index a6bcad10a76..b5951e8ed37 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -31,4 +31,4 @@ libdbtux.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 24ed1d48086..925356c2f76 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -8,9 +8,9 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: libutil.dsp +windoze-dsp: libdbutil.dsp -libutil.dsp: Makefile \ +libdbutil.dsp: Makefile \ $(top_srcdir)/ndb/config/win-lib.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ @@ -19,5 +19,5 @@ libutil.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libutil_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbutil_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am index cbb1c1721c1..6d2b422784b 100644 --- a/ndb/src/kernel/blocks/grep/Makefile.am +++ b/ndb/src/kernel/blocks/grep/Makefile.am @@ -20,4 +20,4 @@ libgrep.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index de5e24e6be8..3f24675b2b3 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -23,4 +23,4 @@ libndbcntr.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index b33508f6bee..a22386f8612 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -24,4 +24,4 @@ libndbfs.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 280fd7caeec..278af2a7865 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -22,4 +22,4 @@ libqmgr.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 1101aa78c73..5a74dbb74eb 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -20,4 +20,4 @@ libsuma.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 85ff101b496..343063a6283 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -20,4 +20,4 @@ libtrix.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index fe78667caba..54f3de2d76d 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -22,4 +22,4 @@ liberror.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 038ea882dce..0dce9285ae3 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -40,4 +40,4 @@ libkernel.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index fab9f5d762d..f03bf155c6e 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -26,4 +26,4 @@ libmgmapi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index bf74f220b58..adbcd8c4256 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -21,6 +21,7 @@ #include "MgmtErrorReporter.hpp" #include #include "ConfigInfo.hpp" +#include const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file static void trim(char *); diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 4b66e3cc7bc..50e0b6023ad 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -45,13 +45,13 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ windoze-dsp: ndb_mgmd.dsp ndb_mgmd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ + cat $(top_srcdir)/ndb/config/win-prg.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index a49b29af275..2bd2a564223 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -52,6 +52,7 @@ #include #include #include +#include //#define MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index e3dcd682bba..9f8a851b995 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -60,4 +60,4 @@ libndbapi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 750ed720f78..3815bbc79c2 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,6 +17,7 @@ #include #include +#include typedef struct ErrorBundle { int code; diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 43f76c8c253..ac859f8abe8 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -303,6 +303,7 @@ public: * * @deprecated do not use! */ +#ifndef NDB_WIN32 inline int createTable( const char* aTableName, Uint32 aTableSize, KeyType aTupleKey, @@ -324,6 +325,7 @@ public: aMemoryType, (aStoredTable == 1 ? true : false)); } +#endif /** * Add a new attribute to a database table. diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index bc245a1413f..83dcb3dbbcf 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -24,16 +24,4 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: atrt.dsp - -atrt.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ - $(top_srcdir)/ndb/config/win-name \ - $(top_srcdir)/ndb/config/win-includes \ - $(top_srcdir)/ndb/config/win-sources \ - $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(test_PROGRAMS) - @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(atrt_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) +windoze-dsp: diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index d407ba65312..2ef23528360 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -15,9 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include - -#include #include #include diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 7d5904d897b..53a1df04c62 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -32,4 +32,4 @@ libNDBT.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 4d6d3ddc001..14976b561e8 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -57,7 +57,7 @@ NdbRestarter::NdbRestarter(const char* _addr): switch(m->type){ case MgmId_TCP: char buf[255]; - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); + BaseString::snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); addr.assign(buf); host.assign(m->name.c_str()); port = m->port; diff --git a/ndb/test/src/getarg.c b/ndb/test/src/getarg.c index 9f03af69824..58e33e81470 100644 --- a/ndb/test/src/getarg.c +++ b/ndb/test/src/getarg.c @@ -293,7 +293,7 @@ arg_printusage (struct getargs *args, col += fprintf(stderr, " %s", buf); } if (args[i].short_name) { - snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); + BaseString::snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); len += 2; len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf), 0, 0, &args[i]); -- cgit v1.2.1 From f2cbfb80a7642eccae891aba6a50e52b4edcfda1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:38:42 +0100 Subject: wl1744 - ndb win-port ndb/include/ndbapi/NdbDictionary.hpp: win-port ndb/include/ndbapi/ndb_cluster_connection.hpp: win-port ndb/include/util/SocketServer.hpp: win-port ndb/src/common/portlib/win32/NdbCondition.c: win-port ndb/src/common/portlib/win32/NdbEnv.c: win-port ndb/src/common/portlib/win32/NdbHost.c: win-port ndb/src/common/portlib/win32/NdbMem.c: win-port ndb/src/common/portlib/win32/NdbMutex.c: win-port ndb/src/common/portlib/win32/NdbSleep.c: win-port ndb/src/common/portlib/win32/NdbTCP.c: win-port ndb/src/common/portlib/win32/NdbThread.c: win-port ndb/src/common/portlib/win32/NdbTick.c: win-port ndb/src/common/util/File.cpp: win-port ndb/src/mgmsrv/ConfigInfo.cpp: win-port ndb/src/mgmsrv/InitConfigFileParser.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.hpp: win-port ndb/src/mgmsrv/Services.cpp: win-port ndb/src/mgmsrv/Services.hpp: win-port ndb/src/mgmsrv/SignalQueue.hpp: win-port ndb/src/ndbapi/NdbDictionaryImpl.hpp: win-port ndb/test/src/NdbRestarts.cpp: win-port --- ndb/include/ndbapi/NdbDictionary.hpp | 2 +- ndb/include/ndbapi/ndb_cluster_connection.hpp | 4 +- ndb/include/util/SocketServer.hpp | 2 +- ndb/src/common/portlib/win32/NdbCondition.c | 8 +--- ndb/src/common/portlib/win32/NdbEnv.c | 4 +- ndb/src/common/portlib/win32/NdbHost.c | 3 +- ndb/src/common/portlib/win32/NdbMem.c | 58 ++++++++++++++++++++++++--- ndb/src/common/portlib/win32/NdbMutex.c | 8 +--- ndb/src/common/portlib/win32/NdbSleep.c | 5 +-- ndb/src/common/portlib/win32/NdbTCP.c | 2 +- ndb/src/common/portlib/win32/NdbThread.c | 8 +--- ndb/src/common/portlib/win32/NdbTick.c | 4 +- ndb/src/common/util/File.cpp | 3 +- ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- ndb/src/mgmsrv/InitConfigFileParser.cpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 6 +-- ndb/src/mgmsrv/MgmtSrvr.hpp | 2 +- ndb/src/mgmsrv/Services.cpp | 6 +-- ndb/src/mgmsrv/Services.hpp | 2 +- ndb/src/mgmsrv/SignalQueue.hpp | 12 +++--- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- ndb/test/src/NdbRestarts.cpp | 2 +- 22 files changed, 85 insertions(+), 62 deletions(-) diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index a3115076624..217243071d0 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -710,7 +710,7 @@ public: /** * Get a specific column in the index */ - const NdbDictionary::Column * getColumn(unsigned no) const ; + const Column * getColumn(unsigned no) const ; /** * Get a specific column name in the index diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index f8e6f25ce73..6e24e084f58 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -19,9 +19,9 @@ #define CLUSTER_CONNECTION_HPP class TransporterFacade; -class LocalConfig; +struct LocalConfig; class ConfigRetriever; -class NdbThread; +struct NdbThread; extern "C" { void* run_ndb_cluster_connection_connect_thread(void*); diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index 2fad991e5f8..9d8af204391 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -98,7 +98,7 @@ public: */ void stopSessions(bool wait = false); - void foreachSession(void (*f)(SocketServer::Session*, void*), void *data); + void foreachSession(void (*f)(Session*, void*), void *data); private: struct SessionInstance { diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c index 12b508cf33b..4046db1d60a 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -15,16 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - +#include #include "NdbCondition.h" #include - struct NdbCondition { long nWaiters; diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c index 0df703a5e97..f42e685fe15 100644 --- a/ndb/src/common/portlib/win32/NdbEnv.c +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -14,10 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbEnv.h" -#include -#include const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) { diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c index f91dd1a531c..7df96c45991 100644 --- a/ndb/src/common/portlib/win32/NdbHost.c +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -15,9 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbHost.h" -#include -#include int NdbHost_GetHostName(char* buf) diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c index 274dc31353f..313ca9dff66 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include -#include -#include - +#include #include "NdbMem.h" - +#if 0 struct AWEINFO { SIZE_T dwSizeInBytesRequested; @@ -235,3 +231,53 @@ int NdbMem_MemUnlockAll() return -1; } +#endif + +void NdbMem_Create() +{ + /* Do nothing */ + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + + +void* NdbMem_Allocate(size_t size) +{ + void* mem_allocated; + assert(size > 0); + mem_allocated= (void*)malloc(size); + return mem_allocated; +} + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + (void)alignment; /* remove warning for unused parameter */ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return (void*)malloc(size); +} + + +void NdbMem_Free(void* ptr) +{ + free(ptr); +} + + +int NdbMem_MemLockAll() +{ + return 0; +} + +int NdbMem_MemUnlockAll() +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index c93384d91db..83c126abd4d 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -15,15 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - +#include #include "NdbMutex.h" - NdbMutex* NdbMutex_Create(void) { NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex)); diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c index ac0f44dd07f..8f5bdc49acd 100644 --- a/ndb/src/common/portlib/win32/NdbSleep.c +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -14,12 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbSleep.h" -#include - - int NdbSleep_MilliSleep(int milliseconds) { diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c index 483a53bd606..b936cd2db6c 100644 --- a/ndb/src/common/portlib/win32/NdbTCP.c +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbTCP.h" int diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c index ae3c74be70d..98db0d5c287 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -14,13 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include -#include -#include - +#include #include "NdbThread.h" - +#include #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c index e3a67d8437d..4430cbf419b 100644 --- a/ndb/src/common/portlib/win32/NdbTick.c +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -14,9 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include +#include #include "NdbTick.h" +//#include /* #define FILETIME_PER_MICROSEC 10 diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 15698db3bc9..937b8c0fa59 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -17,6 +17,7 @@ #include #include + #include #include @@ -28,13 +29,11 @@ bool File_class::exists(const char* aFileName) { bool rc = true; - #ifdef USE_MY_STAT_STRUCT struct my_stat stmp; #else struct stat stmp; #endif - if (my_stat(aFileName, &stmp, MYF(0)) != 0) { rc = false; diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 41280b907c4..486e152819a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3177,7 +3177,7 @@ transform(InitConfigFileParser::Context & ctx, Uint64 oldVal; require(ctx.m_currentSection->get(oldName, &oldVal)); - Uint64 newVal = (Uint64)(oldVal * mul + add); + Uint64 newVal = (Uint64)((Int64)oldVal * mul + add); if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){ ctx.reportError("Unable to handle deprication, new value not within bounds" "%s %s - [%s] starting at line: %d", diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index adbcd8c4256..01d5afae381 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -386,7 +386,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s, errno = 0; char* p; - long long v = strtoll(s, &p, log10base); + Int64 v = strtoll(s, &p, log10base); if (errno != 0) return false; diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 2bd2a564223..e86cfcb8e4b 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -124,7 +124,7 @@ MgmtSrvr::signalRecvThreadRun() while(!_isStopThread) { SigMatch *handler = NULL; NdbApiSignal *signal = NULL; - if(m_signalRecvQueue.waitFor(siglist, handler, signal, DEFAULT_TIMEOUT)) { + if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) { if(handler->function != 0) (this->*handler->function)(signal); } @@ -2652,7 +2652,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, int p_type; unsigned val_32; - unsigned long long val_64; + Uint64 val_64; const char * val_char; do { p_type = 0; @@ -2714,7 +2714,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, template class Vector; #if __SUNPRO_CC != 0x560 -template bool SignalQueue::waitFor(Vector&, SigMatch*&, NdbApiSignal*&, unsigned); +template bool SignalQueue::waitFor(Vector&, SigMatch**, NdbApiSignal**, unsigned); #endif template class MutexVector; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index b3257491123..c70b6a0a90f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -663,7 +663,7 @@ private: */ static void signalReceivedNotification(void* mgmtSrvr, NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); /** * Called from "outside" of MgmtSrvr when a DB process has died. diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 0394c4e80bb..47dde6c11d3 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -29,7 +29,7 @@ #include #include - +#include #include "Services.hpp" extern bool g_StopServer; @@ -282,8 +282,8 @@ MgmApiSession::runSession() { /* Backwards compatibility for old NDBs that still use * the old "GET CONFIG" command. */ - - for(size_t i=0; i bool waitFor(Vector &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout = DEFAULT_TIMEOUT); private: NdbMutex *m_mutex; /* Locks all data in SignalQueue */ @@ -75,8 +75,8 @@ private: template bool SignalQueue::waitFor(Vector &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout) { Guard g(m_mutex); @@ -88,8 +88,8 @@ SignalQueue::waitFor(Vector &t, for(size_t i = 0; i < t.size(); i++) { if(t[i].check(m_signalQueueHead->signal)) { - handler = &t[i]; - signal = pop(); + * handler = &t[i]; + * signal = pop(); return true; } } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 62d2a951f28..a47dae1bbb1 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -321,7 +321,7 @@ private: friend class Ndb; static void execSignal(void* dictImpl, class NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); static void execNodeStatus(void* dictImpl, Uint32, bool alive, bool nfCompleted); diff --git a/ndb/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp index b649a60d98b..607e48c4126 100644 --- a/ndb/test/src/NdbRestarts.cpp +++ b/ndb/test/src/NdbRestarts.cpp @@ -445,7 +445,7 @@ int twoNodeFailure(NdbRestarter& _restarter, << ") secs " << endl; NdbSleep_SecSleep(seconds); - randomId = (random() % _restarter.getNumDbNodes()); + randomId = (rand() % _restarter.getNumDbNodes()); nodeId = _restarter.getDbNodeId(randomId); g_info << _restart->m_name << ": node = "<< nodeId << endl; -- cgit v1.2.1 From c87d525f6a504767de56103486871ed2ce2c9f5b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 22:39:24 +0100 Subject: wl1744 - ndb win port improve ndb_global.h configure.in: check for some more includes ndb/include/ndb_global.h.in: better ndb_global.h.in --- configure.in | 2 +- ndb/include/ndb_global.h.in | 38 ++++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in index 55cd7edfca8..a4dfdfb9333 100644 --- a/configure.in +++ b/configure.in @@ -771,7 +771,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ - sys/ioctl.h malloc.h sys/malloc.h linux/config.h) + sys/ioctl.h malloc.h sys/malloc.h linux/config.h sys/resource.h sys/param.h) #-------------------------------------------------------------------- # Check for system libraries. Adds the library to $LIBS diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index af7f9383461..d89bf9c29d2 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -10,17 +10,20 @@ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #define NDB_WIN32 #include -#include -#include - #define PATH_MAX 256 #define DIR_SEPARATOR "\\" #define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" - +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#define HAVE_STRCASECMP +#define strcasecmp(a,b) _strcmpi(a,b) +#define strncasecmp(a,b) _strncmpi(a,b) #pragma warning(disable: 4503 4786) - #else #undef NDB_WIN32 +#define DIR_SEPARATOR "/" +#endif + #include #include @@ -29,18 +32,24 @@ #endif #include #include -#include #include + #ifdef HAVE_STDARG_H #include #endif + #ifdef TIME_WITH_SYS_TIME #include #endif + #ifdef HAVE_FCNTL_H #include #endif + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #ifdef HAVE_SYS_STAT_H #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) #undef _INCLUDE_AES_SOURCE @@ -50,18 +59,19 @@ #include #endif #endif + +#ifdef HAVE_SYS_RESOURCE_H #include +#endif + #ifdef HAVE_SYS_WAIT_H #include #endif + #ifdef HAVE_SYS_MMAN_H #include #endif -#define DIR_SEPARATOR "/" - -#endif - #ifndef HAVE_STRDUP extern char * strdup(const char *s); #endif @@ -94,6 +104,10 @@ extern int ndb_init(void); extern void ndb_end(int); #define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} +#ifdef __cplusplus +} +#endif + #ifdef SCO #ifndef PATH_MAX @@ -102,8 +116,4 @@ extern void ndb_end(int); #endif /* SCO */ -#ifdef __cplusplus -} -#endif - #endif -- cgit v1.2.1 From 4d51f987bdf155caeeedb0075cf8d69a258311d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 08:48:31 +0100 Subject: wl1744 - ndb on windoze ndb/test/src/getarg.c: fix --- ndb/config/win-prg.am | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++ ndb/test/src/getarg.c | 3 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 ndb/config/win-prg.am diff --git a/ndb/config/win-prg.am b/ndb/config/win-prg.am new file mode 100644 index 00000000000..10a8cfbca02 --- /dev/null +++ b/ndb/config/win-prg.am @@ -0,0 +1,98 @@ +# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=@name@ - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDB_WIN32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDB_WIN32" /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@release_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"release/@name@-opt.exe" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /Fr /YX +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@debug_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"debug/@name@.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" + +@sources@ + +# End Target +# End Project diff --git a/ndb/test/src/getarg.c b/ndb/test/src/getarg.c index 58e33e81470..5b67eb6343d 100644 --- a/ndb/test/src/getarg.c +++ b/ndb/test/src/getarg.c @@ -35,6 +35,7 @@ #include #include "getarg.h" +#include #ifndef HAVE_STRLCPY static size_t @@ -293,7 +294,7 @@ arg_printusage (struct getargs *args, col += fprintf(stderr, " %s", buf); } if (args[i].short_name) { - BaseString::snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); + basestring_snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); len += 2; len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf), 0, 0, &args[i]); -- cgit v1.2.1 From 48b47b41c51de6ce4d0995f01aa9408c7c43d778 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 09:18:26 +0100 Subject: wl1744 - more script fixes ndb/Makefile.am: remove SCCS-files --- ndb/Makefile.am | 4 ++-- ndb/config/make-win-dsw.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 ndb/config/make-win-dsw.sh diff --git a/ndb/Makefile.am b/ndb/Makefile.am index a0b8efa7bb4..32c821383e6 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -24,6 +24,6 @@ windoze: windoze-dsp: all-windoze-dsp: windoze - find . -name '*.dsp' | xargs unix2dos + find . -name '*.dsp' | grep -v SCCS | xargs unix2dos $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw - tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp'` + tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS` diff --git a/ndb/config/make-win-dsw.sh b/ndb/config/make-win-dsw.sh new file mode 100755 index 00000000000..b0613620f8a --- /dev/null +++ b/ndb/config/make-win-dsw.sh @@ -0,0 +1,42 @@ + +cat < + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +EOF +done + +cat< +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + +EOF -- cgit v1.2.1 From c63ae27eb81b7a55d8c941b0e38efdafc5833db5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 10:59:00 +0100 Subject: wl1744 - recommit stuff lost in corrupt clone ndb/config/win-libraries: recommit stuff lost in corrupt clone ndb/config/win-sources: recommit stuff lost in corrupt clone --- ndb/config/win-libraries | 24 +++++++++++++++++++----- ndb/config/win-sources | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries index 91951957340..c7a6fb696ee 100755 --- a/ndb/config/win-libraries +++ b/ndb/config/win-libraries @@ -3,6 +3,9 @@ dst=$1 shift +type=$1 +shift + add_lib(){ echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"` } @@ -13,17 +16,28 @@ out_tls_rel= out_tls_deb= for i in $* do +# mysql VC++ project files have for some unknown reason +# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir) +# the same goes for mysys and strings + lib=$i + case $i in + *libdbug.a | *libmysys.a | *libmystrings.a) + lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'` + echo "Changing from $i to $lib" + ;; + esac + if [ `echo $i | grep -c gcc` -eq 0 ] then - out_rel="${out_rel} `add_lib lib_release $i`" - out_deb="${out_deb} `add_lib lib_debug $i`" - out_tls_rel="${out_tls_rel} `add_lib lib_release $i _tls`" - out_tls_deb="${out_tls_deb} `add_lib lib_debug $i _tls`" + out_rel="${out_rel} `add_lib lib_release $lib`" + out_deb="${out_deb} `add_lib lib_debug $lib`" + out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`" + out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`" fi done fix(){ - echo "# ADD BASE LIB32 $*\n# ADD LIB32 $*\n" + echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n" } if [ "$out_rel" ] diff --git a/ndb/config/win-sources b/ndb/config/win-sources index 688ecb8ebc4..a383bb0e613 100755 --- a/ndb/config/win-sources +++ b/ndb/config/win-sources @@ -4,5 +4,5 @@ dst=$1 shift out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'` -sed -e "s/@sources@/$out/g" $dst > /tmp/$dst.$$ +sed -e "s!@sources@!$out!g" $dst > /tmp/$dst.$$ mv /tmp/$dst.$$ $dst -- cgit v1.2.1 From 8f145e4cbd5151155132a127434390218c0cf2e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 10:43:17 +0100 Subject: wl1744 - ndb on windows ndb/config/win-lib.am: removed TLS stuff (which I don't know what it is) ndb/include/kernel/signaldata/UtilLock.hpp: Made stuff public ndb/include/ndb_global.h.in: better defines for strcasecmp ndb/src/common/transporter/Transporter.cpp: Use NDB_INVALID_SOCKET ndb/src/common/util/SocketClient.cpp: Use NDB_INVALID_SOCKET ndb/src/kernel/vm/Callback.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/Configuration.cpp: Removed extra (bug) semi-colon ndb/src/kernel/vm/Mutex.cpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/Mutex.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/SectionReader.cpp: Use correct struct-type ndb/src/kernel/vm/SectionReader.hpp: Use correct struct-type ndb/src/kernel/vm/SimulatedBlock.cpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/SimulatedBlock.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/mgmclient/Makefile.am: Add mgm client to windoze ndb/test/src/Makefile.am: Fix lib --- ndb/config/win-lib.am | 63 +----------------- ndb/include/kernel/signaldata/UtilLock.hpp | 24 +++---- ndb/include/ndb_global.h.in | 4 +- ndb/src/common/transporter/Transporter.cpp | 2 +- ndb/src/common/util/SocketClient.cpp | 20 +++--- ndb/src/kernel/vm/Callback.hpp | 7 -- ndb/src/kernel/vm/Configuration.cpp | 10 +-- ndb/src/kernel/vm/Mutex.cpp | 53 ++++++++------- ndb/src/kernel/vm/Mutex.hpp | 102 +++++++---------------------- ndb/src/kernel/vm/SectionReader.cpp | 2 +- ndb/src/kernel/vm/SectionReader.hpp | 2 +- ndb/src/kernel/vm/SimulatedBlock.cpp | 2 +- ndb/src/kernel/vm/SimulatedBlock.hpp | 69 ++++++++++++++++++- ndb/src/mgmclient/Makefile.am | 26 +++++++- ndb/test/src/Makefile.am | 2 +- 15 files changed, 181 insertions(+), 207 deletions(-) diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am index cae10b9e8d0..05ac1ec8a40 100644 --- a/ndb/config/win-lib.am +++ b/ndb/config/win-lib.am @@ -19,8 +19,6 @@ CFG=@name@ - Win32 Debug !MESSAGE !MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "@name@ - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") -!MESSAGE "@name@ - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -54,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_release\@name@.lib" +# ADD LIB32 /nologo /out:".\lib_release\@name@.lib" @release_libs@ !ELSEIF "$(CFG)" == "@name@ - Win32 Debug" @@ -81,72 +79,15 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_debug\@name@.lib" +# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib" @debug_libs@ -!ELSEIF "$(CFG)" == "@name@ - Win32 TLS_DEBUG" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "@name@___Win32_TLS_DEBUG" -# PROP BASE Intermediate_Dir "@name@___Win32_TLS_DEBUG" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "@name@___Win32_TLS_DEBUG" -# PROP Intermediate_Dir "@name@___Win32_TLS_DEBUG" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c -# ADD BASE CPP @includes@ -# ADD CPP @includes@ -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" -@tls_debug_libs@ - -!ELSEIF "$(CFG)" == "@name@ - Win32 TLS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "@name@___Win32_TLS" -# PROP BASE Intermediate_Dir "@name@___Win32_TLS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "@name@___Win32_TLS" -# PROP Intermediate_Dir "@name@___Win32_TLS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c -# ADD BASE CPP @includes@ -# ADD CPP @includes@ -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" -@tls_release_libs@ - !ENDIF # Begin Target # Name "@name@ - Win32 Release" # Name "@name@ - Win32 Debug" -# Name "@name@ - Win32 TLS_DEBUG" -# Name "@name@ - Win32 TLS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/ndb/include/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp index 1cac467daa0..318024fd706 100644 --- a/ndb/include/kernel/signaldata/UtilLock.hpp +++ b/ndb/include/kernel/signaldata/UtilLock.hpp @@ -39,7 +39,7 @@ public: enum RequestInfo { TryLock = 1 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -63,7 +63,7 @@ class UtilLockConf { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -95,7 +95,7 @@ public: LockAlreadyHeld = 4 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -119,7 +119,7 @@ class UtilUnlockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -143,7 +143,7 @@ class UtilUnlockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -171,7 +171,7 @@ public: NoSuchLock = 1, NotLockOwner = 2 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -200,7 +200,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -229,7 +229,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -251,7 +251,7 @@ class UtilCreateLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -275,7 +275,7 @@ class UtilDestroyLockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -303,7 +303,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -325,7 +325,7 @@ class UtilDestroyLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index d89bf9c29d2..e1169ded02b 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -16,8 +16,8 @@ #define snprintf _snprintf #define vsnprintf _vsnprintf #define HAVE_STRCASECMP -#define strcasecmp(a,b) _strcmpi(a,b) -#define strncasecmp(a,b) _strncmpi(a,b) +#define strcasecmp _strcmpi +#define strncasecmp _strncmpi #pragma warning(disable: 4503 4786) #else #undef NDB_WIN32 diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index e68bc86718e..ee25d97feef 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -95,7 +95,7 @@ Transporter::connect_client() { return true; NDB_SOCKET_TYPE sockfd = m_socket_client->connect(); - if (sockfd < 0) + if (sockfd == NDB_INVALID_SOCKET) return false; // send info about own id diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index 50e60956b94..38df1417eb8 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA m_auth= sa; m_port= port; m_server_name= strdup(server_name); - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; } SocketClient::~SocketClient() { if (m_server_name) free(m_server_name); - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); if (m_auth) delete m_auth; @@ -42,7 +42,7 @@ SocketClient::~SocketClient() bool SocketClient::init() { - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); memset(&m_servaddr, 0, sizeof(m_servaddr)); @@ -63,32 +63,32 @@ SocketClient::init() NDB_SOCKET_TYPE SocketClient::connect() { - if (m_sockfd < 0) + if (m_sockfd == NDB_INVALID_SOCKET) { if (!init()) { #ifdef VM_TRACE ndbout << "SocketClient::connect() failed " << m_server_name << " " << m_port << endl; #endif - return -1; + return NDB_INVALID_SOCKET; } } const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); if (r == -1) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } if (m_auth) { if (!m_auth->client_authenticate(m_sockfd)) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } } NDB_SOCKET_TYPE sockfd= m_sockfd; - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; return sockfd; } diff --git a/ndb/src/kernel/vm/Callback.hpp b/ndb/src/kernel/vm/Callback.hpp index bf1ae5968d3..6a619ba7859 100644 --- a/ndb/src/kernel/vm/Callback.hpp +++ b/ndb/src/kernel/vm/Callback.hpp @@ -20,12 +20,5 @@ /** * Block callbacks */ -typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, - Uint32 callbackData, - Uint32 returnCode); -struct Callback { - CallbackFunction m_callbackFunction; - Uint32 m_callbackData; -}; #endif diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 05a5aaf1c76..aecb5581d06 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -279,18 +279,18 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, #ifdef NDB_WIN32 char* szFilePart; if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) || - (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)); + (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)) #else if((::realpath(path, buf2) == NULL)|| (::access(buf2, W_OK) != 0)) #endif { - ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); - } - + ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); + } + if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR)) strcat(buf2, DIR_SEPARATOR); - + return strdup(buf2); } diff --git a/ndb/src/kernel/vm/Mutex.cpp b/ndb/src/kernel/vm/Mutex.cpp index 1dbc6e7ec4a..aab9e74312b 100644 --- a/ndb/src/kernel/vm/Mutex.cpp +++ b/ndb/src/kernel/vm/Mutex.cpp @@ -19,48 +19,51 @@ #include "Mutex.hpp" #include -MutexManager::MutexManager(class SimulatedBlock & block) +SimulatedBlock::MutexManager::MutexManager(class SimulatedBlock & block) : m_block(block), m_activeMutexes(m_mutexPool) { } bool -MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ +SimulatedBlock::MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ return m_mutexPool.setSize(maxNoOfActiveMutexes); } Uint32 -MutexManager::getSize() const { +SimulatedBlock::MutexManager::getSize() const { return m_mutexPool.getSize(); } bool -MutexManager::seize(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::seize(ActiveMutexPtr& ptr){ return m_activeMutexes.seize(ptr); } void -MutexManager::release(Uint32 activeMutexPtrI){ +SimulatedBlock::MutexManager::release(Uint32 activeMutexPtrI){ m_activeMutexes.release(activeMutexPtrI); } void -MutexManager::getPtr(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::getPtr(ActiveMutexPtr& ptr){ m_activeMutexes.getPtr(ptr); } BlockReference -MutexManager::reference() const { +SimulatedBlock::MutexManager::reference() const { return m_block.reference(); } void -MutexManager::progError(int line, int err_code, const char* extra) { +SimulatedBlock::MutexManager::progError(int line, + int err_code, + const char* extra) +{ m_block.progError(line, err_code, extra); } void -MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ UtilCreateLockReq * req = (UtilCreateLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -78,7 +81,7 @@ MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ UtilCreateLockRef * ref = (UtilCreateLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -91,7 +94,7 @@ MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ UtilCreateLockConf * conf = (UtilCreateLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -105,7 +108,7 @@ MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ void -MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ UtilDestroyLockReq * req = (UtilDestroyLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -123,7 +126,7 @@ MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ UtilDestroyLockRef * ref = (UtilDestroyLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -135,7 +138,7 @@ MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ UtilDestroyLockConf * conf = (UtilDestroyLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -148,7 +151,7 @@ MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ void -MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -166,7 +169,7 @@ MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -184,7 +187,7 @@ MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_REF(Signal* signal){ UtilLockRef * ref = (UtilLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -196,7 +199,7 @@ MutexManager::execUTIL_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_CONF(Signal* signal){ UtilLockConf * conf = (UtilLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -210,7 +213,7 @@ MutexManager::execUTIL_LOCK_CONF(Signal* signal){ } void -MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ UtilUnlockReq * req = (UtilUnlockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; req->senderRef = m_block.reference(); @@ -227,7 +230,7 @@ MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ UtilUnlockRef * ref = (UtilUnlockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -239,7 +242,7 @@ MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ UtilUnlockConf * conf = (UtilUnlockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -251,8 +254,9 @@ MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ } void -Mutex::release(MutexManager& mgr, Uint32 activePtrI, Uint32 mutexId){ - MutexManager::ActiveMutexPtr ptr; +Mutex::release(SimulatedBlock::MutexManager& mgr, + Uint32 activePtrI, Uint32 mutexId){ + SimulatedBlock::MutexManager::ActiveMutexPtr ptr; ptr.i = activePtrI; mgr.getPtr(ptr); if(ptr.p->m_gsn == 0 && ptr.p->m_mutexId == mutexId){ @@ -272,7 +276,8 @@ Mutex::unlock(){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ - Callback c = { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; + SimulatedBlock::Callback c = + { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; m_ptr.p->m_callback = c; m_mgr.unlock(m_signal, m_ptr); m_ptr.setNull(); // Remove reference diff --git a/ndb/src/kernel/vm/Mutex.hpp b/ndb/src/kernel/vm/Mutex.hpp index 40e3fb56b4f..7a16046188c 100644 --- a/ndb/src/kernel/vm/Mutex.hpp +++ b/ndb/src/kernel/vm/Mutex.hpp @@ -22,63 +22,6 @@ class Mutex; -class MutexManager { - friend class Mutex; - friend class SimulatedBlock; - friend class DbUtil; -public: - MutexManager(class SimulatedBlock &); - - bool setSize(Uint32 maxNoOfActiveMutexes); - Uint32 getSize() const ; // Get maxNoOfActiveMutexes - -private: - /** - * core interface - */ - struct ActiveMutex { - Uint32 m_gsn; // state - Uint32 m_mutexId; - Uint32 m_mutexKey; - Callback m_callback; - union { - Uint32 nextPool; - Uint32 nextList; - }; - Uint32 prevList; - }; - typedef Ptr ActiveMutexPtr; - - bool seize(ActiveMutexPtr& ptr); - void release(Uint32 activeMutexPtrI); - - void getPtr(ActiveMutexPtr& ptr); - - void create(Signal*, ActiveMutexPtr&); - void destroy(Signal*, ActiveMutexPtr&); - void lock(Signal*, ActiveMutexPtr&); - void trylock(Signal*, ActiveMutexPtr&); - void unlock(Signal*, ActiveMutexPtr&); - -private: - void execUTIL_CREATE_LOCK_REF(Signal* signal); - void execUTIL_CREATE_LOCK_CONF(Signal* signal); - void execUTIL_DESTORY_LOCK_REF(Signal* signal); - void execUTIL_DESTORY_LOCK_CONF(Signal* signal); - void execUTIL_LOCK_REF(Signal* signal); - void execUTIL_LOCK_CONF(Signal* signal); - void execUTIL_UNLOCK_REF(Signal* signal); - void execUTIL_UNLOCK_CONF(Signal* signal); - - SimulatedBlock & m_block; - ArrayPool m_mutexPool; - DLList m_activeMutexes; - - BlockReference reference() const; - void progError(int line, int err_code, const char* extra = 0); -}; - - /** * MutexHandle - A "reference" to a mutex * - Should be used together with Mutex @@ -89,7 +32,7 @@ public: MutexHandle(Uint32 id); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: const Uint32 m_mutexId; @@ -106,7 +49,7 @@ public: MutexHandle2(); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: Uint32 m_activeMutexPtrI; @@ -117,33 +60,34 @@ private: */ class Mutex { public: - Mutex(Signal*, MutexManager & mgr, MutexHandle &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle &); template - Mutex(Signal*, MutexManager & mgr, MutexHandle2 &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle2 &); ~Mutex(); void release(); bool isNull() const ; - bool lock(Callback & callback); - bool trylock(Callback & callback); - void unlock(Callback & callback); + bool lock(SimulatedBlock::Callback & callback); + bool trylock(SimulatedBlock::Callback & callback); + void unlock(SimulatedBlock::Callback & callback); void unlock(); // Ignore callback - bool create(Callback & callback); - bool destroy(Callback & callback); + bool create(SimulatedBlock::Callback & callback); + bool destroy(SimulatedBlock::Callback & callback); private: Signal* m_signal; - MutexManager & m_mgr; + SimulatedBlock::MutexManager & m_mgr; const Uint32 m_mutexId; Uint32 & m_srcPtrI; - MutexManager::ActiveMutexPtr m_ptr; + SimulatedBlock::MutexManager::ActiveMutexPtr m_ptr; public: - static void release(MutexManager&, Uint32 activePtrI, Uint32 mutexId); + static void release(SimulatedBlock::MutexManager&, + Uint32 activePtrI, Uint32 mutexId); }; inline @@ -159,7 +103,7 @@ MutexHandle::isNull() const { inline void -MutexHandle::release(MutexManager & mgr){ +MutexHandle::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, m_mutexId); m_activeMutexPtrI = RNIL; @@ -183,7 +127,7 @@ MutexHandle2::isNull() const { template inline void -MutexHandle2::release(MutexManager & mgr){ +MutexHandle2::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, MutexId); m_activeMutexPtrI = RNIL; @@ -192,7 +136,8 @@ MutexHandle2::release(MutexManager & mgr){ inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(mh.m_mutexId), @@ -204,7 +149,8 @@ Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) template inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle2 & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle2 & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(MutexId), @@ -236,7 +182,7 @@ Mutex::isNull() const { inline bool -Mutex::lock(Callback & callback){ +Mutex::lock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -253,7 +199,7 @@ Mutex::lock(Callback & callback){ inline bool -Mutex::trylock(Callback & callback){ +Mutex::trylock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -270,7 +216,7 @@ Mutex::trylock(Callback & callback){ inline void -Mutex::unlock(Callback & callback){ +Mutex::unlock(SimulatedBlock::Callback & callback){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ @@ -285,7 +231,7 @@ Mutex::unlock(Callback & callback){ inline bool -Mutex::create(Callback & callback){ +Mutex::create(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -302,7 +248,7 @@ Mutex::create(Callback & callback){ inline bool -Mutex::destroy(Callback & callback){ +Mutex::destroy(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; diff --git a/ndb/src/kernel/vm/SectionReader.cpp b/ndb/src/kernel/vm/SectionReader.cpp index 9e1cbc855e6..dd474a49e50 100644 --- a/ndb/src/kernel/vm/SectionReader.cpp +++ b/ndb/src/kernel/vm/SectionReader.cpp @@ -26,7 +26,7 @@ #endif SectionReader::SectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ diff --git a/ndb/src/kernel/vm/SectionReader.hpp b/ndb/src/kernel/vm/SectionReader.hpp index 17eade24a66..b51006b6128 100644 --- a/ndb/src/kernel/vm/SectionReader.hpp +++ b/ndb/src/kernel/vm/SectionReader.hpp @@ -21,7 +21,7 @@ class SectionReader { public: - SectionReader(class SegmentedSectionPtr &, + SectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); void reset(); diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index e6b97771d36..94fd5769406 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -1598,7 +1598,7 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg, } } -Callback SimulatedBlock::TheEmptyCallback = {0, 0}; +SimulatedBlock::Callback SimulatedBlock::TheEmptyCallback = {0, 0}; void SimulatedBlock::sendFragmentedSignal(BlockReference ref, diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 7972cb39746..fd59fef49db 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -41,7 +41,6 @@ #include "ArrayPool.hpp" #include "DLHashTable.hpp" #include "Callback.hpp" -#include "Mutex.hpp" #include "SafeCounter.hpp" #include "MetaData.hpp" @@ -104,6 +103,14 @@ public: * */ inline void executeFunction(GlobalSignalNumber gsn, Signal* signal); +public: + typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, + Uint32 callbackData, + Uint32 returnCode); + struct Callback { + CallbackFunction m_callbackFunction; + Uint32 m_callbackData; + }; protected: static Callback TheEmptyCallback; void execute(Signal* signal, Callback & c, Uint32 returnCode); @@ -405,7 +412,63 @@ private: DLList c_linearFragmentSendList; DLList c_segmentedFragmentSendList; -public: +public: + class MutexManager { + friend class Mutex; + friend class SimulatedBlock; + friend class DbUtil; + public: + MutexManager(class SimulatedBlock &); + + bool setSize(Uint32 maxNoOfActiveMutexes); + Uint32 getSize() const ; // Get maxNoOfActiveMutexes + + private: + /** + * core interface + */ + struct ActiveMutex { + Uint32 m_gsn; // state + Uint32 m_mutexId; + Uint32 m_mutexKey; + Callback m_callback; + union { + Uint32 nextPool; + Uint32 nextList; + }; + Uint32 prevList; + }; + typedef Ptr ActiveMutexPtr; + + bool seize(ActiveMutexPtr& ptr); + void release(Uint32 activeMutexPtrI); + + void getPtr(ActiveMutexPtr& ptr); + + void create(Signal*, ActiveMutexPtr&); + void destroy(Signal*, ActiveMutexPtr&); + void lock(Signal*, ActiveMutexPtr&); + void trylock(Signal*, ActiveMutexPtr&); + void unlock(Signal*, ActiveMutexPtr&); + + private: + void execUTIL_CREATE_LOCK_REF(Signal* signal); + void execUTIL_CREATE_LOCK_CONF(Signal* signal); + void execUTIL_DESTORY_LOCK_REF(Signal* signal); + void execUTIL_DESTORY_LOCK_CONF(Signal* signal); + void execUTIL_LOCK_REF(Signal* signal); + void execUTIL_LOCK_CONF(Signal* signal); + void execUTIL_UNLOCK_REF(Signal* signal); + void execUTIL_UNLOCK_CONF(Signal* signal); + + SimulatedBlock & m_block; + ArrayPool m_mutexPool; + DLList m_activeMutexes; + + BlockReference reference() const; + void progError(int line, int err_code, const char* extra = 0); + }; + MutexManager c_mutexMgr; void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal); @@ -688,5 +751,7 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \ addRecSignalImpl(gsn, (ExecFunction)f, force);\ } +#include "Mutex.hpp" + #endif diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index 88bd3c4f529..e4242b4cd80 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -24,4 +24,28 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: ndb_mgm.dsp libndbmgmclient.dsp + +ndb_mgm.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgm_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +libndbmgmclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbmgmclient_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 53a1df04c62..289633b060a 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -32,4 +32,4 @@ libNDBT.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB -- cgit v1.2.1 From 1f947d4ba8fb3870d9f5b2334a69c9ea5116ba69 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 07:20:30 +0100 Subject: wl1744 - ndb on windows ndb/include/ndb_global.h.in: remove defines and put them into basestring ndb/src/common/logger/FileLogHandler.cpp: fix ndb/src/common/logger/Logger.cpp: fix ndb/src/common/portlib/win32/NdbMutex.c: fix ndb/src/common/util/basestring_vsnprintf.c: fix ndb/src/mgmapi/mgmapi.cpp: fix ndb/src/mgmsrv/MgmtSrvr.cpp: fix ndb/src/mgmsrv/Services.cpp: fix ndb/test/ndbapi/Makefile.am: fix ndb/tools/Makefile.am: fix --- ndb/include/ndb_global.h.in | 3 - ndb/src/common/logger/FileLogHandler.cpp | 4 +- ndb/src/common/logger/Logger.cpp | 10 ++- ndb/src/common/portlib/win32/NdbMutex.c | 3 +- ndb/src/common/util/basestring_vsnprintf.c | 34 ++++----- ndb/src/mgmapi/mgmapi.cpp | 4 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 2 +- ndb/src/mgmsrv/Services.cpp | 6 +- ndb/test/ndbapi/Makefile.am | 63 ++++++++++++++++- ndb/tools/Makefile.am | 106 ++++++++++++++++++++++++++++- 10 files changed, 197 insertions(+), 38 deletions(-) diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index e1169ded02b..aefb319730c 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -13,11 +13,8 @@ #define PATH_MAX 256 #define DIR_SEPARATOR "\\" #define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" -#define snprintf _snprintf -#define vsnprintf _vsnprintf #define HAVE_STRCASECMP #define strcasecmp _strcmpi -#define strncasecmp _strncmpi #pragma warning(disable: 4503 4786) #else #undef NDB_WIN32 diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 29172ff93ad..98b2848feba 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -206,9 +206,9 @@ FileLogHandler::setMaxSize(const BaseString &size) { long val = strtol(size.c_str(), &end, 0); /* XXX */ if(size.c_str() == end) return false; - if(strncasecmp("M", end, 1) == 0) + if(end[0] == 'M') val *= 1024*1024; - if(strncasecmp("k", end, 1) == 0) + if(end[0] == 'k') val *= 1024; m_maxFileSize = val; diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 00a2fae67bc..0e2d204cefa 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -183,13 +183,17 @@ Logger::addHandler(const BaseString &logstring) { LogHandler *handler = NULL; - if(type == "SYSLOG") { +#ifndef NDB_WIN32 + if(type == "SYSLOG") + { handler = new SysLogHandler(); - } else if(type == "FILE") + } else +#endif + if(type == "FILE") handler = new FileLogHandler(); else if(type == "CONSOLE") handler = new ConsoleLogHandler(); - + if(handler == NULL) return false; if(!handler->parseParams(params)) diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index 83c126abd4d..e6d1f081e9a 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -65,7 +65,8 @@ int NdbMutex_Trylock(NdbMutex* p_mutex) int result = -1; if(p_mutex) { - result = (TryEnterCriticalSection(p_mutex) ? 0 : -1); + result = NdbMutex_Lock(p_mutex); + //(TryEnterCriticalSection(p_mutex) ? 0 : -1); } return result; } diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 8a58ca0fe5c..58203e33bd1 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -20,10 +20,12 @@ #include #include +#ifdef _WINDOWS +#define SNPRINTF_RETURN_TRUNC +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif -/* - #define SNPRINTF_RETURN_TRUNC -*/ int basestring_snprintf(char *str, size_t size, const char *format, ...) { @@ -35,16 +37,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) return(ret); } -#ifdef HAVE_SNPRINTF - #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) -#else - #define SNPRINTF_RETURN_TRUNC - /* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) - * we would like to use my_vsnprintf but it does not have enough features - * Let's hope vsnprintf works anyways - */ - #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) -#endif #ifdef SNPRINTF_RETURN_TRUNC static char basestring_vsnprintf_buf[16*1024]; #endif @@ -54,22 +46,22 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) if (size == 0) { #ifdef SNPRINTF_RETURN_TRUNC - return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, - sizeof(basestring_vsnprintf_buf), - format, ap); + return vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); #else char buf[1]; - return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap); + return vsnprintf(buf, 1, format, ap); #endif } { - int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); + int ret= vsnprintf(str, size, format, ap); #ifdef SNPRINTF_RETURN_TRUNC if (ret == size-1 || ret == -1) { - ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, - sizeof(basestring_vsnprintf_buf), - format, ap); + ret= vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); } #endif return ret; diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 66f0dbb1842..22abc4f7f4c 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -368,7 +368,7 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) */ SocketClient s(handle->hostname, handle->port); const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { + if (sockfd == NDB_INVALID_SOCKET) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to %s", mgmsrv); return -1; @@ -1082,7 +1082,7 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) SocketClient s(handle->hostname, handle->port); const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { + if (sockfd == NDB_INVALID_SOCKET) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to"); return -1; diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index e86cfcb8e4b..8306b4d92f1 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -532,7 +532,7 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, { MgmStatService::StatListener se; - se.m_socket = -1; + se.m_socket = NDB_INVALID_SOCKET; for(size_t t = 0; t= 0; i--){ if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)){ - if(m_clients[i].m_socket >= 0 && + if(m_clients[i].m_socket != NDB_INVALID_SOCKET && println_socket(m_clients[i].m_socket, MAX_WRITE_TIMEOUT, m_text) == -1){ copy.push_back(m_clients[i].m_socket); @@ -1318,7 +1318,7 @@ MgmStatService::add_listener(const StatListener& client){ void MgmStatService::stopSessions(){ for(int i = m_clients.size() - 1; i >= 0; i--){ - if(m_clients[i].m_socket >= 0){ + if(m_clients[i].m_socket != NDB_INVALID_SOCKET){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i); } @@ -1404,7 +1404,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, m_mgmsrv.m_statisticsListner.add_listener(le); m_stop = true; - m_socket = -1; + m_socket = NDB_INVALID_SOCKET; done: m_output->println("listen event"); diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 310854edf77..33744cc0f51 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -84,4 +84,65 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: flexBench.dsp testBasic.dsp testBlobs.dsp \ + testScan.dsp + +flexBench.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ flexBench + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(flexBench_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testOIBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testOIBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testOIBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBlobs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBlobs + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBlobs_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testScan.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testScan + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testScan_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 59fc5c124be..cf78eeadac7 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -38,4 +38,108 @@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: \ + ndb_waiter.dsp \ + ndb_drop_table.dsp \ + ndb_delete_all.dsp \ + ndb_desc.dsp \ + ndb_drop_index.dsp \ + ndb_show_tables.dsp \ + ndb_select_all.dsp \ + ndb_select_count.dsp + +ndb_waiter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_waiter + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_waiter_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_table.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_table + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_table_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_delete_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_delete_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_delete_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_desc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_desc + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_desc_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_index.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_index + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_index_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_show_tables.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_show_tables + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_show_tables_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_count.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_count + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_count_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) -- cgit v1.2.1 From 9438c2ca766a176d9b03ebdba466bef37c6e1b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 18:10:07 +0200 Subject: reporting empty result added in case of max/min optimisation of ALL/ANY/SOME subqueries fixed null processing in NOT operation used in ALL subquery (Bug #6247) mysql-test/r/subselect.result: new tests of ALL/ANY wiews mysql-test/t/subselect.test: new tests of ALL/ANY wiews sql/item_cmpfunc.cc: fixed special NOT ALL processing fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_cmpfunc.h: fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_subselect.cc: reporting empty result added for max/min subqueries sql/item_subselect.h: reporting empty result added for max/min subqueries sql/item_sum.cc: reporting empty result added fox max/min aggregate functions sql/item_sum.h: reporting empty result added fox max/min aggregate functions sql/sql_class.cc: reporting empty result added for max/min subqueries sql/sql_parse.cc: reporting empty result added for max/min subqueries sql/sql_union.cc: reporting empty result added for max/min subqueries --- mysql-test/r/subselect.result | 76 ++++++++++++++++++++++++++++++++++++++++++- mysql-test/t/subselect.test | 24 +++++++++++++- sql/item_cmpfunc.cc | 46 ++++++++++++++++++++++---- sql/item_cmpfunc.h | 24 +++++++++++++- sql/item_subselect.cc | 35 ++++++++++++++++---- sql/item_subselect.h | 20 +++++++++--- sql/item_sum.cc | 13 ++++++++ sql/item_sum.h | 9 +++-- sql/sql_class.cc | 3 +- sql/sql_parse.cc | 4 +-- sql/sql_union.cc | 2 ++ 11 files changed, 230 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 32d482f5a32..58539abf68c 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -269,7 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select min(test.t2.b) from test.t2))) select * from t3 where a >= all (select b from t2); a 7 @@ -1488,6 +1488,71 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) +select * from t3 where a >= some (select b from t2); +a +6 +7 +3 +explain extended select * from t3 where a >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select min(test.t2.b) from test.t2))) +select * from t3 where a >= all (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where a >= some (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where NULL >= any (select b from t2); +a +explain extended select * from t3 where NULL >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= any (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2); +a +explain extended select * from t3 where NULL >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1990,3 +2055,12 @@ ac 700 NULL drop tables t1,t2; +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +s1 +select s1, s1 < all (select s1 from t1) from t1; +s1 s1 < all (select s1 from t1) +1 0 +NULL NULL +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e0f6fcbf515..ace1b28ef8f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -911,7 +911,20 @@ create table t3 (a int); insert into t3 values (6),(7),(3); select * from t3 where a >= all (select b from t2); explain extended select * from t3 where a >= all (select b from t2); - +select * from t3 where a >= some (select b from t2); +explain extended select * from t3 where a >= some (select b from t2); +select * from t3 where a >= all (select b from t2 group by 1); +explain extended select * from t3 where a >= all (select b from t2 group by 1); +select * from t3 where a >= some (select b from t2 group by 1); +explain extended select * from t3 where a >= some (select b from t2 group by 1); +select * from t3 where NULL >= any (select b from t2); +explain extended select * from t3 where NULL >= any (select b from t2); +select * from t3 where NULL >= any (select b from t2 group by 1); +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +select * from t3 where NULL >= some (select b from t2); +explain extended select * from t3 where NULL >= some (select b from t2); +select * from t3 where NULL >= some (select b from t2 group by 1); +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); # # optimized static ALL/ANY with grouping # @@ -1282,3 +1295,12 @@ INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,' SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; + +# +# ALL/ANY with NULL +# +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +select s1, s1 < all (select s1 from t1) from t1; +drop table t1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c36f2d191c7..d3c9cfc2c58 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -106,7 +106,7 @@ longlong Item_func_not::val_int() DBUG_ASSERT(fixed == 1); double value=args[0]->val(); null_value=args[0]->null_value; - return !null_value && value == 0 ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); } /* @@ -117,13 +117,23 @@ longlong Item_func_not_all::val_int() { DBUG_ASSERT(fixed == 1); double value= args[0]->val(); - if (abort_on_null) - { - null_value= 0; - return (args[0]->null_value || value == 0) ? 1 : 0; - } + + /* + return TRUE if there was records in underlaying select in max/min + optimisation + */ + if (empty_underlying_subquery()) + return 1; + null_value= args[0]->null_value; - return (!null_value && value == 0) ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); +} + + +bool Item_func_not_all::empty_underlying_subquery() +{ + return ((test_sum_item && !test_sum_item->any_value()) || + (test_sub_item && !test_sub_item->any_value())); } void Item_func_not_all::print(String *str) @@ -134,6 +144,28 @@ void Item_func_not_all::print(String *str) args[0]->print(str); } + +/* + special NOP for ALL subquery +*/ + +longlong Item_func_nop_all::val_int() +{ + DBUG_ASSERT(fixed == 1); + double value= args[0]->val(); + + /* + return TRUE if there was records in underlaying select in max/min + optimisation + */ + if (empty_underlying_subquery()) + return 1; + + null_value= args[0]->null_value; + return (null_value || value == 0) ? 0 : 1; +} + + /* Convert a constant expression or string to an integer. This is done when comparing DATE's of different formats and diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 69528099aa1..6834799688d 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -229,21 +229,43 @@ public: Item *neg_transformer(THD *thd); }; +class Item_maxmin_subselect; class Item_func_not_all :public Item_func_not { + /* allow to check presence od values in max/min optimisation */ + Item_sum_hybrid *test_sum_item; + Item_maxmin_subselect *test_sub_item; + bool abort_on_null; public: bool show; - Item_func_not_all(Item *a) :Item_func_not(a), abort_on_null(0), show(0) {} + Item_func_not_all(Item *a) + :Item_func_not(a), test_sum_item(0), test_sub_item(0), abort_on_null(0), + show(0) + {} virtual void top_level_item() { abort_on_null= 1; } bool top_level() { return abort_on_null; } longlong val_int(); enum Functype functype() const { return NOT_ALL_FUNC; } const char *func_name() const { return ""; } void print(String *str); + void set_sum_test(Item_sum_hybrid *item) { test_sum_item= item; }; + void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; }; + bool empty_underlying_subquery(); }; + +class Item_func_nop_all :public Item_func_not_all +{ +public: + + Item_func_nop_all(Item *a) :Item_func_not_all(a) {} + longlong val_int(); + const char *func_name() const { return ""; } +}; + + class Item_func_eq :public Item_bool_rowready_func2 { public: diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 62cd016b0df..b263b06c91f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -271,7 +271,7 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max_arg) - :Item_singlerow_subselect() + :Item_singlerow_subselect(), was_values(TRUE) { DBUG_ENTER("Item_maxmin_subselect::Item_maxmin_subselect"); max= max_arg; @@ -290,12 +290,26 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, DBUG_VOID_RETURN; } +void Item_maxmin_subselect::cleanup() +{ + /* + By default is is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + Engine exec() set it to FALSE by reset_value_registration() call. + */ + + was_values= TRUE; +} + + void Item_maxmin_subselect::print(String *str) { str->append(max?"":"", 5); Item_singlerow_subselect::print(str); } + void Item_singlerow_subselect::reset() { null_value= 1; @@ -303,6 +317,7 @@ void Item_singlerow_subselect::reset() value->null_value= 1; } + Item_subselect::trans_res Item_singlerow_subselect::select_transformer(JOIN *join) { @@ -519,7 +534,7 @@ bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit) Item_in_subselect::Item_in_subselect(Item * left_exp, st_select_lex *select_lex): - Item_exists_subselect(), transformed(0), upper_not(0) + Item_exists_subselect(), transformed(0), upper_item(0) { DBUG_ENTER("Item_in_subselect::Item_in_subselect"); left_expr= left_exp; @@ -680,7 +695,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, NULL/IS NOT NULL functions). If so, we rewrite ALL/ANY with NOT EXISTS later in this method. */ - if ((abort_on_null || (upper_not && upper_not->top_level())) && + if ((abort_on_null || (upper_item && upper_item->top_level())) && !select_lex->master_unit()->uncacheable && !func->eqne_op()) { if (substitution) @@ -694,7 +709,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, !select_lex->with_sum_func && !(select_lex->next_select())) { - Item *item; + Item_sum_hybrid *item; if (func->l_op()) { /* @@ -711,6 +726,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, */ item= new Item_sum_min(*select_lex->ref_pointer_array); } + if (upper_item) + upper_item->set_sum_test(item); *select_lex->ref_pointer_array= item; { List_iterator it(select_lex->item_list); @@ -731,10 +748,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, } else { + Item_maxmin_subselect *item; // remove LIMIT placed by ALL/ANY subquery select_lex->master_unit()->global_parameters->select_limit= HA_POS_ERROR; - subs= new Item_maxmin_subselect(this, select_lex, func->l_op()); + subs= item= new Item_maxmin_subselect(this, select_lex, func->l_op()); + if (upper_item) + upper_item->set_sub_test(item); } // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; @@ -1041,8 +1061,8 @@ Item_subselect::trans_res Item_allany_subselect::select_transformer(JOIN *join) { transformed= 1; - if (upper_not) - upper_not->show= 1; + if (upper_item) + upper_item->show= 1; return single_value_transformer(join, func); } @@ -1247,6 +1267,7 @@ int subselect_single_select_engine::exec() } if (!executed) { + item->reset_value_registration(); join->exec(); executed= 1; join->thd->where= save_where; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 764c41f33b4..bd6ede49255 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -93,7 +93,7 @@ public: return null_value; } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); - bool exec(); + virtual bool exec(); virtual void fix_length_and_dec(); table_map used_tables() const; bool const_item() const; @@ -109,6 +109,11 @@ public: engine_changed= 1; return eng == 0; } + /* + Used by max/min subquery to initialize value presence registration + mechanism. Engine call this method before rexecution query. + */ + virtual void reset_value_registration() {} friend class select_subselect; friend class Item_in_optimizer; @@ -150,13 +155,20 @@ public: }; /* used in static ALL/ANY optimisation */ +class select_max_min_finder_subselect; class Item_maxmin_subselect :public Item_singlerow_subselect { +protected: bool max; + bool was_values; // was checked at least some values public: Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max); void print(String *str); + void cleanup(); + bool any_value() { return was_values; } + void register_value() { was_values= TRUE; } + void reset_value_registration() { was_values= FALSE; } }; /* exists subselect */ @@ -204,11 +216,11 @@ protected: bool abort_on_null; bool transformed; public: - Item_func_not_all *upper_not; // point on NOT before ALL subquery + Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery Item_in_subselect(Item * left_expr, st_select_lex *select_lex); Item_in_subselect() - :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_not(0) + :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_item(0) {} @@ -249,7 +261,7 @@ public: st_select_lex *select_lex, bool all); // only ALL subquery has upper not - subs_type substype() { return upper_not?ALL_SUBS:ANY_SUBS; } + subs_type substype() { return all?ALL_SUBS:ANY_SUBS; } trans_res select_transformer(JOIN *join); void print(String *str); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3b3a6083725..cf07e136034 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -540,9 +540,22 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + /* + by default is is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + no_rows_in_result() set it to FALSE if was not results found. + */ + was_values= TRUE; DBUG_VOID_RETURN; } +void Item_sum_hybrid::no_rows_in_result() +{ + Item_sum::no_rows_in_result(); + was_values= FALSE; +} + Item *Item_sum_min::copy_or_same(THD* thd) { diff --git a/sql/item_sum.h b/sql/item_sum.h index 5aa0d37190b..9993ce1bb12 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -403,19 +403,22 @@ class Item_sum_hybrid :public Item_sum int cmp_sign; table_map used_table_cache; CHARSET_INFO *cmp_charset; + bool was_values; // was checked at least some values (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) :Item_sum(item_par), sum(0.0), sum_int(0), hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), cmp_sign(sign), used_table_cache(~(table_map) 0), - cmp_charset(&my_charset_bin) + cmp_charset(&my_charset_bin), was_values(TRUE) {} Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): Item_sum(thd, item), value(item->value), sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), - used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} + used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset), + was_values(TRUE) + {} bool fix_fields(THD *, TABLE_LIST *, Item **); table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } @@ -434,6 +437,8 @@ class Item_sum_hybrid :public Item_sum void min_max_update_real_field(); void min_max_update_int_field(); void cleanup(); + bool any_value() { return was_values; } + void no_rows_in_result(); }; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index eda60b5cfdb..e99e7ccaaeb 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1241,9 +1241,10 @@ bool select_singlerow_subselect::send_data(List &items) bool select_max_min_finder_subselect::send_data(List &items) { DBUG_ENTER("select_max_min_finder_subselect::send_data"); - Item_singlerow_subselect *it= (Item_singlerow_subselect *)item; + Item_maxmin_subselect *it= (Item_maxmin_subselect *)item; List_iterator_fast li(items); Item *val_item= li++; + it->register_value(); if (it->assigned()) { cache->store(val_item); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7420f9de100..a760956d9de 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5114,9 +5114,9 @@ Item * all_any_subquery_creator(Item *left_expr, Item_allany_subselect *it= new Item_allany_subselect(left_expr, (*cmp)(all), select_lex, all); if (all) - return it->upper_not= new Item_func_not_all(it); /* ALL */ + return it->upper_item= new Item_func_not_all(it); /* ALL */ - return it; /* ANY/SOME */ + return it->upper_item= new Item_func_nop_all(it); /* ANY/SOME */ } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index e0e8f8d42c5..b35209faeb2 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -394,6 +394,8 @@ int st_select_lex_unit::exec() if (uncacheable || !item || !item->assigned() || describe) { + if (item) + item->reset_value_registration(); if (optimized && item) { if (item->assigned()) -- cgit v1.2.1 From f0af808fccf656febcfb884047aa465bd5b005be Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 22:28:36 +0100 Subject: Fix for Bug #6794 Wrong outcome of update operation of ndb table --- mysql-test/r/ndb_update.result | 12 ++++++++++++ mysql-test/t/ndb_update.test | 22 ++++++++++++++++++++++ sql/sql_update.cc | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/ndb_update.result create mode 100644 mysql-test/t/ndb_update.test diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result new file mode 100644 index 00000000000..829e722faaa --- /dev/null +++ b/mysql-test/r/ndb_update.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +b INT NOT NULL, +c INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +UPDATE t1 set b = c; +select * from t1 order by pk1; +pk1 b c +0 0 0 +1 1 1 diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test new file mode 100644 index 00000000000..186e4a99ad3 --- /dev/null +++ b/mysql-test/t/ndb_update.test @@ -0,0 +1,22 @@ +-- source include/have_ndb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# Basic test of INSERT in NDB +# + +# +# Create a normal table with primary key +# +CREATE TABLE t1 ( + pk1 INT NOT NULL PRIMARY KEY, + b INT NOT NULL, + c INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +UPDATE t1 set b = c; +select * from t1 order by pk1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..7bcf9440bec 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -110,7 +110,8 @@ int mysql_update(THD *thd, #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.want_privilege=want_privilege; #endif - if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0)) + if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0) || + setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) DBUG_RETURN(-1); /* purecov: inspected */ if (table->timestamp_field) { -- cgit v1.2.1 From 6f2e694df0b59e21ca3a40400eea8f35bd05d90f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 22:33:01 +0100 Subject: Added better test for Bug #6794 Wrong outcome of update operation of ndb table --- mysql-test/r/ndb_update.result | 7 ++++--- mysql-test/t/ndb_update.test | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result index 829e722faaa..5df5c861cfb 100644 --- a/mysql-test/r/ndb_update.result +++ b/mysql-test/r/ndb_update.result @@ -4,9 +4,10 @@ pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL ) ENGINE=ndbcluster; -INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); UPDATE t1 set b = c; select * from t1 order by pk1; pk1 b c -0 0 0 -1 1 1 +0 1 1 +1 2 2 +2 3 3 diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 186e4a99ad3..3b0e84e2344 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -17,6 +17,6 @@ CREATE TABLE t1 ( c INT NOT NULL ) ENGINE=ndbcluster; -INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); UPDATE t1 set b = c; select * from t1 order by pk1; -- cgit v1.2.1 From 7ea16212077eb53bdc8161af1d132deae8f030ff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 06:51:30 +0300 Subject: Fix and testcase for BUG#6699 myisam/mi_rnext_same.c: Fix for BUG#6699: MERGE handler now uses mi_rnext_same() with priority queue, so skip record unpacking if buf==NULL myisammrg/myrg_rnext_same.c: Fix for BUG#6699: make myrg_rnext_same sort always sort records and return them in key order. mysql-test/r/merge.result: Test for BUG#6699 mysql-test/t/merge.test: Test for BUG#6699 --- myisam/mi_rnext_same.c | 4 ++++ myisammrg/myrg_rnext_same.c | 33 ++++++++++++++++++++++----------- mysql-test/r/merge.result | 25 +++++++++++++++++++++++++ mysql-test/t/merge.test | 18 ++++++++++++++++++ 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 1342718d6aa..a50c578e081 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -88,6 +88,10 @@ int mi_rnext_same(MI_INFO *info, byte *buf) if (my_errno == HA_ERR_KEY_NOT_FOUND) my_errno=HA_ERR_END_OF_FILE; } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } else if (!(*info->read_record)(info,info->lastpos,buf)) { info->update|= HA_STATE_AKTIV; /* Record is read */ diff --git a/myisammrg/myrg_rnext_same.c b/myisammrg/myrg_rnext_same.c index b569459b77d..997e4100acd 100644 --- a/myisammrg/myrg_rnext_same.c +++ b/myisammrg/myrg_rnext_same.c @@ -16,25 +16,36 @@ #include "myrg_def.h" + int myrg_rnext_same(MYRG_INFO *info, byte *buf) { - uint err; + int err; MI_INFO *mi; if (!info->current_table) return (HA_ERR_KEY_NOT_FOUND); - err=mi_rnext_same(info->current_table->table,buf); - if (err == HA_ERR_END_OF_FILE) + /* at first, do rnext for the table found before */ + if ((err=mi_rnext_same(info->current_table->table,NULL))) { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - mi->once_flags|= RRND_PRESERVE_LASTINX; - return mi_rrnd(mi,buf,mi->lastpos); + if (err == HA_ERR_END_OF_FILE) + { + queue_remove(&(info->by_key),0); + if (!info->by_key.elements) + return HA_ERR_END_OF_FILE; + } + else + return err; } - return err; + else + { + /* Found here, adding to queue */ + queue_top(&(info->by_key))=(byte *)(info->current_table); + queue_replaced(&(info->by_key)); + } + + /* now, mymerge's read_next is as simple as one queue_top */ + mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; + return _myrg_mi_read_record(mi,buf); } diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5755033190b..f71626221cb 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -651,3 +651,28 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t3 engine=merge union=(t1, t2) select * from t2; ERROR HY000: You can't specify target table 't2' for update in FROM clause drop table t1, t2; +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) +engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a,b,c; +a b c +1 1 0 +1 1 1 +1 2 0 +1 2 1 +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +a b c +1 2 1 +1 2 0 +1 1 1 +1 1 0 +drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 9580c1ab44c..b628cb07f7b 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -285,3 +285,21 @@ create table t3 engine=merge union=(t1, t2) select * from t1; --error 1093 create table t3 engine=merge union=(t1, t2) select * from t2; drop table t1, t2; + +# BUG#6699 : no sorting on 'ref' retrieval +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) + engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); + +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +select a,b,c from t3 force index (a) where a=1 order by a,b,c; + +# this actually wasn't affected: +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; + +drop table t1, t2, t3; + -- cgit v1.2.1 From 902419dbe0a96233bde6b6ff737d97f6e4c83e71 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 18:05:37 +0100 Subject: Bug #6697 Failure to build 4.1.7 on Visual Studio .NET [fixed] mysqld.dsp: Added custom build step for message.mc to all targets VC++Files/sql/mysqld.dsp: Added custom build step for message.mc to all targets --- VC++Files/sql/mysqld.dsp | 111 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 87 insertions(+), 24 deletions(-) diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 31c52009d9f..9c642c08808 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -924,76 +924,139 @@ SOURCE=.\message.mc !IF "$(CFG)" == "mysqld - Win32 Release" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Debug" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 nt" -# Begin Custom Build - Compiling messages -InputDir=. +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "mysqld - Win32 Max nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ENDIF # End Source File -- cgit v1.2.1 From 77e833d529acc6ade513d5dacfd9c6eda0fe6a1d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 17:35:50 +0100 Subject: compatibility fix (2G filesize limit) --- mysql-test/t/ps_1general.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index baa37dbf41d..08c1ad85fb1 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -294,12 +294,14 @@ execute stmt4; prepare stmt4 from ' show table status from test like ''t2%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 64424509439 # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 4294967295 # Bug#4288 execute stmt4; prepare stmt4 from ' show status like ''Threads_running'' '; -- cgit v1.2.1 From 863c73898fced0216b6dcadda99366fbf8f3cdfc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 21:26:14 +0000 Subject: added configure option to control extra ndb debug options, for release debug build please configure with --without-ndb-debug --- acinclude.m4 | 23 +++++++++++++++++++++++ configure.in | 17 ++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 81917372206..b43fad3ec70 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --with-ndb-port-base Base port for NDB Cluster transporters], [ndb_port_base="$withval"], [ndb_port_base="default"]) + AC_ARG_WITH([ndb-debug], + [ + --without-ndb-debug Disable special ndb debug features], + [ndb_debug="$withval"], + [ndb_debug="no"]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) @@ -1663,6 +1668,24 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac + case "$ndb_debug" in + yes ) + AC_MSG_RESULT([-- including ndb extra debug options]) + with_ndb_debug="yes" + ;; + full ) + AC_MSG_RESULT([-- including ndb extra extra debug options]) + with_ndb_debug="full" + ;; + no ) + AC_MSG_RESULT([-- not including ndb extra debug options]) + with_ndb_debug="no" + ;; + * ) + with_ndb_debug="default" + ;; + esac + AC_MSG_RESULT([done.]) ]) diff --git a/configure.in b/configure.in index 4aa4b3c9845..4e5f919af2a 100644 --- a/configure.in +++ b/configure.in @@ -3039,15 +3039,26 @@ then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" - if test "$with_debug" = "yes" + if test "$with_ndb_debug" = "default" + then + with_ndb_debug = $with_debug + fi + + if test "$with_ndb_debug" = "yes" then # Medium debug. NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - elif test "$with_debug" = "full" + elif test "$with_ndb_debug" = "full" then NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" else - NDB_DEFS="-DNDEBUG" + # no extra ndb debug but still do asserts if debug version + if test "$with_debug" = "yes" -o "$with_debug" = "full" + then + NDB_DEFS="" + else + NDB_DEFS="-DNDEBUG" + fi fi AC_SUBST([NDB_DEFS]) -- cgit v1.2.1 From f83514a0077fc63fbc446b2d9df2925652b8ec50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 23:07:08 +0100 Subject: Fix for BUG#6671 "mysqlbinlog does not show thread_id for LOAD DATA INFILE" (exactly, for the bug in 4.1 reported in this bug report). We just make Load_log_event work like Query_log_event for temp tables. sql/log_event.cc: For LOAD DATA INFILE to be preceded by SET PSEUDO_THREAD_ID if needed, in the mysqlbinlog output, we need to use the LOG_EVENT_THREAD_SPECIFIC_F flag in Load_log_event exactly like we already do in Query_log_event. --- sql/log_event.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 2fdc89504d7..e76b1d8a759 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1406,7 +1406,9 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, List &fields_arg, enum enum_duplicates handle_dup, bool using_trans) - :Log_event(thd_arg, 0, using_trans), thread_id(thd_arg->thread_id), + :Log_event(thd_arg, !thd_arg->tmp_table_used ? + 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + thread_id(thd_arg->thread_id), slave_proxy_id(thd_arg->variables.pseudo_thread_id), num_fields(0),fields(0), field_lens(0),field_block_len(0), @@ -1596,6 +1598,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, commented ? "# " : "", db); + if (flags & LOG_EVENT_THREAD_SPECIFIC_F) + fprintf(file,"%sSET @@session.pseudo_thread_id=%lu;\n", + commented ? "# " : "", (ulong)thread_id); fprintf(file, "%sLOAD DATA ", commented ? "# " : ""); if (check_fname_outside_temp_buf()) -- cgit v1.2.1 From b6aa3489fe681611a43edb5b23b72b926de30ebd Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Dec 2004 10:06:38 +0100 Subject: help text corrected --- client/mysqldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 489063ffc73..b4fa293c19c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -158,7 +158,7 @@ static struct my_option my_long_options[] = (gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compact", OPT_COMPACT, - "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables", + "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks", (gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag, -- cgit v1.2.1 From a5cc93b9235f58aefa96b23bb12cc589195ddaca Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:41:16 +1100 Subject: Add (optional) endian parameter to 'get nodeid' to warn on endian conflicts. ndb/src/mgmapi/mgmapi.cpp: Send an extra (optional) parameter to 'get nodeid' to detect potential endianness conflicts. endian: big endian: small Server will deny our nodeid request if we're not compatible. If parameter is not specified, we behave how we used to (work or fail). ndb/src/mgmsrv/Services.cpp: Add extra (optional) parameter to 'get nodeid' to detect potential endianness conflicts. endian: big endian: little we will deny the nodeid request if the endian parameter is provided and the endian doesn't match. This should preserve compatibility with all clients. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + ndb/src/mgmapi/mgmapi.cpp | 4 ++++ ndb/src/mgmsrv/Services.cpp | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index b8043910a11..6c673fdc2bd 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -192,6 +192,7 @@ serg@sergbook.mylan serg@sergbook.mysql.com sergefp@mysql.com sinisa@rhols221.adsl.netsonic.fi +stewart@mysql.com tfr@beta.frontier86.ee tfr@indrek.tfr.cafe.ee tfr@sarvik.tfr.cafe.ee diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index e22ceffe773..0768a9844af 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1690,6 +1690,9 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) { CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); + union { long l; char c[sizeof(long)]; } endian_check; + + endian_check.l = 1; int nodeid= handle->cfg._ownNodeId; @@ -1700,6 +1703,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) args.put("user", "mysqld"); args.put("password", "mysqld"); args.put("public key", "a public key"); + args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little"); const ParserRow reply[]= { MGM_CMD("get nodeid reply", NULL, ""), diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5834d40cc78..2b3fb346d72 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -132,6 +132,7 @@ ParserRow commands[] = { MGM_ARG("user", String, Mandatory, "Password"), MGM_ARG("password", String, Mandatory, "Password"), MGM_ARG("public key", String, Mandatory, "Public key"), + MGM_ARG("endian", String, Optional, "Endianness"), MGM_CMD("get version", &MgmApiSession::getVersion, ""), @@ -386,6 +387,8 @@ MgmApiSession::get_nodeid(Parser_t::Context &, const char * user; const char * password; const char * public_key; + const char * endian; + union { long l; char c[sizeof(long)]; } endian_check; args.get("version", &version); args.get("nodetype", &nodetype); @@ -394,7 +397,17 @@ MgmApiSession::get_nodeid(Parser_t::Context &, args.get("user", &user); args.get("password", &password); args.get("public key", &public_key); - + args.get("endian", &endian); + + endian_check.l = 1; + if(endian + && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) { + m_output->println(cmd); + m_output->println("result: Endianness of nodes does not match."); + m_output->println(""); + return; + } + bool compatible; switch (nodetype) { case NODE_TYPE_MGM: -- cgit v1.2.1 From 80b3339f6912dea66c98efd8b54de9f176cd7e99 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:43:02 +1100 Subject: Integrate suggestions from Tomas Ulin's mail. (r.e. reporting an error in the case of endianness mismatch). ndb/src/mgmsrv/Services.cpp: - initialise endian= 0; args.get will not set if not found - change error message to be clearer --- ndb/src/mgmsrv/Services.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 2b3fb346d72..9ee0203e454 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -387,7 +387,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, const char * user; const char * password; const char * public_key; - const char * endian; + const char * endian= NULL; union { long l; char c[sizeof(long)]; } endian_check; args.get("version", &version); @@ -403,7 +403,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, if(endian && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) { m_output->println(cmd); - m_output->println("result: Endianness of nodes does not match."); + m_output->println("result: Node does not have the same endianness as the management server."); m_output->println(""); return; } -- cgit v1.2.1 From 1b3c814d424330160bb12d03e2c47ccbcd5869df Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 10:57:22 +0400 Subject: configure.in: latin1_spanish_ci produced unknown collation error. configure.in: latin1_spanish_ci produced unknown collation error. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0d6e797f571..086a839594e 100644 --- a/configure.in +++ b/configure.in @@ -2714,7 +2714,7 @@ case $default_charset in ;; latin1) default_charset_default_collation="latin1_swedish_ci" - default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci" + default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci" ;; latin2) default_charset_default_collation="latin2_general_ci" -- cgit v1.2.1 From 88f1b90a700fcae4d918676e6e2148520655fa7b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:42:41 +0400 Subject: Fix for bug #6755 (ALTER TABLE ENABLE KEYS corrupts spatial index) myisam/mi_check.c: Spatial keys should not be filesort-ed. Specific function neede to insert key into spatial index mysql-test/r/gis-rtree.result: Appropriate test result mysql-test/t/gis-rtree.test: Test case --- myisam/mi_check.c | 10 ++++++++- mysql-test/r/gis-rtree.result | 41 +++++++++++++++++++++++++++++++++++++ mysql-test/t/gis-rtree.test | 47 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2999482549c..f7e7ffd42f6 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -26,6 +26,7 @@ #ifdef HAVE_SYS_MMAN_H #include #endif +#include "rt_index.h" #ifndef USE_RAID #define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) @@ -1465,6 +1466,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff, if (_mi_ft_add(info,i,(char*) key,buff,filepos)) goto err; } + else if (info->s->keyinfo[i].flag & HA_SPATIAL) + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (rtree_insert(info, i, key, key_length)) + goto err; + } else { uint key_length=_mi_make_key(info,i,key,buff,filepos); @@ -3987,7 +3994,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) key->seg->charset->mbmaxlen; key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; } - return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && + return (key->flag & HA_SPATIAL) || + (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > (ulonglong) myisam_max_temp_length)); } diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 3fb1a5dd31c..4ca8c379307 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -757,3 +757,44 @@ SPATIAL KEY(g) ) ENGINE=MyISAM; INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); drop table t1; +CREATE TABLE t1 ( +geoobjid INT NOT NULL, +line LINESTRING NOT NULL, +kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', +name VARCHAR(32), +SPATIAL KEY (line) +) engine=myisam; +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES +("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +ALTER TABLE t1 ENABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); +drop table t1; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 817249b7e4c..cb1627e0500 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -118,3 +118,50 @@ CREATE TABLE t1 ( INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); #select * from t1 where g Date: Mon, 6 Dec 2004 08:49:34 +0000 Subject: wixed ndb-debug option for configure --- acinclude.m4 | 10 +++++----- configure.in | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index b43fad3ec70..730ee15ed20 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1628,7 +1628,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ [ --without-ndb-debug Disable special ndb debug features], [ndb_debug="$withval"], - [ndb_debug="no"]) + [ndb_debug="default"]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) @@ -1671,18 +1671,18 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ case "$ndb_debug" in yes ) AC_MSG_RESULT([-- including ndb extra debug options]) - with_ndb_debug="yes" + have_ndb_debug="yes" ;; full ) AC_MSG_RESULT([-- including ndb extra extra debug options]) - with_ndb_debug="full" + have_ndb_debug="full" ;; no ) AC_MSG_RESULT([-- not including ndb extra debug options]) - with_ndb_debug="no" + have_ndb_debug="no" ;; * ) - with_ndb_debug="default" + have_ndb_debug="default" ;; esac diff --git a/configure.in b/configure.in index 4e5f919af2a..28d9d7c0f9c 100644 --- a/configure.in +++ b/configure.in @@ -3039,16 +3039,16 @@ then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" - if test "$with_ndb_debug" = "default" + if test "$have_ndb_debug" = "default" then - with_ndb_debug = $with_debug + have_ndb_debug=$with_debug fi - if test "$with_ndb_debug" = "yes" + if test "$have_ndb_debug" = "yes" then # Medium debug. NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - elif test "$with_ndb_debug" = "full" + elif test "$have_ndb_debug" = "full" then NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" else -- cgit v1.2.1 From 21f2d3aa3fac1fa864b9a32d0848a22931b7ec61 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 16:22:51 +0400 Subject: Fixed thar proper charset was not set in Field_set::val_str() --- mysql-test/r/ps_2myisam.result | 8 ++++---- mysql-test/r/ps_3innodb.result | 8 ++++---- mysql-test/r/ps_4heap.result | 8 ++++---- mysql-test/r/ps_5merge.result | 16 ++++++++-------- mysql-test/r/ps_6bdb.result | 8 ++++---- mysql-test/r/ps_7ndb.result | 8 ++++---- sql/field.cc | 1 + 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 42b4580643e..24c1102306f 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1941,7 +1941,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2038,7 +2038,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2126,7 +2126,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2216,7 +2216,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index bb001fe9e02..ad2912529a5 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 263b389ffa4..123e3d58b38 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1925,7 +1925,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2022,7 +2022,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2110,7 +2110,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2200,7 +2200,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 0ec296717e0..e07cb7d7c49 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1864,7 +1864,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1961,7 +1961,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2049,7 +2049,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2139,7 +2139,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -4874,7 +4874,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -4971,7 +4971,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5059,7 +5059,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5149,7 +5149,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index bb28abeda69..5f2419bdda5 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 4fe7f57973f..41c55cac0ca 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/sql/field.cc b/sql/field.cc index 90203d1935d..6dfddf6fd71 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5754,6 +5754,7 @@ String *Field_set::val_str(String *val_buffer, uint bitnr=0; val_buffer->length(0); + val_buffer->set_charset(field_charset); while (tmp && bitnr < (uint) typelib->count) { if (tmp & 1) -- cgit v1.2.1 From 04866cf0f1c9341dff58e45c5063508f83e8aeb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 14:34:02 +0100 Subject: New fix for bug#6796 Wrong outcome of update operation of ndb table --- sql/sql_update.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 37c048356cd..a52da469d9d 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -110,8 +110,7 @@ int mysql_update(THD *thd, #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.want_privilege=want_privilege; #endif - if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0) || - setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) + if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0)) DBUG_RETURN(-1); /* purecov: inspected */ if (table->timestamp_field) { @@ -126,7 +125,7 @@ int mysql_update(THD *thd, /* Check values */ table->grant.want_privilege=(SELECT_ACL & ~table->grant.privilege); #endif - if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0)) + if (setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) { free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(-1); /* purecov: inspected */ -- cgit v1.2.1 From c6b3c442a5ba34c027a7fa405620e9a1684ed50d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 14:51:10 +0100 Subject: Fix for bug#6935 table rename does not work with ndb tables --- mysql-test/r/ndb_alter_table.result | 16 +++++++++++++ mysql-test/t/ndb_alter_table.test | 17 +++++++++++++ ndb/include/ndbapi/NdbDictionary.hpp | 7 ++++++ ndb/src/ndbapi/NdbDictionary.cpp | 7 +++++- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 46 ++++++++++++++++++------------------ sql/ha_ndbcluster.cc | 40 ++++++++++++++++++------------- sql/ha_ndbcluster.h | 2 +- 7 files changed, 94 insertions(+), 41 deletions(-) diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index ee7c3b28fe2..f899d254243 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL @@ -9,6 +10,21 @@ SELECT * FROM t1; a b c 9410 9412 0 DROP TABLE t1; +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( +a INT NOT NULL, +b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +Tables_in_mysqltest +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +Tables_in_test +t1 +DROP TABLE t1; create table t1 ( col1 int not null auto_increment primary key, col2 varchar(30) not null, diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 22b1a0e476d..892443a1407 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -2,6 +2,7 @@ --disable_warnings DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; --enable_warnings # @@ -20,6 +21,22 @@ SELECT * FROM t1; DROP TABLE t1; +# +# Verfify changing table names between databases +# +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( + a INT NOT NULL, + b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +DROP TABLE t1; + # # More advanced test # diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index a3115076624..e07fc64f064 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -989,6 +989,13 @@ public: */ Table getTableForAlteration(const char * name); + /** + * Get copy a copy of a table for alteration. + * @param table Table object to alter + * @return table if successful. NULL if undefined + */ + Table getTableForAlteration(const Table &); + #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached table object diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 09d15c7f962..d1827c6895f 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -775,12 +775,17 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){ NdbDictionary::Table NdbDictionary::Dictionary::getTableForAlteration(const char * name){ - const NdbDictionary::Table * oldTable = getTable(name); + const Table * oldTable = getTable(name); return (oldTable) ? NdbDictionary::Table(*oldTable) : NdbDictionary::Table(); } +NdbDictionary::Table +NdbDictionary::Dictionary::getTableForAlteration(const Table & tab){ + return NdbDictionary::Table(tab); +} + int NdbDictionary::Dictionary::createIndex(const Index & ind) { diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 345f2caac89..393a436ff85 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1411,15 +1411,14 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) const char * originalInternalName = internalName.c_str(); BaseString externalName = impl.m_externalName; const char * originalExternalName = externalName.c_str(); - NdbTableImpl * oldTab = getTable(originalExternalName); - - if(!oldTab){ + + DBUG_ENTER("NdbDictionaryImpl::alterTable"); + if(!get_local_table_info(originalInternalName, false)){ m_error.code = 709; - return -1; + DBUG_RETURN(-1); } // Alter the table int ret = m_receiver.alterTable(m_ndb, impl); - if(ret == 0){ // Remove cached information and let it be refreshed at next access if (m_localHash.get(originalInternalName) != NULL) { @@ -1433,7 +1432,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) m_globalHash->unlock(); } } - return ret; + DBUG_RETURN(ret) } int @@ -1448,15 +1447,16 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbTableImpl & impl, bool alter) { + DBUG_ENTER("NdbDictInterface::createOrAlterTable"); unsigned i; if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ m_error.code = 4317; - return -1; + DBUG_RETURN(-1); } unsigned sz = impl.m_columns.size(); if (sz > NDB_MAX_ATTRIBUTES_IN_TABLE){ m_error.code = 4318; - return -1; + DBUG_RETURN(-1); } impl.copyNewProperties(); @@ -1491,7 +1491,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // Check max length of frm data if (impl.m_frm.length() > MAX_FRM_DATA_SIZE){ m_error.code = 1229; - return -1; + DBUG_RETURN(-1); } tmpTab.FrmLen = impl.m_frm.length(); memcpy(tmpTab.FrmData, impl.m_frm.get_data(), impl.m_frm.length()); @@ -1543,12 +1543,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // charset is defined exactly for char types if (col->getCharType() != (col->m_cs != NULL)) { m_error.code = 703; - return -1; + DBUG_RETURN(-1); } // primary key type check if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) { m_error.code = 743; - return -1; + DBUG_RETURN(-1); } // charset in upper half of precision if (col->getCharType()) { @@ -1616,7 +1616,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, } } } - return ret; + DBUG_RETURN(ret); } int @@ -1675,17 +1675,17 @@ NdbDictInterface::alterTable(NdbApiSignal* signal, LinearSectionPtr ptr[3]) int errCodes[noErrCodes] = {AlterTableRef::NotMaster, AlterTableRef::Busy}; - int r = dictSignal(signal,ptr,1, - 1/*use masternode id*/, - 100,WAIT_ALTER_TAB_REQ, - WAITFOR_RESPONSE_TIMEOUT, - errCodes, noErrCodes); - if(m_error.code == AlterTableRef::InvalidTableVersion) { - // Clear caches and try again - return INCOMPATIBLE_VERSION; - } - - return r; + int r = dictSignal(signal,ptr,1, + 1/*use masternode id*/, + 100,WAIT_ALTER_TAB_REQ, + WAITFOR_RESPONSE_TIMEOUT, + errCodes, noErrCodes); + if(m_error.code == AlterTableRef::InvalidTableVersion) { + // Clear caches and try again + return INCOMPATIBLE_VERSION; + } + + return r; } void diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6c609cd54ac..7054619fdab 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3627,9 +3627,13 @@ int ha_ndbcluster::create_index(const char *name, int ha_ndbcluster::rename_table(const char *from, const char *to) { + NDBDICT *dict; char new_tabname[FN_HEADLEN]; + const NDBTAB *orig_tab; + int result; DBUG_ENTER("ha_ndbcluster::rename_table"); + DBUG_PRINT("info", ("Renaming %s to %s", from, to)); set_dbname(from); set_tabname(from); set_tabname(to, new_tabname); @@ -3637,14 +3641,20 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); + dict= m_ndb->getDictionary(); + if (!(orig_tab= dict->getTable(m_tabname))) + ERR_RETURN(dict->getNdbError()); - int result= alter_table_name(m_tabname, new_tabname); - if (result == 0) + m_table= (void *)orig_tab; + // Change current database to that of target table + set_dbname(to); + m_ndb->setDatabaseName(m_dbname); + if (!(result= alter_table_name(new_tabname))) { - set_tabname(to); - handler::rename_table(from, to); + // Rename .ndb file + result= handler::rename_table(from, to); } - + DBUG_RETURN(result); } @@ -3653,19 +3663,16 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) Rename a table in NDB Cluster using alter table */ -int ha_ndbcluster::alter_table_name(const char *from, const char *to) +int ha_ndbcluster::alter_table_name(const char *to) { - NDBDICT *dict= m_ndb->getDictionary(); - const NDBTAB *orig_tab; + NDBDICT * dict= m_ndb->getDictionary(); + const NDBTAB *orig_tab= (const NDBTAB *) m_table; + int ret; DBUG_ENTER("alter_table_name_table"); - DBUG_PRINT("enter", ("Renaming %s to %s", from, to)); - if (!(orig_tab= dict->getTable(from))) - ERR_RETURN(dict->getNdbError()); - - NdbDictionary::Table copy_tab= dict->getTableForAlteration(from); - copy_tab.setName(to); - if (dict->alterTable(copy_tab) != 0) + NdbDictionary::Table new_tab= dict->getTableForAlteration(*orig_tab); + new_tab.setName(to); + if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); m_table= NULL; @@ -3688,7 +3695,7 @@ int ha_ndbcluster::delete_table(const char *name) if (check_ndb_connection()) DBUG_RETURN(HA_ERR_NO_CONNECTION); - + // Remove .ndb file handler::delete_table(name); DBUG_RETURN(drop_table()); } @@ -3944,6 +3951,7 @@ Ndb* check_ndb_in_thd(THD* thd) } + int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index f6c712620c1..2d7b14b2311 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -148,7 +148,7 @@ class ha_ndbcluster: public handler uint8 table_cache_type(); private: - int alter_table_name(const char *from, const char *to); + int alter_table_name(const char *to); int drop_table(); int create_index(const char *name, KEY *key_info, bool unique); int create_ordered_index(const char *name, KEY *key_info); -- cgit v1.2.1 From 1f1257bd52b7b040df3d8d3842401a885ab8b965 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 18:45:41 +0400 Subject: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). scripts/fill_help_tables.sh: percent_xxx variables added to avoid /0 error. scripts/mysql_install_db.sh: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). --net_buffer_length=16K added. sql/net_serv.cc: Typo fixed. sql/sql_parse.cc: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). Auto extend net buffer in bootstrap mode. --- scripts/fill_help_tables.sh | 12 ++++++++---- scripts/mysql_install_db.sh | 2 +- sql/net_serv.cc | 4 ++-- sql/sql_parse.cc | 22 +++++++++++++++++----- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 78dfe7b6088..51edfc8af78 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -454,10 +454,12 @@ sub print_verbose_errors print STDERR "number of help keywords - ",$count_keywords,"\n"; my $count_without_help= scalar(@without_help); + my $percent_without_help= $count_lex ? + int (($count_without_help/$count_lex)*100) : + "100"; print_bad_names(\@without_help,"lexems without help (". $count_without_help." ~ ". - (int (($count_without_help/$count_lex)*100)). - "%)"); + $percent_without_help."%)"); print_bad_names(\@description_with_at, " topics below have symbol \'@\' in their descriptions.\n". "it's probably the litter from 'texi' tags (script needs fixing)"); @@ -467,10 +469,12 @@ sub print_verbose_errors print_bad_names(\@without_description,"topics without description"); my $count_without_example= scalar(@without_example); + my $percent_without_example= $count_topics ? + int (($count_without_example/$count_topics)*100) : + "100"; print_bad_names(\@without_example,"topics without example (". $count_without_example." ~ ". - (int (($count_without_example/$count_topics)*100)). - "%)"); + $percent_without_example."%)"); } print_verbose_errors if ($verbose_option ne 0); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b4f59790e73..8b2e42bd8cd 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M" +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 5985cf63ed6..1e34ed90fee 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -165,8 +165,8 @@ my_bool net_realloc(NET *net, ulong length) if (length >= net->max_packet_size) { - DBUG_PRINT("error",("Packet too large. Max sixe: %lu", - net->max_packet_size)); + DBUG_PRINT("error", ("Packet too large. Max size: %lu", + net->max_packet_size)); net->error= 1; net->report_error= 1; net->last_errno= ER_NET_PACKET_TOO_LARGE; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3d1df80c37b..71870e2d990 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1102,13 +1102,25 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { - uint length=(uint) strlen(buff); - if (buff[length-1]!='\n' && !feof(file)) + ulong length= (ulong) strlen(buff); + while (buff[length-1] != '\n' && !feof(file)) { - send_error(thd,ER_NET_PACKET_TOO_LARGE, NullS); - thd->fatal_error(); - break; + /* + We got only a part of the current string. Will try to increase + net buffer then read the rest of the current string. + */ + if (net_realloc(&(thd->net), 2 * thd->net.max_packet)) + { + send_error(thd, thd->net.last_errno, NullS); + thd->is_fatal_error= 1; + break; + } + buff= (char*) thd->net.buff; + fgets(buff + length, thd->net.max_packet - length, file); + length+= (ulong) strlen(buff + length); } + if (thd->is_fatal_error) + break; while (length && (my_isspace(thd->charset(), buff[length-1]) || buff[length-1] == ';')) length--; -- cgit v1.2.1 From e94fc374c52478268e7de22a316e52edd66ce192 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 19:01:51 +0300 Subject: Syntax extention: 'ALTER DATABASE' without db name (after review) --- mysql-test/r/ctype_create.result | 9 +++++++++ mysql-test/t/ctype_create.test | 12 ++++++++++++ sql/sql_parse.cc | 18 ++++++++++++------ sql/sql_yacc.yy | 11 ++++++++--- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result index b35131f62a4..63bae33c6e1 100644 --- a/mysql-test/r/ctype_create.result +++ b/mysql-test/r/ctype_create.result @@ -63,3 +63,12 @@ ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET create database d1 default character set latin1 collate latin2_bin; ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1' DROP DATABASE mysqltest1; +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +drop database mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +ERROR 3D000: No database selected diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index 9a5cb025474..e97017ab416 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -86,3 +86,15 @@ create database d1 default character set latin1 collate latin2_bin; # # DROP DATABASE mysqltest1; + + +# +# Synatx: 'ALTER DATABASE' without db_name +# +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +drop database mysqltest2; +--error 1046 +ALTER DATABASE DEFAULT CHARACTER SET latin2; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3d1df80c37b..1e18771ad15 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3184,9 +3184,15 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_ALTER_DB: { - if (!strip_sp(lex->name) || check_db_name(lex->name)) + char *db= lex->name ? lex->name : thd->db; + if (!db) { - net_printf(thd, ER_WRONG_DB_NAME, lex->name); + send_error(thd, ER_NO_DB_ERROR); + goto error; + } + if (!strip_sp(db) || check_db_name(db)) + { + net_printf(thd, ER_WRONG_DB_NAME, db); break; } /* @@ -3198,21 +3204,21 @@ purposes internal to the MySQL server", MYF(0)); */ #ifdef HAVE_REPLICATION if (thd->slave_thread && - (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) || - !db_ok_with_wild_table(lex->name))) + (!db_ok(db, replicate_do_db, replicate_ignore_db) || + !db_ok_with_wild_table(db))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); break; } #endif - if (check_access(thd,ALTER_ACL,lex->name,0,1,0)) + if (check_access(thd, ALTER_ACL, db, 0, 1, 0)) break; if (thd->locked_tables || thd->active_transaction()) { send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); goto error; } - res=mysql_alter_db(thd,lex->name,&lex->create_info); + res= mysql_alter_db(thd, db, &lex->create_info); break; } case SQLCOM_SHOW_CREATE_DB: diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 49e567ab54b..e525fb2478a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -609,7 +609,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type remember_name remember_end opt_ident opt_db text_or_password - opt_constraint constraint + opt_constraint constraint ident_or_empty %type text_string opt_gconcat_separator @@ -1870,7 +1870,7 @@ alter: } alter_list {} - | ALTER DATABASE ident + | ALTER DATABASE ident_or_empty { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -1879,10 +1879,15 @@ alter: { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; - lex->name=$3.str; + lex->name= $3; }; +ident_or_empty: + /* empty */ { $$= 0; } + | ident { $$= $1.str; }; + + alter_list: | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } -- cgit v1.2.1 From 8ec6cf2cd5ed54f1336784ffe548a813cbbde172 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 20:45:32 +0400 Subject: UCS2 support in ENUM and SET, which also fixes: Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values UCS2 values are stored in HEX encoding in FRM file --- mysql-test/r/ctype_ucs.result | 56 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_ucs.test | 31 ++++++++++++++++++++++++ sql/field.cc | 19 ++++++++------- sql/item_strfunc.cc | 11 --------- sql/mysql_priv.h | 17 +++++++++++++ sql/strfunc.cc | 20 +++++++++++++--- sql/table.cc | 17 +++++++++++++ sql/unireg.cc | 22 +++++++++++++++++ 8 files changed, 170 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 70a66ddd924..ef3682c1cfc 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -525,3 +525,59 @@ use test; SET TIMESTAMP=10000; insert into t2 values (@v); drop table t2; +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +d 0064 +e 0065 +ä 00E4 +ö 00F6 +ü 00FC +drop table t1; +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +x,y 0078002C0079 +z 007A +x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC +drop table t1; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index b1d872c58a5..b8f58ab028b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -343,3 +343,34 @@ show binlog events from 79; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 drop table t2; + + +# +# Check that ucs2 works with ENUM and SET type +# +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +drop table t1; + +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 6dfddf6fd71..74252a46842 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5529,8 +5529,7 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) } /* Remove end space */ - while (length > 0 && my_isspace(system_charset_info,from[length-1])) - length--; + length= field_charset->cset->lengthsp(field_charset, from, length); uint tmp=find_type2(typelib, from, length, field_charset); if (!tmp) { @@ -5632,7 +5631,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)), val_ptr->set("", 0, field_charset); else val_ptr->set((const char*) typelib->type_names[tmp-1], - (uint) strlen(typelib->type_names[tmp-1]), + typelib->type_lengths[tmp-1], field_charset); return val_ptr; } @@ -5669,13 +5668,14 @@ void Field_enum::sql_type(String &res) const res.append("enum("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - enum_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); + enum_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, enum_item.ptr(), enum_item.length()); flag= 1; } @@ -5760,9 +5760,9 @@ String *Field_set::val_str(String *val_buffer, if (tmp & 1) { if (val_buffer->length()) - val_buffer->append(field_separator); + val_buffer->append(&field_separator, 1, &my_charset_latin1); String str(typelib->type_names[bitnr], - (uint) strlen(typelib->type_names[bitnr]), + typelib->type_lengths[bitnr], field_charset); val_buffer->append(str); } @@ -5782,13 +5782,14 @@ void Field_set::sql_type(String &res) const res.append("set("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - set_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); + set_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, set_item.ptr(), set_item.length()); flag= 1; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5a23eec5a1b..893126b7fe6 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2320,17 +2320,6 @@ String *Item_func_hex::val_str(String *str) return &tmp_value; } -inline int hexchar_to_int(char c) -{ - if (c <= '9' && c >= '0') - return c-'0'; - c|=32; - if (c <= 'f' && c >= 'a') - return c-'a'+10; - return -1; -} - - /* Convert given hex string to a binary string */ String *Item_func_unhex::val_str(String *str) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3a19a903e00..cefc77cb5d4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1200,6 +1200,23 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) } +/* + SYNOPSYS + hexchar_to_int() + convert a hex digit into number +*/ + +inline int hexchar_to_int(char c) +{ + if (c <= '9' && c >= '0') + return c-'0'; + c|=32; + if (c <= 'f' && c >= 'a') + return c-'a'+10; + return -1; +} + + /* Some functions that are different in the embedded library and the normal server diff --git a/sql/strfunc.cc b/sql/strfunc.cc index b5255e9be06..8ab6992a63a 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -53,8 +53,22 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, { const char *pos= start; uint var_len; + int mblen= 1; - for (; pos != end && *pos != field_separator; pos++) ; + if (cs && cs->mbminlen > 1) + { + for ( ; pos < end; pos+= mblen) + { + my_wc_t wc; + if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos, + (const uchar *) end)) < 1) + mblen= 1; // Not to hang on a wrong multibyte sequence + if (wc == (my_wc_t) field_separator) + break; + } + } + else + for (; pos != end && *pos != field_separator; pos++) ; var_len= (uint) (pos - start); uint find= cs ? find_type2(lib, start, var_len, cs) : find_type(lib, start, var_len, (bool) 0); @@ -66,9 +80,9 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, } else found|= ((longlong) 1 << (find - 1)); - if (pos == end) + if (pos >= end) break; - start= pos + 1; + start= pos + mblen; } } return found; diff --git a/sql/table.cc b/sql/table.cc index cb565097c0b..370ad5eff1d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -485,6 +485,23 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, charset= outparam->table_charset; bzero((char*) &comment, sizeof(comment)); } + + if (interval_nr && charset->mbminlen > 1) + { + /* Unescape UCS2 intervals from HEX notation */ + TYPELIB *interval= outparam->intervals + interval_nr - 1; + for (uint pos= 0; pos < interval->count; pos++) + { + char *from, *to; + for (from= to= (char*) interval->type_names[pos]; *from; ) + { + *to++= (char) (hexchar_to_int(*from++) << 4) + + hexchar_to_int(*from++); + } + interval->type_lengths[pos] /= 2; + } + } + *field_ptr=reg_field= make_field(record+recpos, (uint32) field_length, diff --git a/sql/unireg.cc b/sql/unireg.cc index c82fcc4abef..6d72c6af135 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -423,6 +423,28 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, if (field->interval) { uint old_int_count=int_count; + + if (field->charset->mbminlen > 1) + { + /* Escape UCS2 intervals using HEX notation */ + for (uint pos= 0; pos < field->interval->count; pos++) + { + char *dst; + uint length= field->interval->type_lengths[pos], hex_length; + const char *src= field->interval->type_names[pos]; + const char *srcend= src + length; + hex_length= length * 2; + field->interval->type_lengths[pos]= hex_length; + field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1); + for ( ; src < srcend; src++) + { + *dst++= _dig_vec_upper[((uchar) *src) >> 4]; + *dst++= _dig_vec_upper[((uchar) *src) & 15]; + } + *dst= '\0'; + } + } + field->interval_id=get_interval_id(&int_count,create_fields,field); if (old_int_count != int_count) { -- cgit v1.2.1 From e1248f4fc392d20ff34084ee913df90815d15008 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 16:26:05 -0800 Subject: Fix for crummy compiler that didn't udnerstand for declaration. Another fix for example storage engine to pass, not skip, test. mysql-test/r/have_exampledb.require: Fix for test for examples. sql/examples/ha_archive.cc: Fix for compiler that had problem with ANSI C. --- mysql-test/r/have_exampledb.require | 2 +- sql/examples/ha_archive.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require index 4b0938660fe..29d0cf8b1a6 100644 --- a/mysql-test/r/have_exampledb.require +++ b/mysql-test/r/have_exampledb.require @@ -1,2 +1,2 @@ Variable_name Value -have_exampledb YES +have_example_engine YES diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 6fbfb3f9f9d..771bf91d118 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -528,6 +528,7 @@ error: int ha_archive::write_row(byte * buf) { z_off_t written; + Field_blob **field; DBUG_ENTER("ha_archive::write_row"); statistic_increment(ha_write_count,&LOCK_status); @@ -543,7 +544,7 @@ int ha_archive::write_row(byte * buf) We should probably mark the table as damagaged if the record is written but the blob fails. */ - for (Field_blob **field=table->blob_field ; *field ; field++) + for (field= table->blob_field ; *field ; field++) { char *ptr; uint32 size= (*field)->get_length(); -- cgit v1.2.1 From d5c7d8500107271571f13baa54b246827e134143 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:49:54 +1100 Subject: Fix segmentation fault on incorrect configuration. Starting ndb_mgmd on a host which isn't in the configuration file as the ndb_mgmd (e.g. the ip address is different) would have ndb_mgmd segfault. There was a check in the code, but it was (potentially) trying to dereference null ndb/src/mgmsrv/MgmtSrvr.cpp: Don't try and print client_addr->sin_addr if client_addr is null --- ndb/src/mgmsrv/MgmtSrvr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 061aa2e0cb8..4dd1f7cf084 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2292,8 +2292,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (found_matching_type) if (found_free_node) error_string.appfmt("Connection done from wrong host ip %s.", - inet_ntoa(((struct sockaddr_in *) - (client_addr))->sin_addr)); + (client_addr)? + inet_ntoa(((struct sockaddr_in *) + (client_addr))->sin_addr):""); else error_string.appfmt("No free node id found for %s.", type_string.c_str()); -- cgit v1.2.1 From 065a07289cc0b93bef16506b267918555bb43d05 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 09:11:50 +0000 Subject: fixed clusterlog "filter" command ndb/src/mgmsrv/CommandInterpreter.cpp: removed clusterlog command ndb/src/mgmsrv/CommandInterpreter.hpp: removed clusterlog command --- ndb/include/logger/Logger.hpp | 2 +- ndb/include/mgmapi/mgmapi.h | 14 +- ndb/src/common/logger/Logger.cpp | 17 +- ndb/src/mgmapi/mgmapi.cpp | 79 ++++++-- ndb/src/mgmclient/CommandInterpreter.cpp | 304 +++++++++++++++---------------- ndb/src/mgmsrv/CommandInterpreter.cpp | 128 ------------- ndb/src/mgmsrv/CommandInterpreter.hpp | 1 - ndb/src/mgmsrv/MgmtSrvr.cpp | 16 +- ndb/src/mgmsrv/MgmtSrvr.hpp | 2 +- ndb/src/mgmsrv/Services.cpp | 5 +- 10 files changed, 249 insertions(+), 319 deletions(-) diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index c6145f2091a..f12297023b7 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -101,7 +101,7 @@ public: /** The log levels. NOTE: Could not use the name LogLevel since * it caused conflicts with another class. */ - enum LoggerLevel {LL_OFF, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, + enum LoggerLevel {LL_ON, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, LL_CRITICAL, LL_ALERT, LL_ALL}; /** diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index dc4f745adb2..5329ded4f19 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -244,7 +244,9 @@ extern "C" { * Log severities (used to filter the cluster log) */ enum ndb_mgm_clusterlog_level { - NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/ + NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1, + /* must range from 0 and up, indexes into an array */ + NDB_MGM_CLUSTERLOG_ON = 0, /*< Cluster log on*/ NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster *< developement */ @@ -264,7 +266,8 @@ extern "C" { *< corrected immediately, *< such as a corrupted system */ - NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/ + /* must be next number, works as bound in loop */ + NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities */ }; /** @@ -580,11 +583,13 @@ extern "C" { * * @param handle NDB management handle. * @param level A cluster log level to filter. + * @param enable set 1=enable 0=disable * @param reply Reply message. * @return -1 on error. */ int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* reply); /** @@ -620,6 +625,11 @@ extern "C" { int level, struct ndb_mgm_reply* reply); + ndb_mgm_clusterlog_level + ndb_mgm_match_clusterlog_level(const char * name); + const char * + ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level); + /** * Set log category and levels for the Node * diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index f6f70fbeff7..b392b966838 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -30,7 +30,7 @@ // // PUBLIC // -const char* Logger::LoggerLevelNames[] = { "OFF ", +const char* Logger::LoggerLevelNames[] = { "ON ", "DEBUG ", "INFO ", "WARNING ", @@ -46,7 +46,9 @@ Logger::Logger() : m_pSyslogHandler(NULL) { m_pHandlerList = new LogHandlerList(); - m_logLevels[LL_INFO] = true; + disable(LL_ALL); + enable(LL_ON); + enable(LL_INFO); } Logger::~Logger() @@ -227,6 +229,13 @@ Logger::removeAllHandlers() bool Logger::isEnable(LoggerLevel logLevel) const { + if (logLevel == LL_ALL) + { + for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + if (!m_logLevels[i]) + return false; + return true; + } return m_logLevels[logLevel]; } @@ -235,7 +244,7 @@ Logger::enable(LoggerLevel logLevel) { if (logLevel == LL_ALL) { - for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + for (unsigned i = 0; i < MAX_LOG_LEVELS; i++) { m_logLevels[i] = true; } @@ -337,7 +346,7 @@ Logger::debug(const char* pMsg, ...) const void Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const { - if (m_logLevels[LL_OFF] == false && m_logLevels[logLevel]) + if (m_logLevels[LL_ON] && m_logLevels[logLevel]) { LogHandler* pHandler = NULL; while ( (pHandler = m_pHandlerList->next()) != NULL) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index e22ceffe773..2bcb3c74848 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -914,21 +914,67 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list) return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0); } +static const char *clusterlog_level_names[]= + { "enabled", "debug", "info", "warning", "error", "critical", "alert" }; + +struct ndb_mgm_clusterlog_levels +{ + const char* name; + enum ndb_mgm_clusterlog_level level; +} clusterlog_levels[] = { + { clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON }, + { clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG }, + { clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO }, + { clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING }, + { clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR }, + { clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL }, + { clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT }, + { "all", NDB_MGM_CLUSTERLOG_ALL }, + { 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL }, +}; + +extern "C" +ndb_mgm_clusterlog_level +ndb_mgm_match_clusterlog_level(const char * name) +{ + if(name == 0) + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + + for(int i = 0; clusterlog_levels[i].name !=0 ; i++) + if(strcasecmp(name, clusterlog_levels[i].name) == 0) + return clusterlog_levels[i].level; + + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; +} + +extern "C" +const char * +ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level) +{ + int i= (int)level; + if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL) + return clusterlog_level_names[i]; + for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++) + if(clusterlog_levels[i].level == level) + return clusterlog_levels[i].name; + return 0; +} + extern "C" unsigned int * ndb_mgm_get_logfilter(NdbMgmHandle handle) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter"); - static Uint32 enabled[7] = {0,0,0,0,0,0,0}; + static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0}; const ParserRow getinfo_reply[] = { MGM_CMD("clusterlog", NULL, ""), - MGM_ARG("enabled", Int, Mandatory, ""), - MGM_ARG("debug", Int, Mandatory, ""), - MGM_ARG("info", Int, Mandatory, ""), - MGM_ARG("warning", Int, Mandatory, ""), - MGM_ARG("error", Int, Mandatory, ""), - MGM_ARG("critical", Int, Mandatory, ""), - MGM_ARG("alert", Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""), }; CHECK_HANDLE(handle, NULL); CHECK_CONNECTED(handle, NULL); @@ -938,10 +984,8 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle) reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); CHECK_REPLY(reply, NULL); - const char *names[] = { "enabled", "debug", "info", "warning", "error", - "critical", "alert" }; - for(int i=0; i < 7; i++) { - reply->get(names[i], &enabled[i]); + for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + reply->get(clusterlog_level_names[i], &enabled[i]); } return enabled; } @@ -950,6 +994,7 @@ extern "C" int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_filter_clusterlog"); @@ -964,6 +1009,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, Properties args; args.put("level", level); + args.put("enable", enable); const Properties *reply; reply = ndb_mgm_call(handle, filter_reply, "set logfilter", &args); @@ -971,11 +1017,14 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, BaseString result; reply->get("result", result); - if(strcmp(result.c_str(), "1") == 0) { + + if (strcmp(result.c_str(), "1") == 0) + retval = 1; + else if (strcmp(result.c_str(), "0") == 0) retval = 0; - } else { + else + { SET_ERROR(handle, EINVAL, result.c_str()); - retval = -1; } delete reply; return retval; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 7ef62da9bb3..3a9b3c47376 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -264,9 +264,9 @@ static const char* helpText = "START BACKUP Start backup\n" "ABORT BACKUP Abort backup\n" "SHUTDOWN Shutdown all processes in cluster and quit\n" -"CLUSTERLOG ON Enable Cluster logging\n" -"CLUSTERLOG OFF Disable Cluster logging\n" -"CLUSTERLOG FILTER Toggle severity filter on/off\n" +"CLUSTERLOG ON [] ... Enable Cluster logging\n" +"CLUSTERLOG OFF [] ... Disable Cluster logging\n" +"CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" " START Start DB node (started with -n)\n" " RESTART [-n] [-i] Restart DB node\n" @@ -666,11 +666,9 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcasecmp(command, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", command, processId); (this->*fun)(processId, allAfterSecondToken, false); - ndbout << endl; } + ndbout << endl; } /** @@ -733,12 +731,8 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, return; } NdbAutoPtr ap1((char*)cl); - while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) { - if(strcasecmp(cmd, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", cmd, nodeId); + while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // while } } @@ -1137,144 +1131,130 @@ CommandInterpreter::executeConnect(char* parameters) void CommandInterpreter::executeClusterLog(char* parameters) { + DBUG_ENTER("CommandInterpreter::executeClusterLog"); int i; - if (parameters != 0 && strlen(parameters) != 0) { - enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr ap1(tmpString); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); + if (emptyString(parameters)) + { + ndbout << "Missing argument." << endl; + DBUG_VOID_RETURN; + } + + enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcasecmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, sizeof(name), item); - - if (strcasecmp(item, "ALL") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALL; - } else if (strcasecmp(item, "ALERT") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALERT; - } else if (strcasecmp(item, "CRITICAL") == 0) { - severity = NDB_MGM_CLUSTERLOG_CRITICAL; - } else if (strcasecmp(item, "ERROR") == 0) { - severity = NDB_MGM_CLUSTERLOG_ERROR; - } else if (strcasecmp(item, "WARNING") == 0) { - severity = NDB_MGM_CLUSTERLOG_WARNING; - } else if (strcasecmp(item, "INFO") == 0) { - severity = NDB_MGM_CLUSTERLOG_INFO; - } else if (strcasecmp(item, "DEBUG") == 0) { - severity = NDB_MGM_CLUSTERLOG_DEBUG; - } else if (strcasecmp(item, "OFF") == 0) { - severity = NDB_MGM_CLUSTERLOG_OFF; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if(ndb_mgm_filter_clusterlog(m_mgmsrv, severity, NULL)) { - if(strcasecmp(name, "ALL") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcasecmp(name, "OFF") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } else { - if(strcasecmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcasecmp(name, "OFF") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } + char * tmpString = my_strdup(parameters,MYF(MY_WME)); + My_auto_ptr ap1(tmpString); + char * tmpPtr = 0; + char * item = strtok_r(tmpString, " ", &tmpPtr); + int enable; - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcasecmp(item, "INFO") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - const char* names[] = {"ENABLED", "DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if(enabled[0]) - ndbout << "Cluster logging is disabled." << endl; + Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); + if(enabled == NULL) { + ndbout << "Couldn't get status" << endl; + printError(); + DBUG_VOID_RETURN; + } - - for(i = 0; i<7;i++) - printf("enabled[%d] = %d\n", i, enabled[i]); - ndbout << "Severities enabled: "; - for(i = 1; i < 7; i++) { - if(enabled[i]) - ndbout << names[i] << " "; - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcasecmp(item, "OFF") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - if(!enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcasecmp(item, "ON") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Could not get status" << endl; - printError(); - return; - } - if(enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - + /******************** + * CLUSTERLOG INFO + ********************/ + if (strcasecmp(item, "INFO") == 0) { + DBUG_PRINT("info",("INFO")); + if(enabled[0] == 0) + { + ndbout << "Cluster logging is disabled." << endl; + DBUG_VOID_RETURN; + } +#if 0 + for(i = 0; i<7;i++) + printf("enabled[%d] = %d\n", i, enabled[i]); +#endif + ndbout << "Severities enabled: "; + for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i); + if (str == 0) + { + DBUG_ASSERT(false); + continue; } - } else { - ndbout << "Invalid argument." << endl; + if(enabled[i]) + ndbout << BaseString(str).ndb_toupper() << " "; } - + ndbout << endl; + DBUG_VOID_RETURN; + + } + else if (strcasecmp(item, "FILTER") == 0 || + strcasecmp(item, "TOGGLE") == 0) + { + DBUG_PRINT("info",("TOGGLE")); + enable= -1; + } + else if (strcasecmp(item, "OFF") == 0) + { + DBUG_PRINT("info",("OFF")); + enable= 0; + } else if (strcasecmp(item, "ON") == 0) { + DBUG_PRINT("info",("ON")); + enable= 1; } else { - ndbout << "Missing argument." << endl; + ndbout << "Invalid argument." << endl; + DBUG_VOID_RETURN; + } + + int res_enable; + item = strtok_r(NULL, " ", &tmpPtr); + if (item == NULL) { + res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv, + NDB_MGM_CLUSTERLOG_ON, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << "Cluster logging is " << (res_enable ? "enabled.":"disabled") << endl; + DBUG_VOID_RETURN; } + + do { + severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + if (strcasecmp(item, "ALL") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALL; + } else if (strcasecmp(item, "ALERT") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALERT; + } else if (strcasecmp(item, "CRITICAL") == 0) { + severity = NDB_MGM_CLUSTERLOG_CRITICAL; + } else if (strcasecmp(item, "ERROR") == 0) { + severity = NDB_MGM_CLUSTERLOG_ERROR; + } else if (strcasecmp(item, "WARNING") == 0) { + severity = NDB_MGM_CLUSTERLOG_WARNING; + } else if (strcasecmp(item, "INFO") == 0) { + severity = NDB_MGM_CLUSTERLOG_INFO; + } else if (strcasecmp(item, "DEBUG") == 0) { + severity = NDB_MGM_CLUSTERLOG_DEBUG; + } else if (strcasecmp(item, "OFF") == 0 || + strcasecmp(item, "ON") == 0) { + if (enable < 0) // only makes sense with toggle + severity = NDB_MGM_CLUSTERLOG_ON; + } + if (severity == NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL) { + ndbout << "Invalid severity level: " << item << endl; + DBUG_VOID_RETURN; + } + + res_enable = ndb_mgm_filter_clusterlog(m_mgmsrv, severity, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << item << " " << (res_enable ? "enabled":"disabled") << endl; + + item = strtok_r(NULL, " ", &tmpPtr); + } while(item != NULL); + + DBUG_VOID_RETURN; } //***************************************************************************** @@ -1404,7 +1384,7 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, if(all) ndbout << "NDB Cluster is being restarted." << endl; else - ndbout_c("Database node %d is being restarted.", processId); + ndbout_c("Node %d is being restarted.", processId); } } @@ -1451,7 +1431,7 @@ CommandInterpreter::executeStatus(int processId, const char* parameters, bool all) { if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; + ndbout_c("No parameters expected to this command."); return; } @@ -1482,7 +1462,7 @@ CommandInterpreter::executeStatus(int processId, ndbout << "Node " << processId << ": " << status_string(status); switch(status){ case NDB_MGM_NODE_STATUS_STARTING: - ndbout << " (Phase " << startPhase << ")" ; + ndbout << " (Phase " << startPhase << ")"; break; case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: ndbout << " (Phase " << startPhase << ")"; @@ -1495,6 +1475,8 @@ CommandInterpreter::executeStatus(int processId, getMajor(version) , getMinor(version), getBuild(version)); + else + ndbout << endl; } @@ -1506,7 +1488,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, bool all) { (void) all; - + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } BaseString tmp(parameters); Vector spec; tmp.split(spec, "="); @@ -1532,6 +1517,8 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, return; } + ndbout << "Executing LOGLEVEL on node " << processId << flush; + struct ndb_mgm_reply reply; int result; result = ndb_mgm_set_loglevel_node(m_mgmsrv, @@ -1541,11 +1528,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, &reply); if (result < 0) { - ndbout_c("Executing LOGLEVEL on node %d failed.", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing LOGLEVEL on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } @@ -1840,36 +1826,36 @@ CommandInterpreter::executeEventReporting(int processId, spec[0].trim().ndb_toupper(); int category = ndb_mgm_match_event_category(spec[0].c_str()); if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ - category = atoi(spec[0].c_str()); - if(category < NDB_MGM_MIN_EVENT_CATEGORY || + if(!convert(spec[0].c_str(), category) || + category < NDB_MGM_MIN_EVENT_CATEGORY || category > NDB_MGM_MAX_EVENT_CATEGORY){ ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; return; } } - - int level = atoi(spec[1].c_str()); - if(level < 0 || level > 15){ + + int level; + if (!convert(spec[1].c_str(),level)) + { ndbout << "Invalid level: " << spec[1].c_str() << endl; return; } - + + ndbout << "Executing CLUSTERLOG on node " << processId << flush; struct ndb_mgm_reply reply; int result; - result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv, - processId, // fast fix - pekka + processId, (ndb_mgm_event_category)category, level, &reply); if (result != 0) { - ndbout_c("Executing CLUSTERLOG on node %d failed", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing CLUSTERLOG on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 02bf24f1d9c..1b882cd2e71 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -157,10 +157,6 @@ int CommandInterpreter::readAndExecute() { executeShow(allAfterFirstToken); return true; } - else if (strcmp(firstToken, "CLUSTERLOG") == 0) { - executeClusterLog(allAfterFirstToken); - return true; - } else if(strcmp(firstToken, "START") == 0 && allAfterFirstToken != 0 && strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ @@ -472,130 +468,6 @@ void CommandInterpreter::executeShow(char* parameters) { } } - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeClusterLog(char* parameters) { - - if (parameters != 0 && strlen(parameters) != 0) { - int severity = 7; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, 12, item); - - if (strcmp(item, "ALL") == 0) { - severity = 7; - } else if (strcmp(item, "ALERT") == 0) { - severity = 6; - } else if (strcmp(item, "CRITICAL") == 0) { - severity = 5; - } else if (strcmp(item, "ERROR") == 0) { - severity = 4; - } else if (strcmp(item, "WARNING") == 0) { - severity = 3; - } else if (strcmp(item, "INFO") == 0) { - severity = 2; - } else if (strcmp(item, "DEBUG") == 0) { - severity = 1; - } else if (strcmp(item, "OFF") == 0) { - severity = 0; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - free(tmpString); - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if (_mgmtSrvr.setEventLogFilter(severity)) { - if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } else { - if(strcmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcmp(name, "OFF") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } - - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcmp(item, "INFO") == 0) { - const char* names[] = {"DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - ndbout << "Cluster logging is disabled." << endl; - } - - ndbout << "Severities enabled: "; - for (int i = 0; i < 6; i++) { - if (_mgmtSrvr.isEventLogFilterEnabled(i + 1)) { - ndbout << names[i] << " "; - } - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcmp(item, "OFF") == 0) { - if (!_mgmtSrvr.isEventLogFilterEnabled(0)) { // ON - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcmp(item, "ON") == 0) { - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - } - - } else { - ndbout << "Invalid argument." << endl; - } - - } else { - ndbout << "Missing argument." << endl; - } -} - void stopCallback(int nodeId, void * anyData, int errCode){ if(errCode == 0){ diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 1a5184361d6..74e5c2e95be 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -125,7 +125,6 @@ private: void executeShow(char* parameters); void executeRun(char* parameters); void executeInfo(char* parameters); - void executeClusterLog(char* parameters); public: void executeStop(int processId, const char* parameters, bool all); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 061aa2e0cb8..4a9bfac3b6c 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -226,7 +226,8 @@ MgmtSrvr::startEventLog() clusterLog); } if(!g_EventLogger.addHandler(logdest)) { - ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl; + ndbout << "Warning: could not add log destination \"" + << logdest.c_str() << "\"" << endl; } } @@ -244,18 +245,19 @@ public: }; bool -MgmtSrvr::setEventLogFilter(int severity) +MgmtSrvr::setEventLogFilter(int severity, int enable) { - bool enabled = true; Logger::LoggerLevel level = (Logger::LoggerLevel)severity; - if (g_EventLogger.isEnable(level)) { + if (enable > 0) { + g_EventLogger.enable(level); + } else if (enable == 0) { + g_EventLogger.disable(level); + } else if (g_EventLogger.isEnable(level)) { g_EventLogger.disable(level); - enabled = false; } else { g_EventLogger.enable(level); } - - return enabled; + return g_EventLogger.isEnable(level); } bool diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 1afb0848ecc..4d5631d3eb6 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -122,7 +122,7 @@ public: * @param serverity the log level/serverity. * @return true if the severity was enabled. */ - bool setEventLogFilter(int severity); + bool setEventLogFilter(int severity, int enable); /** * Returns true if the log level/severity is enabled. diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5834d40cc78..0707fff24ec 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -217,6 +217,7 @@ ParserRow commands[] = { MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""), MGM_ARG("level", Int, Mandatory, "Severety level"), + MGM_ARG("enable", Int, Mandatory, "1=disable, 0=enable, -1=toggle"), MGM_CMD("config lock", &MgmApiSession::configLock, ""), @@ -1190,10 +1191,12 @@ void MgmApiSession::setLogFilter(Parser_t::Context &ctx, const class Properties &args) { Uint32 level; + Uint32 enable; args.get("level", &level); + args.get("enable", &enable); - int result = m_mgmsrv.setEventLogFilter(level); + int result = m_mgmsrv.setEventLogFilter(level, enable); m_output->println("set logfilter reply"); m_output->println("result: %d", result); -- cgit v1.2.1 From a700754e7108aa51631949f236e4cd965f7fda42 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 10:27:22 +0100 Subject: Removed getTableForAlteration --- ndb/include/ndbapi/NdbDictionary.hpp | 14 -------------- ndb/src/ndbapi/NdbDictionary.cpp | 13 ------------- ndb/test/ndbapi/testDict.cpp | 6 +++--- sql/ha_ndbcluster.cc | 2 +- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index e07fc64f064..75296e919f0 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -982,20 +982,6 @@ public: */ const Table * getTable(const char * name); - /** - * Get table with given name for alteration. - * @param name Name of table to alter - * @return table if successful. NULL if undefined - */ - Table getTableForAlteration(const char * name); - - /** - * Get copy a copy of a table for alteration. - * @param table Table object to alter - * @return table if successful. NULL if undefined - */ - Table getTableForAlteration(const Table &); - #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached table object diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index d1827c6895f..f88bbc907a6 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -773,19 +773,6 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){ m_impl.removeCachedObject(* t); } -NdbDictionary::Table -NdbDictionary::Dictionary::getTableForAlteration(const char * name){ - const Table * oldTable = getTable(name); - return (oldTable) ? - NdbDictionary::Table(*oldTable) - : NdbDictionary::Table(); -} - -NdbDictionary::Table -NdbDictionary::Dictionary::getTableForAlteration(const Table & tab){ - return NdbDictionary::Table(tab); -} - int NdbDictionary::Dictionary::createIndex(const Index & ind) { diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 0a43bb02fff..5f88342705a 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1211,7 +1211,7 @@ runTableRename(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1280,7 +1280,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1377,7 +1377,7 @@ runTableRenameSR(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7054619fdab..775ab96d1a1 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3670,7 +3670,7 @@ int ha_ndbcluster::alter_table_name(const char *to) int ret; DBUG_ENTER("alter_table_name_table"); - NdbDictionary::Table new_tab= dict->getTableForAlteration(*orig_tab); + NdbDictionary::Table new_tab= *orig_tab; new_tab.setName(to); if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); -- cgit v1.2.1 From 154e64ac92daa754b0e173f37132897112941220 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 14:51:13 +0400 Subject: A fix (bug #6993: Max myisam_data_pointer_size limited to 7). --- mysql-test/r/variables.result | 4 ++++ mysql-test/t/variables.test | 7 +++++++ sql/mysqld.cc | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b2a97ce3e48..01db98648bd 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -478,3 +478,7 @@ t1 CREATE TABLE `t1` ( `c3` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; +Variable_name Value +myisam_data_pointer_size 8 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index d0a78c157c3..7dc07f9313e 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -355,3 +355,10 @@ create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; show create table t1; drop table t1; + +# +# Bug #6993: myisam_data_pointer_size +# + +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index da834080bc0..607dd6a101a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5004,7 +5004,7 @@ The minimum value for this variable is 4096.", "Default pointer size to be used for MyISAM tables.", (gptr*) &myisam_data_pointer_size, (gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, - 4, 2, 7, 0, 1, 0}, + 4, 2, 8, 0, 1, 0}, {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, "Used to help MySQL to decide when to use the slow but safe key cache index create method.", (gptr*) &global_system_variables.myisam_max_extra_sort_file_size, -- cgit v1.2.1 From 9d48570cd45f3381891583544d091703a21e7310 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 12:08:20 +0100 Subject: two fixes for potential security bugs --- sql/log.cc | 18 ++++++++++-------- sql/sql_class.cc | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index b2d015c1a14..b46a8de056e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1797,6 +1797,7 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); + VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -1804,7 +1805,7 @@ bool flush_error_log() the current error file. */ strmov(strmov(err_temp, err_renamed),"-tmp"); - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { freopen(err_temp,"a+",stderr); @@ -1817,20 +1818,21 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); + my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); my_close(fd, MYF(0)); } - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); } else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); - if (freopen(log_error_file,"a+",stdout)) - freopen(log_error_file,"a+",stderr); - else - result= 1; + my_rename(log_error_file,err_renamed,MYF(0)); + if (freopen(log_error_file,"a+",stdout)) + freopen(log_error_file,"a+",stderr); + else + result= 1; #endif + VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c829778151b..9dd75b32d5d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -564,7 +564,7 @@ select_export::prepare(List &list) return 1; } /* Create the file world readable */ - if ((file=my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0) + if ((file=my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return 1; #ifdef HAVE_FCHMOD (void) fchmod(file,0666); // Because of umask() @@ -803,7 +803,7 @@ select_dump::prepare(List &list __attribute__((unused))) return 1; } /* Create the file world readable */ - if ((file=my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0) + if ((file=my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return 1; #ifdef HAVE_FCHMOD (void) fchmod(file,0666); // Because of umask() -- cgit v1.2.1 From 9f48eedb4e2251dbc30019ad012cb808385072ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 14:08:56 +0300 Subject: Fix for bug #6840: Default value is not checked in ALTER column SET DEFAULT 'x' --- mysql-test/r/type_enum.result | 8 +++++++ mysql-test/t/type_enum.test | 15 ++++++++++++- sql/sql_table.cc | 50 ++++++++++++++++++++++--------------------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 2ccf32367fb..e5239dcf769 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1737,3 +1737,11 @@ def test t1 t1 c c 254 3 0 Y 384 0 8 a b c Y NULL NULL drop table t1; +create table t1 (a enum('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; +create table t1 (a set('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 3a5b12b91e4..6b2183df069 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -111,5 +111,18 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; --enable_metadata select * from t1; ---disable metadata +--disable_metadata +drop table t1; + +# +# Bug #6840 Default value is not checked in ALTER column SET DEFAULT 'x' +# +create table t1 (a enum('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; +drop table t1; + +create table t1 (a set('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 12193e8736b..c798760cfa8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -485,43 +485,45 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } - if ((sql_field->sql_type == FIELD_TYPE_SET || - sql_field->sql_type == FIELD_TYPE_ENUM) && !sql_field->interval) + if (sql_field->sql_type == FIELD_TYPE_SET || + sql_field->sql_type == FIELD_TYPE_ENUM) { uint32 dummy; CHARSET_INFO *cs= sql_field->charset; - TYPELIB *interval; + TYPELIB *interval= sql_field->interval; /* Create typelib from interval_list, and if necessary convert strings from client character set to the column character set. */ - - interval= sql_field->interval= typelib(sql_field->interval_list); - List_iterator it(sql_field->interval_list); - String conv, *tmp; - for (uint i= 0; (tmp= it++); i++) + if (!interval) { - if (String::needs_conversion(tmp->length(), tmp->charset(), cs, &dummy)) + interval= sql_field->interval= typelib(sql_field->interval_list); + List_iterator it(sql_field->interval_list); + String conv, *tmp; + for (uint i= 0; (tmp= it++); i++) { - uint cnv_errs; - conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); - char *buf= (char*) sql_alloc(conv.length()+1); - memcpy(buf, conv.ptr(), conv.length()); - buf[conv.length()]= '\0'; - interval->type_names[i]= buf; - interval->type_lengths[i]= conv.length(); - } + if (String::needs_conversion(tmp->length(), tmp->charset(), + cs, &dummy)) + { + uint cnv_errs; + conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); + char *buf= (char*) sql_alloc(conv.length()+1); + memcpy(buf, conv.ptr(), conv.length()); + buf[conv.length()]= '\0'; + interval->type_names[i]= buf; + interval->type_lengths[i]= conv.length(); + } - // Strip trailing spaces. - uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], - interval->type_lengths[i]); - interval->type_lengths[i]= lengthsp; - ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + // Strip trailing spaces. + uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], + interval->type_lengths[i]); + interval->type_lengths[i]= lengthsp; + ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + } + sql_field->interval_list.empty(); // Don't need interval_list anymore } - sql_field->interval_list.empty(); // Don't need interval_list anymore - /* Convert the default value from client character -- cgit v1.2.1 From d23c70e9cf0e59a01ca0f8b5681e44bd0bc26759 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:13:47 +0300 Subject: merge fix --- mysql-test/r/ps_1general.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 882fc4783dd..5f8cb2597c6 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -273,11 +273,11 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t2 MyISAM 9 Fixed 0 0 # # # 0 NULL # # # latin1_swedish_ci NULL +t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t9 MyISAM 9 Dynamic 2 220 # # # 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value -- cgit v1.2.1 From c68dfe29fb6f31bc48f2ab189032eb7414de7356 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 17:01:46 +0400 Subject: #7066 [Ver]: "ctype_ucs" fails on SGI IRIX --- sql/table.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index 370ad5eff1d..992f6df0401 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -495,8 +495,17 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, char *from, *to; for (from= to= (char*) interval->type_names[pos]; *from; ) { - *to++= (char) (hexchar_to_int(*from++) << 4) + - hexchar_to_int(*from++); + /* + Note, hexchar_to_int(*from++) doesn't work + one some compilers, e.g. IRIX. Looks like a compiler + bug in inline functions in combination with arguments + that have a side effect. So, let's use from[0] and from[1] + and increment 'from' by two later. + */ + + *to++= (char) (hexchar_to_int(from[0]) << 4) + + hexchar_to_int(from[1]); + from+= 2; } interval->type_lengths[pos] /= 2; } -- cgit v1.2.1 From 96d6a116316e15c7684ae1ad8ff639f4e768e9fe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:39:46 +0000 Subject: added returntype BaseString& for ndb_upper and ndb_lower instead of void uppercase printout ndb/include/util/BaseString.hpp: added returntype BaseString& for ndb_upper and ndb_lower instead of void ndb/src/mgmclient/CommandInterpreter.cpp: uppercase printout --- ndb/include/util/BaseString.hpp | 10 ++++++---- ndb/src/mgmclient/CommandInterpreter.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 066a24f294e..02a6a3b3e66 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -48,10 +48,10 @@ public: bool empty() const; /** @brief Convert to uppercase */ - void ndb_toupper(); + BaseString& ndb_toupper(); /** @brief Convert to lowercase */ - void ndb_tolower(); + BaseString& ndb_tolower(); /** @brief Assigns from a char * */ BaseString& assign(const char* s); @@ -206,16 +206,18 @@ BaseString::empty() const return m_len == 0; } -inline void +inline BaseString& BaseString::ndb_toupper() { for(unsigned i = 0; i < length(); i++) m_chr[i] = toupper(m_chr[i]); + return *this; } -inline void +inline BaseString& BaseString::ndb_tolower() { for(unsigned i = 0; i < length(); i++) m_chr[i] = tolower(m_chr[i]); + return *this; } inline bool diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 3a9b3c47376..53c0e3b673e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1249,7 +1249,7 @@ CommandInterpreter::executeClusterLog(char* parameters) printError(); DBUG_VOID_RETURN; } - ndbout << item << " " << (res_enable ? "enabled":"disabled") << endl; + ndbout << BaseString(item).ndb_toupper().c_str() << " " << (res_enable ? "enabled":"disabled") << endl; item = strtok_r(NULL, " ", &tmpPtr); } while(item != NULL); -- cgit v1.2.1 From 9806e3f057706ba3ed85685d4ba0173038652a09 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 17:10:42 +0100 Subject: Added missing ; --- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 393a436ff85..5319e678441 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1432,7 +1432,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) m_globalHash->unlock(); } } - DBUG_RETURN(ret) + DBUG_RETURN(ret); } int -- cgit v1.2.1 From 5c7949af6b3e927854b14889940483b827553197 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 19:12:29 +0200 Subject: Fix for a bug #6996 BitKeeper/etc/ignore: Added analyse.test client/mysqladmin.c to the ignore list libmysql/libmysql.c: Fix for a bug #6996 This fix enables that after all rows are read from a buffered result, mysql_stmt_data_seek(stmt,0) can rewind a counter to the beginning, so that rows can be re-fetched. tests/client_test.c: Addition of a test for fix of the bug #6996 in client_test.c --- .bzrignore | 2 ++ libmysql/libmysql.c | 6 ++++++ tests/client_test.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/.bzrignore b/.bzrignore index 80079b02026..dee0812c9b0 100644 --- a/.bzrignore +++ b/.bzrignore @@ -943,3 +943,5 @@ ac_available_languages_fragment libmysqld/ha_archive.cc libmysqld/ha_example.cc libmysqld/ha_tina.cc +analyse.test +client/mysqladmin.c diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index cb20c5181a8..99fa0299de9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4413,6 +4413,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) for (; tmp && row; --row, tmp= tmp->next) ; stmt->data_cursor= tmp; + if (!row && tmp) + { + /* Rewind the counter */ + stmt->read_row_func= stmt_read_row_buffered; + stmt->state= MYSQL_STMT_EXECUTE_DONE; + } DBUG_VOID_RETURN; } diff --git a/tests/client_test.c b/tests/client_test.c index a7fadbd3033..75ce242900a 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11389,6 +11389,67 @@ static void test_conversion() myquery(rc); } +static void test_rewind(void) +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind; + int rc = 0; + const char *stmt_text; + long unsigned int length=4, Data=0; + my_bool isnull=0; + + myheader("test_rewind"); + + stmt_text= "CREATE TABLE t1 (a int)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + stmt_text= "SELECT * FROM t1"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + bzero(&bind,sizeof(MYSQL_BIND)); + bind.buffer_type= MYSQL_TYPE_LONG; + bind.buffer= (void *)&Data; /* this buffer won't be altered */ + bind.length= &length; + bind.is_null= &isnull; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + rc= mysql_stmt_store_result(stmt); + DIE_UNLESS(rc == 0); + + rc= mysql_stmt_bind_result(stmt, &bind); + DIE_UNLESS(rc == 0); + + /* retreive all result sets till we are at the end */ + while(!mysql_stmt_fetch(stmt)) + printf("fetched result:%ld\n", Data); + + DIE_UNLESS(rc != MYSQL_NO_DATA); + + /* seek to the first row */ + mysql_stmt_data_seek(stmt, 0); + + /* now we should be able to fetch the results again */ + /* but mysql_stmt_fetch returns MYSQL_NO_DATA */ + while(!(rc= mysql_stmt_fetch(stmt))) + printf("fetched result after seek:%ld\n", Data); + + DIE_UNLESS(rc == MYSQL_NO_DATA); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + rc= mysql_stmt_free_result(stmt); + rc= mysql_stmt_close(stmt); +} /* Read and parse arguments and MySQL options from my.cnf @@ -11594,6 +11655,7 @@ static struct my_tests_st my_tests[]= { { "test_datetime_ranges", test_datetime_ranges }, { "test_bug4172", test_bug4172 }, { "test_conversion", test_conversion }, + { "test_rewind", test_rewind }, { 0, 0 } }; -- cgit v1.2.1 From 86f19614e1c07b1e3e540d082c137edad80b9f44 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:18:15 +0200 Subject: postreview fix sql/item_cmpfunc.cc: comment fixed sql/item_subselect.cc: comment fixed debug info and inherited method call sql/item_subselect.h: comment fixed sql/item_sum.cc: comment fixed sql/item_sum.h: comment fixed --- sql/item_cmpfunc.cc | 4 +++- sql/item_subselect.cc | 9 +++++++-- sql/item_subselect.h | 2 +- sql/item_sum.cc | 4 +++- sql/item_sum.h | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c6ac1651118..51212418b09 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -146,7 +146,9 @@ void Item_func_not_all::print(String *str) /* - special NOP for ALL subquery + Special NOP (No OPeration) for ALL subquery it is like Item_func_not_all + (return TRUE if underlaying sudquery do not return rows) but if subquery + returns some rows it return same value as argument (TRUE/FALSE). */ longlong Item_func_nop_all::val_int() diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index b263b06c91f..1265d0b3557 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -292,14 +292,19 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, void Item_maxmin_subselect::cleanup() { + DBUG_ENTER("Item_maxmin_subselect::cleanup"); + Item_singlerow_subselect::cleanup(); + /* - By default is is TRUE to avoid TRUE reporting by + By default it is TRUE to avoid TRUE reporting by Item_func_not_all/Item_func_nop_all if this item was never called. Engine exec() set it to FALSE by reset_value_registration() call. + select_max_min_finder_subselect::send_data() set it back to TRUE if some + value will be found. */ - was_values= TRUE; + DBUG_VOID_RETURN; } diff --git a/sql/item_subselect.h b/sql/item_subselect.h index bd6ede49255..ab2d441ed7a 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -160,7 +160,7 @@ class Item_maxmin_subselect :public Item_singlerow_subselect { protected: bool max; - bool was_values; // was checked at least some values + bool was_values; // Set if we have found at least one row public: Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 7bc70052920..66d4fba205c 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -537,11 +537,13 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + /* - by default is is TRUE to avoid TRUE reporting by + by default it is TRUE to avoid TRUE reporting by Item_func_not_all/Item_func_nop_all if this item was never called. no_rows_in_result() set it to FALSE if was not results found. + If some results found it will be left unchanged. */ was_values= TRUE; DBUG_VOID_RETURN; diff --git a/sql/item_sum.h b/sql/item_sum.h index e718c885d4a..cec611b8854 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -402,7 +402,7 @@ class Item_sum_hybrid :public Item_sum enum_field_types hybrid_field_type; int cmp_sign; table_map used_table_cache; - bool was_values; // was checked at least some values (for max/min only) + bool was_values; // Set if we have found at least one row (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) -- cgit v1.2.1 From d74a3faf240023e6f674a502b6915fcccf34c726 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:57:54 +0200 Subject: Fixed Bug#7043, "SHOW CREATE TABLE security hole". --- sql/sql_parse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0e32097266d..73f65449f55 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2600,7 +2600,9 @@ unsent_create_error: check_access(thd, SELECT_ACL | EXTRA_ACL, tables->db, &tables->grant.privilege,0,0)) goto error; - res = mysqld_show_create(thd, tables); + if (grant_option && check_grant(thd, SELECT_ACL, tables, 2, UINT_MAX, 0)) + goto error; + res= mysqld_show_create(thd, tables); break; } #endif -- cgit v1.2.1 From 27c6192e82bffc5f340d548b987eac17fdb86494 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:41:29 +0100 Subject: allocate a buffer large enough for a longer matching string --- myisam/ft_boolean_search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index c432ac5a16c..ffc7e1bf104 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root, sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : - w.len+extra)); + w.len*ftb->charset->mbmaxlen+extra)); ftbw->len=w.len+1; ftbw->flags=0; ftbw->off=0; -- cgit v1.2.1 From c23f6444203afadeb212225d2a8b208b459401de Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 01:34:50 +0300 Subject: A followup to Bug#6878 "Crash with engine=memory", reported as Bug#6986 ""show_check" fails on 64bit platforms": now minimal rec_length of a HEAP table >= sizeof(void*), hence it's platform-dependant. mysql-test/r/show_check.result: Fix test results for 64-bit platforms. mysql-test/t/show_check.test: Ignore two more columns of output of show table status: it's different on 64-bit and 32-bit platforms. --- mysql-test/r/show_check.result | 42 +++++++++++++++++++++--------------------- mysql-test/t/show_check.test | 14 +++++++------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8256c8d692a..0afe45eb5e5 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -314,57 +314,57 @@ insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from t3; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database mysqltest; show create database mysqltest; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index efbe2e9371d..7788215dd27 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -228,37 +228,37 @@ CREATE TABLE t3 ( insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; delete from t1; delete from t2; delete from t3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; drop table t1, t2, t3; -- cgit v1.2.1 From b89ef30962f3f5cc30c5a9cf6ea7ae4a034b48f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 14:24:59 +0000 Subject: bug #7104 + some extra debug printouts mysql-test/ndb/ndbcluster.sh: fixed debug flag in ndbcluster start script ndb/include/debugger/EventLogger.hpp: bug #7104 ndb/include/kernel/LogLevel.hpp: bug #7104 ndb/src/common/debugger/EventLogger.cpp: bug #7104 ndb/src/common/portlib/NdbTCP.cpp: removed debug printout in Ndb_getInAddr ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: bug #7104 ndb/src/mgmapi/mgmapi.cpp: bug #7104 ndb/src/mgmsrv/MgmtSrvr.cpp: bug #7104 ndb/src/mgmsrv/MgmtSrvr.hpp: bug #7104 ndb/src/mgmsrv/Services.cpp: bug #7104 ndb/src/ndbapi/TransporterFacade.cpp: bug #7104 --- mysql-test/ndb/ndbcluster.sh | 3 +- ndb/include/debugger/EventLogger.hpp | 5 +++ ndb/include/kernel/LogLevel.hpp | 12 ++++--- ndb/src/common/debugger/EventLogger.cpp | 35 ++++++++++++------ ndb/src/common/portlib/NdbTCP.cpp | 12 +++---- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 23 +++++------- ndb/src/mgmapi/mgmapi.cpp | 7 ++-- ndb/src/mgmsrv/MgmtSrvr.cpp | 34 +++++++++--------- ndb/src/mgmsrv/MgmtSrvr.hpp | 19 +++++----- ndb/src/mgmsrv/Services.cpp | 63 ++++++++++++++++++++------------- ndb/src/ndbapi/TransporterFacade.cpp | 4 +++ 11 files changed, 129 insertions(+), 88 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 60188705857..fbef16c140b 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -67,8 +67,7 @@ while test $# -gt 0; do initial_ndb=1 ;; --debug*) - f=`echo "$1" | sed -e "s;--debug=;;"` - flags_ndb="$flags_ndb $f" + flags_ndb="$flags_ndb $1" ;; --status) status_ndb=1 diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index 686989089ae..b82c823ee0b 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -48,6 +48,11 @@ public: static const EventRepLogLevelMatrix matrix[]; static const Uint32 matrixSize; + static int + EventLoggerBase::event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity); }; /** diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 467f0604edd..0ff4386da8e 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -73,7 +73,7 @@ public: /** * Note level is valid as 0-15 */ - void setLogLevel(EventCategory ec, Uint32 level = 7); + int setLogLevel(EventCategory ec, Uint32 level = 7); /** * Get the loglevel (0-15) for a category @@ -119,10 +119,14 @@ LogLevel::clear(){ } inline -void +int LogLevel::setLogLevel(EventCategory ec, Uint32 level){ - assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES); - logLevelData[ec] = (Uint8)level; + if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES) + { + logLevelData[ec] = (Uint8)level; + return 0; + } + return 1; } inline diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 59be0affcb4..8bb797b7855 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1342,27 +1342,41 @@ operator<<(NdbOut& out, const LogLevel & ll) return out; } -void -EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, - const LogLevel* ll) +int +EventLoggerBase::event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity) { - Uint32 threshold = 0; - Logger::LoggerLevel severity = Logger::LL_WARNING; - LogLevel::EventCategory cat= LogLevel::llInvalid; - for(unsigned i = 0; igetLogLevel(cat) : m_logLevel.getLogLevel(cat); + DBUG_PRINT("info",("threshold=%d, set=%d", threshold, set)); + if (ll) + DBUG_PRINT("info",("m_logLevel.getLogLevel=%d", m_logLevel.getLogLevel(cat))); if (threshold <= set){ switch (severity){ case Logger::LL_ALERT: @@ -1401,6 +1415,7 @@ EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, break; } } // if (.. + DBUG_VOID_RETURN; } int diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp index 35b0c8c21e4..a63f5a7ba27 100644 --- a/ndb/src/common/portlib/NdbTCP.cpp +++ b/ndb/src/common/portlib/NdbTCP.cpp @@ -22,7 +22,7 @@ extern "C" int Ndb_getInAddr(struct in_addr * dst, const char *address) { - DBUG_ENTER("Ndb_getInAddr"); + // DBUG_ENTER("Ndb_getInAddr"); { int tmp_errno; struct hostent tmp_hostent, *hp; @@ -33,7 +33,7 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { { memcpy(dst, hp->h_addr, min(sizeof(*dst), (size_t) hp->h_length)); my_gethostbyname_r_free(); - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } my_gethostbyname_r_free(); } @@ -47,11 +47,11 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { #endif ) { - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } - DBUG_PRINT("error",("inet_addr(%s) - %d - %s", - address, errno, strerror(errno))); - DBUG_RETURN(-1); + // DBUG_PRINT("error",("inet_addr(%s) - %d - %s", + // address, errno, strerror(errno))); + return -1; //DBUG_RETURN(-1); } #if 0 diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 234d832655c..af8668180f9 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -193,21 +193,11 @@ void Cmvmi::execEVENT_REP(Signal* signal) /** * If entry is not found */ - Uint32 threshold = 16; - LogLevel::EventCategory eventCategory = (LogLevel::EventCategory)0; - - for(unsigned int i = 0; i< EventLoggerBase::matrixSize; i++){ - if(EventLoggerBase::matrix[i].eventType == eventType){ - eventCategory = EventLoggerBase::matrix[i].eventCategory; - threshold = EventLoggerBase::matrix[i].threshold; - break; - } - } - - if(threshold > 15){ - // No entry found in matrix (or event that should never be printed) + Uint32 threshold; + LogLevel::EventCategory eventCategory; + Logger::LoggerLevel severity; + if (EventLoggerBase::event_lookup(eventType,eventCategory,threshold,severity)) return; - } SubscriberPtr ptr; for(subscribers.first(ptr); ptr.i != RNIL; subscribers.next(ptr)){ @@ -225,14 +215,15 @@ void Cmvmi::execEVENT_REP(Signal* signal) // Print the event info g_eventLogger.log(eventReport->getEventType(), signal->theData); + return; }//execEVENT_REP() void Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ EventSubscribeReq * subReq = (EventSubscribeReq *)&signal->theData[0]; SubscriberPtr ptr; - jamEntry(); + DBUG_ENTER("Cmvmi::execEVENT_SUBSCRIBE_REQ"); /** * Search for subcription @@ -269,11 +260,13 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ category = (LogLevel::EventCategory)(subReq->theData[i] >> 16); level = subReq->theData[i] & 0xFFFF; ptr.p->logLevel.setLogLevel(category, level); + DBUG_PRINT("info",("entry %d: level=%d, category= %d", i, level, category)); } } signal->theData[0] = ptr.i; sendSignal(ptr.p->blockRef, GSN_EVENT_SUBSCRIBE_CONF, signal, 1, JBB); + DBUG_VOID_RETURN; } void diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 59ab6c00258..1a4a10f9421 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1102,15 +1102,18 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId, "set cluster loglevel", &args); CHECK_REPLY(reply, -1); + DBUG_ENTER("ndb_mgm_set_loglevel_clusterlog"); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level)); + BaseString result; reply->get("result", result); if(strcmp(result.c_str(), "Ok") != 0) { SET_ERROR(handle, EINVAL, result.c_str()); delete reply; - return -1; + DBUG_RETURN(-1); } delete reply; - return 0; + DBUG_RETURN(0); } extern "C" diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 4a9bfac3b6c..7497c517931 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -153,7 +153,7 @@ MgmtSrvr::logLevelThreadRun() * Handle started nodes */ EventSubscribeReq req; - req = m_statisticsListner.m_clients[0].m_logLevel; + req = m_event_listner[0].m_logLevel; req.blockRef = _ownReference; SetLogLevelOrd ord; @@ -409,7 +409,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, _ownReference(0), theSignalIdleList(NULL), theWaitState(WAIT_SUBSCRIBE_CONF), - m_statisticsListner(this) + m_event_listner(this) { DBUG_ENTER("MgmtSrvr::MgmtSrvr"); @@ -547,16 +547,18 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, } } + // Setup clusterlog as client[0] in m_event_listner { - MgmStatService::StatListener se; + Ndb_mgmd_event_service::Event_listener se; se.m_socket = -1; for(size_t t = 0; thandleStatus(nodeId, alive); + DBUG_VOID_RETURN; } enum ndb_mgm_node_type @@ -2386,8 +2388,8 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) EventReport::EventType type = eventReport->getEventType(); // Log event g_EventLogger.log(type, theData, nodeId, - &m_statisticsListner.m_clients[0].m_logLevel); - m_statisticsListner.log(type, theData, nodeId); + &m_event_listner[0].m_logLevel); + m_event_listner.log(type, theData, nodeId); } /*************************************************************************** @@ -2740,5 +2742,5 @@ template bool SignalQueue::waitFor(Vector&, SigMatch*&, NdbA #endif template class MutexVector; -template class MutexVector; +template class MutexVector; template class MutexVector; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 4d5631d3eb6..0cad99e9d86 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -43,27 +43,30 @@ class Config; class SetLogLevelOrd; class SocketServer; -class MgmStatService : public EventLoggerBase +class Ndb_mgmd_event_service : public EventLoggerBase { friend class MgmtSrvr; public: - struct StatListener : public EventLoggerBase { + struct Event_listener : public EventLoggerBase { NDB_SOCKET_TYPE m_socket; }; private: class MgmtSrvr * m_mgmsrv; - MutexVector m_clients; + MutexVector m_clients; public: - MgmStatService(class MgmtSrvr * m) : m_clients(5) { + Ndb_mgmd_event_service(class MgmtSrvr * m) : m_clients(5) { m_mgmsrv = m; } - void add_listener(const StatListener&); + void add_listener(const Event_listener&); void log(int eventType, const Uint32* theData, NodeId nodeId); - void stopSessions(); + void stop_sessions(); + + Event_listener& operator[](unsigned i) { return m_clients[i]; } + const Event_listener& operator[](unsigned i) const { return m_clients[i]; } }; /** @@ -732,8 +735,8 @@ private: LogLevel m_nodeLogLevel[MAX_NODES]; enum ndb_mgm_node_type nodeTypes[MAX_NODES]; friend class MgmApiSession; - friend class MgmStatService; - MgmStatService m_statisticsListner; + friend class Ndb_mgmd_event_service; + Ndb_mgmd_event_service m_event_listner; /** * Handles the thread wich upon a 'Node is started' event will diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 6ba2663c335..5b8d12e44d5 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -208,12 +208,12 @@ ParserRow commands[] = { MGM_CMD("set loglevel", &MgmApiSession::setLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set cluster loglevel", &MgmApiSession::setClusterLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""), @@ -781,20 +781,35 @@ MgmApiSession::bye(Parser::Context &, void MgmApiSession::setClusterLogLevel(Parser::Context &, Properties const &args) { - Uint32 node, level, category; + const char *reply= "set cluster loglevel reply"; + Uint32 node, level, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; + DBUG_ENTER("MgmApiSession::setClusterLogLevel"); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); + /* XXX should use constants for this value */ if(level > 15) { - m_output->println("set cluster loglevel reply"); - m_output->println("result: Invalid loglevel"); + m_output->println(reply); + m_output->println("result: Invalid loglevel %d", level); m_output->println(""); - return; + DBUG_VOID_RETURN; + } + + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level)) + { + m_output->println(reply); + m_output->println("result: Invalid category %d", category); + m_output->println(""); + DBUG_VOID_RETURN; } EventSubscribeReq req; @@ -802,10 +817,11 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, req.noOfEntries = 1; req.theData[0] = (category << 16) | level; m_mgmsrv.m_log_level_requests.push_back(req); - - m_output->println("set cluster loglevel reply"); + + m_output->println(reply); m_output->println("result: Ok"); m_output->println(""); + DBUG_VOID_RETURN; } void @@ -1263,21 +1279,17 @@ operator<<(NdbOut& out, const LogLevel & ll) } void -MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ +Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){ - Uint32 threshold = 0; - LogLevel::EventCategory cat= LogLevel::llInvalid; + Uint32 threshold; + LogLevel::EventCategory cat; + Logger::LoggerLevel severity; int i; + DBUG_ENTER("Ndb_mgmd_event_service::log"); + DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId)); - for(i = 0; (unsigned)im_log_level_requests.push_back(req); } } + DBUG_VOID_RETURN; } void -MgmStatService::add_listener(const StatListener& client){ +Ndb_mgmd_event_service::add_listener(const Event_listener& client){ m_clients.push_back(client); LogLevel tmp = m_logLevel; tmp.set_max(client.m_logLevel); @@ -1334,7 +1347,7 @@ MgmStatService::add_listener(const StatListener& client){ } void -MgmStatService::stopSessions(){ +Ndb_mgmd_event_service::stop_sessions(){ for(int i = m_clients.size() - 1; i >= 0; i--){ if(m_clients[i].m_socket >= 0){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); @@ -1374,7 +1387,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, int result = 0; BaseString msg; - MgmStatService::StatListener le; + Ndb_mgmd_event_service::Event_listener le; le.m_socket = m_socket; Vector list; @@ -1419,7 +1432,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, goto done; } - m_mgmsrv.m_statisticsListner.add_listener(le); + m_mgmsrv.m_event_listner.add_listener(le); m_stop = true; m_socket = -1; diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index dfb090c8416..031ee6315e8 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -626,6 +626,9 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) * After the restart the node is up again and the Ndb object * might not have noticed the failure. */ + + DBUG_ENTER("TransporterFacade::ReportNodeFailureComplete"); + DBUG_PRINT("enter",("nodeid= %d", tNodeId)); Uint32 sz = m_threads.m_statusNext.size(); for (Uint32 i = 0; i < sz ; i ++) { if (m_threads.getInUse(i)){ @@ -634,6 +637,7 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) (*RegPC) (obj, tNodeId, false, true); } } + DBUG_VOID_RETURN; } void -- cgit v1.2.1 From 433430f4a2549dfd1691da3a4df7c39429211013 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 17:53:01 +0200 Subject: os0file.c: Print a better error message to the .err log if InnoDB's advisory file locking fails innobase/os/os0file.c: Print a better error message to the .err log if InnoDB's advisory file locking fails --- innobase/os/os0file.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 8b9a0582781..5aa6fe37f26 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -394,10 +394,19 @@ os_file_lock( lk.l_start = lk.l_len = 0; if (fcntl(fd, F_SETLK, &lk) == -1) { fprintf(stderr, - "InnoDB: Unable to lock %s, error: %d", name, errno); + "InnoDB: Unable to lock %s, error: %d\n", name, errno); + + if (errno == EAGAIN || errno == EACCES) { + fprintf(stderr, +"InnoDB: Check that you do not already have another mysqld process\n" +"InnoDB: using the same InnoDB data or log files.\n"); + } + close(fd); + return(-1); } + return(0); } #endif /* USE_FILE_LOCK */ -- cgit v1.2.1 From b5e844468cff742173c42e418cbf12532739ec2d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 19:34:11 +0100 Subject: - added two new options to Do-compile: --ps-test: run the test suite using prepared statements --embedded-test: run the test suite against the embedded server Build-tools/Do-compile: - added two new options: --ps-test: run the test suite using prepared statements --embedded-test: run the test suite against the embedded server --- Build-tools/Do-compile | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index f8e91efd70d..da2be90a428 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; +$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", @@ -25,6 +25,7 @@ GetOptions( "delete", "distribution=s", "enable-shared", + "embedded-test", "fast-benchmark", "help|Information", "innodb", @@ -40,6 +41,7 @@ GetOptions( "one-error", "perl-files=s", "perl-options=s", + "ps-test", "raid", "readline", "stage=i", @@ -274,6 +276,7 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); + $opt_embedded_test= 0 if ($opt_without_embedded); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); @@ -376,13 +379,29 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { my $flags= ""; - my $force= ""; $flags.= " --with-ndbcluster" if ($opt_with_cluster); $flags.= " --force" if (!$opt_one_error); log_timestamp(); + info("Running test suite"); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + + if ($opt_ps_test) + { + log_timestamp(); + info("Running test suite using prepared statements"); + check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } + + if ($opt_embedded_test) + { + log_timestamp(); + info("Running embedded server test suite"); + # Embedded server and NDB don't jive + $flags=~ s/ --with-ndbcluster//; + check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } # 'mysql-test-run' writes its own final message for log evaluation. } @@ -528,6 +547,9 @@ Delete the distribution file. --distribution= Name of the MySQL source distribution file. +--embedded-test +Run the test suite against the embedded server + --enable-shared Compile with shared libraries @@ -576,6 +598,9 @@ Compile and install the given perl modules. --perl-options= Build Perl modules with the additional options +--ps-test +Run an additional test run, using prepared statements + --raid Compile with RAID support -- cgit v1.2.1 From 998209d36b93e1a0b6e2078b004a0cdbbaf5a712 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 00:37:17 +0300 Subject: A fix and test case for Bug#6873 "PS, having with subquery, crash during execute" mysql-test/r/ps.result: Test results updated (Bug#6873) mysql-test/t/ps.test: A test case for Bug#6873 "PS, having with subquery, crash during execute". sql/item_subselect.cc: If we transform having subtree, modify SELECT_LEX::having pointer to point to the new having tree root. --- mysql-test/r/ps.result | 11 +++++++++++ mysql-test/t/ps.test | 14 ++++++++++++++ sql/item_subselect.cc | 2 ++ 3 files changed, 27 insertions(+) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 4a4c8fe22e4..4cb32fa4644 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -471,3 +471,14 @@ select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; ? is null ? is not null ? 1 0 NULL +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +pnum +execute stmt; +pnum +execute stmt; +pnum +deallocate prepare stmt; +drop table t1, t2; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 51d1fd065cf..92bf4ece4e3 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -471,3 +471,17 @@ execute stmt using @var, @var, @var; set @var=null; select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; + +# +# Bug#6873 "PS, having with subquery, crash during execute" +# check that if we modify having subtree, we update JOIN->having pointer +# +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +execute stmt; +execute stmt; +deallocate prepare stmt; +drop table t1, t2; + diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 1265d0b3557..69941b36ca0 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) // did we changed top item of WHERE condition if (unit->outer_select()->where == (*ref)) unit->outer_select()->where= substitution; // correct WHERE for PS + else if (unit->outer_select()->having == (*ref)) + unit->outer_select()->having= substitution; // correct HAVING for PS (*ref)= substitution; substitution->name= name; -- cgit v1.2.1 From 43a1ddcfcce4f9f9902e601b2435549cb6233c02 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 21:48:32 +0000 Subject: ndbcluster.sh: added test switch basic_log.result, basic.test, basic.result: new file mysql-test/ndb/ndbcluster.sh: added test switch --- mysql-test/ndb/basic.result | 68 +++++++++++++++++++++++++++++++++++++++++ mysql-test/ndb/basic.test | 17 +++++++++++ mysql-test/ndb/basic_log.result | 0 mysql-test/ndb/ndbcluster.sh | 63 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 mysql-test/ndb/basic.result create mode 100644 mysql-test/ndb/basic.test create mode 100644 mysql-test/ndb/basic_log.result diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result new file mode 100644 index 00000000000..6bd907a11d0 --- /dev/null +++ b/mysql-test/ndb/basic.result @@ -0,0 +1,68 @@ +-- NDB Cluster -- Management Client -- +--------------------------------------------------------------------------- + NDB Cluster -- Management Client -- Help +--------------------------------------------------------------------------- +HELP Print help text +HELP SHOW Help for SHOW command +HELP DEBUG Help for debug compiled version +SHOW Print information about cluster +START BACKUP Start backup +ABORT BACKUP Abort backup +SHUTDOWN Shutdown all processes in cluster and quit +CLUSTERLOG ON [] ... Enable Cluster logging +CLUSTERLOG OFF [] ... Disable Cluster logging +CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off +CLUSTERLOG INFO Print cluster log information + START Start DB node (started with -n) + RESTART [-n] [-i] Restart DB node + STOP Stop DB node +ENTER SINGLE USER MODE Enter single user mode +EXIT SINGLE USER MODE Exit single user mode + STATUS Print status + CLUSTERLOG {=}+ Set log level for cluster log +PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server +CONNECT [] Connect to management server (reconnect if already connected) +QUIT Quit management client + + = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG + = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP + = 0 - 15 + = ALL | Any database node id + +Connected to Management Server at: localhost:1186 +Node 1: started (Version 4.1.8) +Node 2: started (Version 4.1.8) + +Node 1: started (Version 4.1.8) + +Node 2: started (Version 4.1.8) + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Cluster logging is disabled +Cluster logging is enabled. +Cluster logging is disabled +ALL disabled +ALL enabled diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test new file mode 100644 index 00000000000..945bda94ff6 --- /dev/null +++ b/mysql-test/ndb/basic.test @@ -0,0 +1,17 @@ +help +all status +1 status +2 status +all clusterlog connection=8 +all clusterlog startup=7 +all clusterlog checkpoint=7 +all clusterlog noderestart=15 +all clusterlog statistics=7 +all clusterlog error=7 +all clusterlog info=7 +all clusterlog backup=15 +clusterlog off +clusterlog toggle +clusterlog off +clusterlog off all +clusterlog on all diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index fbef16c140b..11cb8e77268 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -47,6 +47,7 @@ fi pidfile=ndbcluster.pid cfgfile=Ndb.cfg +test_ndb= stop_ndb= initial_ndb= status_ndb= @@ -59,6 +60,9 @@ ndb_imem=24M while test $# -gt 0; do case "$1" in + --test) + test_ndb=1 + ;; --stop) stop_ndb=1 ;; @@ -231,7 +235,7 @@ status_ndbcluster status_ndbcluster() { # Start management client - echo "show" | $exec_mgmtclient + $exec_mgmtclient -e show } stop_default_ndbcluster() { @@ -240,7 +244,7 @@ stop_default_ndbcluster() { exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" -echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null +$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null if [ -f "$fs_ndb/$pidfile" ] ; then kill_pids=`cat "$fs_ndb/$pidfile"` @@ -275,6 +279,50 @@ if [ -f "$fs_ndb/$pidfile" ] ; then fi } +initialize_ndb_test () +{ + fs_result=$fs_ndb/r + rm -rf $fs_result + mkdir $fs_result + echo ------------------ + echo starting ndb tests + echo ------------------ +} + +do_ndb_test () +{ + test_name=$1 + + clusterlog=$fs_ndb/ndb_3_cluster.log + + test_log_result=$fs_result/${test_name}_log.result + test_log_reject=$fs_result/${test_name}_log.reject + test_result=$fs_result/${test_name}.result + test_reject=$fs_result/${test_name}.reject + + cp $clusterlog $test_log_result + cat ndb/${test_name}_log.result >> $test_log_result + + cp ndb/${test_name}.result $test_result + + cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject + cp $clusterlog $test_log_reject + r=`diff -C 5 $test_result $test_reject` + if [ $r ] ; then + t="fail" + else + t="pass" + fi + printf "ndb_mgm output %20s [%s]\n" $test_name $t + r=`diff -C 5 $test_log_result $test_log_reject` + if [ $r ] ; then + t="fail" + else + t="pass" + fi + printf "clusterlog output %20s [%s]\n" $test_name $t +} + if [ $status_ndb ] ; then status_ndbcluster exit 0 @@ -286,4 +334,15 @@ else start_default_ndbcluster fi +if [ $test_ndb ] ; then + initialize_ndb_test + all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"` + for a in $all_tests ; do + do_ndb_test $a + done + echo ------------------ + echo shutting down cluster + stop_default_ndbcluster +fi + exit 0 -- cgit v1.2.1 From 5380a3a600b0d0f13f80eb10071bafeb8a89b0ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 22:56:23 +0000 Subject: ndbcluster.sh: made compare of logs possible in ndb test restart_log.result, restart.test, restart.result: new file mysql-test/ndb/ndbcluster.sh: made compare of logs possible in ndb test --- mysql-test/ndb/ndbcluster.sh | 24 +++++++++--------------- mysql-test/ndb/restart.result | 16 ++++++++++++++++ mysql-test/ndb/restart.test | 12 ++++++++++++ mysql-test/ndb/restart_log.result | 20 ++++++++++++++++++++ 4 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 mysql-test/ndb/restart.result create mode 100644 mysql-test/ndb/restart.test create mode 100644 mysql-test/ndb/restart_log.result diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 11cb8e77268..848223a091c 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -300,26 +300,20 @@ do_ndb_test () test_result=$fs_result/${test_name}.result test_reject=$fs_result/${test_name}.reject - cp $clusterlog $test_log_result - cat ndb/${test_name}_log.result >> $test_log_result + clean_log='s/.*\[MgmSrvr\]//' + + cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result cp ndb/${test_name}.result $test_result cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject - cp $clusterlog $test_log_reject - r=`diff -C 5 $test_result $test_reject` - if [ $r ] ; then - t="fail" - else - t="pass" - fi + cat $clusterlog | sed -e $clean_log > $test_log_reject + + t="pass" + diff -C 5 $test_result $test_reject || t="fail" printf "ndb_mgm output %20s [%s]\n" $test_name $t - r=`diff -C 5 $test_log_result $test_log_reject` - if [ $r ] ; then - t="fail" - else - t="pass" - fi + t="pass" + diff -C 5 $test_log_result $test_log_reject || t="fail" printf "clusterlog output %20s [%s]\n" $test_name $t } diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result new file mode 100644 index 00000000000..efa1399b5d9 --- /dev/null +++ b/mysql-test/ndb/restart.result @@ -0,0 +1,16 @@ +-- NDB Cluster -- Management Client -- +Connected to Management Server at: localhost:1186 +ALL disabled +Cluster logging is enabled. +ALERT enabled +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +ALL enabled diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test new file mode 100644 index 00000000000..6ea9e919368 --- /dev/null +++ b/mysql-test/ndb/restart.test @@ -0,0 +1,12 @@ +clusterlog off all +clusterlog on +clusterlog on alert +all clusterlog connection=0 +sleep 1 +1 restart +sleep 5 +all clusterlog connection=8 +sleep 1 +1 restart +sleep 5 +clusterlog on all diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result new file mode 100644 index 00000000000..2b25fc7b5b6 --- /dev/null +++ b/mysql-test/ndb/restart_log.result @@ -0,0 +1,20 @@ + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 + ALERT -- Node 3: Node 1 Disconnected + ALERT -- Node 2: Node 1 Disconnected + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 -- cgit v1.2.1 From f5428acdcaf2fed7768821aaabeb5354f377f062 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 23:00:08 +0000 Subject: added possibility for comment into management client added sleep command to management client all for testing purposes --- ndb/src/mgmclient/CommandInterpreter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 53c0e3b673e..1d4d66df961 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -499,7 +499,8 @@ CommandInterpreter::execute_impl(const char *_line) line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); - if (emptyString(line)) { + if (emptyString(line) || + line[0] == '#') { DBUG_RETURN(true); } @@ -516,6 +517,11 @@ CommandInterpreter::execute_impl(const char *_line) executeConnect(allAfterFirstToken); DBUG_RETURN(true); } + else if (strcasecmp(firstToken, "SLEEP") == 0) { + if (allAfterFirstToken) + sleep(atoi(allAfterFirstToken)); + DBUG_RETURN(true); + } else if((strcasecmp(firstToken, "QUIT") == 0 || strcasecmp(firstToken, "EXIT") == 0 || strcasecmp(firstToken, "BYE") == 0) && -- cgit v1.2.1 From 0724b1b250e414fdbb454d7d1d42f7f418ce1b06 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 09:39:20 +0000 Subject: fixed so that trailing ';' are accepted by the ndb_mgm to be more "mysql client" like some cleanup --- ndb/src/mgmclient/CommandInterpreter.cpp | 51 ++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 1d4d66df961..e4c66d04624 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -484,6 +484,13 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect, return result; } +static void +invalid_command(const char *cmd) +{ + ndbout << "Invalid command: " << cmd << endl; + ndbout << "Type HELP for help." << endl << endl; +} + int CommandInterpreter::execute_impl(const char *_line) { @@ -493,17 +500,30 @@ CommandInterpreter::execute_impl(const char *_line) char * line; if(_line == NULL) { - // ndbout << endl; DBUG_RETURN(false); } line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); - - if (emptyString(line) || - line[0] == '#') { - DBUG_RETURN(true); - } - + + int do_continue; + do { + do_continue= 0; + BaseString::trim(line," \t"); + if (line[0] == 0 || + line[0] == '#') + { + DBUG_RETURN(true); + } + // for mysql client compatability remove trailing ';' + { + unsigned last= strlen(line)-1; + if (line[last] == ';') + { + line[last]= 0; + do_continue= 1; + } + } + } while (do_continue); // if there is anything in the line proceed char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, ""); @@ -590,8 +610,7 @@ CommandInterpreter::execute_impl(const char *_line) int nodeId; if (! convert(firstToken, nodeId)) { - ndbout << "Invalid command: " << _line << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(_line); DBUG_RETURN(true); } @@ -640,12 +659,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId, char* allAfterFirstToken) { if (emptyString(allAfterFirstToken)) { - if (processId == -1) { - ndbout << "Expected a command after ALL." << endl; - } - else { - ndbout << "Expected a command after node ID." << endl; - } + ndbout << "Expected a command after " + << ((processId == -1) ? "ALL." : "node ID.") << endl; return; } @@ -664,8 +679,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId, } if(fun == 0){ - ndbout << "Invalid command: " << secondToken << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(secondToken); return; } @@ -846,8 +860,7 @@ CommandInterpreter::executeHelp(char* parameters) ndbout << helpTextDebug; #endif } else { - ndbout << "Invalid argument: " << parameters << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(parameters); } } -- cgit v1.2.1 From 37865bc907a7f31ba906bc403ee9715e536552d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 11:29:17 +0100 Subject: bug#6995 - ndb don't store keys in normalized form instead save everythings as normal attributes ndb/src/kernel/blocks/backup/Backup.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/src/kernel/blocks/backup/Backup.hpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/src/kernel/blocks/backup/BackupInit.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/tools/restore/Restore.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/tools/restore/Restore.hpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC --- ndb/src/kernel/blocks/backup/Backup.cpp | 123 +++++----------------------- ndb/src/kernel/blocks/backup/Backup.hpp | 40 +-------- ndb/src/kernel/blocks/backup/BackupInit.cpp | 1 - ndb/tools/restore/Restore.cpp | 27 ------ ndb/tools/restore/Restore.hpp | 2 - 5 files changed, 24 insertions(+), 169 deletions(-) diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index e6fe63d9014..e7ec6c71196 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -1265,10 +1265,6 @@ Backup::createAttributeMask(TablePtr tabPtr, jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0){ - jam(); - continue; - } mask.set(i); } } @@ -2954,12 +2950,9 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) tabPtr.p->schemaVersion = tmpTab.TableVersion; tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes; - tabPtr.p->noOfKeys = tmpTab.NoOfKeyAttr; tabPtr.p->noOfNull = 0; tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs - tabPtr.p->sz_FixedKeys = 0; // Computed while iterating over attribs tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs - tabPtr.p->variableKeyId = RNIL; // Computed while iterating over attribs tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID; @@ -2994,7 +2987,6 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) attrPtr.p->data.nullable = tmp.AttributeNullableFlag; attrPtr.p->data.fixed = (tmp.AttributeArraySize != 0); - attrPtr.p->data.key = tmp.AttributeKeyFlag; attrPtr.p->data.sz32 = sz32; /** @@ -3002,50 +2994,26 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) * 1) Fixed * 2) Nullable * 3) Variable - * 4) Fixed key - * 5) Variable key */ - if(attrPtr.p->data.key == false) { + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { jam(); - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { - jam(); - attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; - tabPtr.p->sz_FixedAttributes += sz32; - }//if - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { - jam(); - attrPtr.p->data.offset = 0; - - attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; - tabPtr.p->noOfNull++; - tabPtr.p->noOfVariable++; - }//if - - if(attrPtr.p->data.fixed == false) { - jam(); - tabPtr.p->noOfVariable++; - ndbrequire(0); - }//if - - } else if(attrPtr.p->data.key == true) { + attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; + tabPtr.p->sz_FixedAttributes += sz32; + }//if + + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { jam(); - ndbrequire(attrPtr.p->data.nullable == false); + attrPtr.p->data.offset = 0; - if(attrPtr.p->data.fixed == true) { // Fixed key - jam(); - tabPtr.p->sz_FixedKeys += sz32; - }//if - - if(attrPtr.p->data.fixed == false) { // Variable key - jam(); - attrPtr.p->data.offset = 0; - tabPtr.p->noOfVariable++; - ndbrequire(tabPtr.p->variableKeyId == RNIL); // Only one variable key - tabPtr.p->variableKeyId = attrPtr.i; - ndbrequire(0); - }//if + attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; + tabPtr.p->noOfNull++; + tabPtr.p->noOfVariable++; + }//if + + if(attrPtr.p->data.fixed == false) { + jam(); + tabPtr.p->noOfVariable++; + ndbrequire(0); }//if it.next(); // Move Past EndOfAttribute @@ -3355,7 +3323,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) Table & table = * tabPtr.p; ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); const Uint32 parallelism = 16; - const Uint32 attrLen = 5 + table.noOfAttributes - table.noOfKeys; + const Uint32 attrLen = 5 + table.noOfAttributes; req->senderData = filePtr.i; req->resultRef = reference(); @@ -3366,7 +3334,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) req->tableId = table.tableId; ScanFragReq::setLockMode(req->requestInfo, 0); ScanFragReq::setHoldLockFlag(req->requestInfo, 0); - ScanFragReq::setKeyinfoFlag(req->requestInfo, 1); + ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo,attrLen); req->transId1 = 0; req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); @@ -3381,7 +3349,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8); // Return all - signal->theData[3] = table.noOfAttributes - table.noOfKeys; + signal->theData[3] = table.noOfAttributes; signal->theData[4] = 0; signal->theData[5] = 0; signal->theData[6] = 0; @@ -3393,10 +3361,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0) { - jam(); - continue; - }//if AttributeHeader::init(&signal->theData[dataPos], i, 0); dataPos++; @@ -3506,64 +3470,19 @@ Backup::execTRANSID_AI(Signal* signal) } } -void -Backup::execKEYINFO20(Signal* signal) -{ - jamEntry(); - - const Uint32 filePtrI = signal->theData[0]; - const Uint32 keyLen = signal->theData[1]; - //const Uint32 scanInfo = signal->theData[2]; - //const Uint32 transId1 = signal->theData[3]; - //const Uint32 transId2 = signal->theData[4]; - const Uint32 dataLen = signal->length() - 5; - - BackupFilePtr filePtr; - c_backupFilePool.getPtr(filePtr, filePtrI); - - OperationRecord & op = filePtr.p->operation; - - /** - * Unpack data - */ - ndbrequire(keyLen == dataLen); - const Uint32 * src = &signal->theData[5]; - const Uint32 klFixed = op.getFixedKeySize(); - ndbrequire(keyLen >= klFixed); - - Uint32 * dst = op.newKey(); - memcpy(dst, src, klFixed << 2); - - const Uint32 szLeft = (keyLen - klFixed); - if(szLeft > 0) { - jam(); - src += klFixed; - dst = op.newVariableKey(szLeft); - memcpy(dst, src, (szLeft << 2)); - ndbrequire(0); - }//if - - if(op.finished()){ - jam(); - op.newRecord(op.dst); - } -} - void Backup::OperationRecord::init(const TablePtr & ptr) { tablePtr = ptr.i; - noOfAttributes = (ptr.p->noOfAttributes - ptr.p->noOfKeys) + 1; - variableKeyId = ptr.p->variableKeyId; + noOfAttributes = ptr.p->noOfAttributes; sz_Bitmask = (ptr.p->noOfNull + 31) >> 5; - sz_FixedKeys = ptr.p->sz_FixedKeys; sz_FixedAttribs = ptr.p->sz_FixedAttributes; if(ptr.p->noOfVariable == 0) { jam(); - maxRecordSize = 1 + sz_Bitmask + sz_FixedKeys + sz_FixedAttribs; + maxRecordSize = 1 + sz_Bitmask + sz_FixedAttribs; } else { jam(); maxRecordSize = diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp index 4dc2cd13ae0..9cc6255af11 100644 --- a/ndb/src/kernel/blocks/backup/Backup.hpp +++ b/ndb/src/kernel/blocks/backup/Backup.hpp @@ -76,7 +76,6 @@ protected: */ void execSCAN_HBREP(Signal* signal); void execTRANSID_AI(Signal* signal); - void execKEYINFO20(Signal* signal); void execSCAN_FRAGREF(Signal* signal); void execSCAN_FRAGCONF(Signal* signal); @@ -172,8 +171,8 @@ public: struct Data { Uint8 nullable; Uint8 fixed; - Uint8 key; - Uint8 unused; + Uint8 unused; + Uint8 unused2; Uint32 sz32; // No of 32 bit words Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys Uint32 offsetNull; // In NullBitmask @@ -199,12 +198,9 @@ public: Uint32 frag_mask; Uint32 tableType; Uint32 noOfNull; - Uint32 noOfKeys; Uint32 noOfAttributes; Uint32 noOfVariable; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttributes; - Uint32 variableKeyId; Uint32 triggerIds[3]; bool triggerAllocated[3]; @@ -224,7 +220,6 @@ public: * Once per table */ void init(const TablePtr & ptr); - inline Uint32 getFixedKeySize() const { return sz_FixedKeys; } /** * Once per fragment @@ -247,23 +242,19 @@ public: /** * Per attribute */ - Uint32 * newKey(); void nullAttribute(Uint32 nullOffset); Uint32 * newNullable(Uint32 attrId, Uint32 sz); Uint32 * newAttrib(Uint32 offset, Uint32 sz); Uint32 * newVariable(Uint32 id, Uint32 sz); - Uint32 * newVariableKey(Uint32 sz); private: Uint32* base; Uint32* dst_Length; Uint32* dst_Bitmask; - Uint32* dst_FixedKeys; Uint32* dst_FixedAttribs; BackupFormat::DataFile::VariableData* dst_VariableData; Uint32 noOfAttributes; // No of Attributes - Uint32 variableKeyId; // Id of variable key Uint32 attrLeft; // No of attributes left Uint32 opNoDone; @@ -289,7 +280,6 @@ public: * sizes of part */ Uint32 sz_Bitmask; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttribs; public: @@ -628,7 +618,6 @@ Backup::OperationRecord::newRecord(Uint32 * p){ base = p; dst_Length = p; p += 1; dst_Bitmask = p; p += sz_Bitmask; - dst_FixedKeys = p; p += sz_FixedKeys; dst_FixedAttribs = p; p += sz_FixedAttribs; dst_VariableData = (BackupFormat::DataFile::VariableData*)p; BitmaskImpl::clear(sz_Bitmask, dst_Bitmask); @@ -645,14 +634,6 @@ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){ return dst; } -inline -Uint32 * -Backup::OperationRecord::newKey(){ - attrLeft --; - attrSzLeft = 0; - return dst_FixedKeys; -} - inline void Backup::OperationRecord::nullAttribute(Uint32 offsetNull){ @@ -691,21 +672,6 @@ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){ return dst; } -inline -Uint32 * -Backup::OperationRecord::newVariableKey(Uint32 sz){ - attrLeft--; - attrSzLeft = 0; - attrSzTotal += sz; - - dst = &dst_VariableData->Data[0]; - dst_VariableData->Sz = htonl(sz); - dst_VariableData->Id = htonl(variableKeyId); - - dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz); - return dst; -} - inline bool Backup::OperationRecord::finished(){ @@ -713,7 +679,7 @@ Backup::OperationRecord::finished(){ return false; } - opLen += attrSzTotal + sz_FixedKeys; + opLen += attrSzTotal; opNoDone++; scanStop = dst = (Uint32 *)dst_VariableData; diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 8daad05558b..a02e068687b 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -126,7 +126,6 @@ Backup::Backup(const Configuration & conf) : addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP); addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI); - addRecSignal(GSN_KEYINFO20, &Backup::execKEYINFO20); addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF); addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF); diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 6e2fcaed3af..de769b4c880 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -334,27 +334,6 @@ RestoreDataIterator::getNextTuple(int & res) Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr; ptr += m_currentTable->m_nullBitmaskSize; Uint32 i; - for(i= 0; i < m_currentTable->m_fixedKeys.size(); i++){ - assert(ptr < buf_ptr + dataLength); - - const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId; - - AttributeData * attr_data = m_tuple.getData(attrId); - const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); - - const Uint32 sz = attr_desc->getSizeInWords(); - - attr_data->null = false; - attr_data->void_value = ptr; - - if(!Twiddle(attr_desc, attr_data)) - { - res = -1; - return NULL; - } - ptr += sz; - } - for(i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){ assert(ptr < buf_ptr + dataLength); @@ -699,12 +678,6 @@ void TableS::createAttr(NdbDictionary::Column *column) if (d->m_column->getAutoIncrement()) m_auto_val_id= d->attrId; - if(d->m_column->getPrimaryKey() /* && not variable */) - { - m_fixedKeys.push_back(d); - return; - } - if(!d->m_column->getNullable()) { m_fixedAttribs.push_back(d); diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index 82fcdcdb183..a7d4fc174c7 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -123,8 +123,6 @@ class TableS { Uint32 schemaVersion; Uint32 backupVersion; Vector allAttributesDesc; - Vector m_fixedKeys; - //Vector m_variableKey; Vector m_fixedAttribs; Vector m_variableAttribs; -- cgit v1.2.1 From 9ad51c631c7ef6d5ed4bea0b6171a98502844c81 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 13:31:46 +0300 Subject: Fix for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" (with after-review fixes). We should set SELECT_ACL for implicitly opened tables in my_tz_check_n_skip_implicit_tables() to be able to bypass privilege checking in check_grant(). Also we should exclude those tables from privilege checking in multi-update. mysql-test/r/timezone2.result: Extended test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" Added test for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" mysql-test/t/timezone2.test: Extended test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" Added test for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" sql/item_geofunc.cc: sql_acl.h is now included via mysql_priv.h sql/item_strfunc.cc: sql_acl.h is now included via mysql_priv.h sql/log.cc: sql_acl.h is now included via mysql_priv.h sql/mysql_priv.h: Now we have to include sql_acl.h before tztime.h, since my_tz_check_n_skip_implicit_tables() defined there requires SELECT_ACL constant defined in sql_acl.h. sql/mysqld.cc: sql_acl.h is now included via mysql_priv.h sql/repl_failsafe.cc: sql_acl.h is now included via mysql_priv.h sql/set_var.cc: sql_acl.h is now included via mysql_priv.h sql/sql_acl.cc: sql_acl.h is now included via mysql_priv.h sql/sql_base.cc: sql_acl.h is now included via mysql_priv.h sql/sql_cache.cc: sql_acl.h is now included via mysql_priv.h sql/sql_class.cc: sql_acl.h is now included via mysql_priv.h sql/sql_db.cc: sql_acl.h is now included via mysql_priv.h sql/sql_derived.cc: sql_acl.h is now included via mysql_priv.h sql/sql_do.cc: sql_acl.h is now included via mysql_priv.h sql/sql_insert.cc: sql_acl.h is now included via mysql_priv.h sql/sql_parse.cc: check_one_table_access(): Tweaked comments. multi_update_precheck(): Added skipping of implicitly opened tables during privilege checking. sql/sql_prepare.cc: sql_acl.h is now included via mysql_priv.h sql/sql_repl.cc: sql_acl.h is now included via mysql_priv.h sql/sql_show.cc: sql_acl.h is now included via mysql_priv.h sql/sql_update.cc: sql_acl.h is now included via mysql_priv.h sql/sql_yacc.yy: sql_acl.h is now included via mysql_priv.h sql/tztime.h: my_tz_check_n_skip_implicit_tables(): We should set SELECT_ACL for implictly opened tables to be able to bypass privilege checking in check_grant(). --- mysql-test/r/timezone2.result | 36 ++++++++++++++++++++++++++++++++++-- mysql-test/t/timezone2.test | 43 +++++++++++++++++++++++++++++++++++++++++-- sql/item_geofunc.cc | 1 - sql/item_strfunc.cc | 1 - sql/log.cc | 1 - sql/mysql_priv.h | 3 ++- sql/mysqld.cc | 1 - sql/repl_failsafe.cc | 1 - sql/set_var.cc | 1 - sql/sql_acl.cc | 1 - sql/sql_base.cc | 1 - sql/sql_cache.cc | 1 - sql/sql_class.cc | 1 - sql/sql_db.cc | 1 - sql/sql_derived.cc | 1 - sql/sql_do.cc | 1 - sql/sql_insert.cc | 1 - sql/sql_parse.cc | 10 ++++++---- sql/sql_prepare.cc | 1 - sql/sql_repl.cc | 1 - sql/sql_show.cc | 1 - sql/sql_update.cc | 1 - sql/sql_yacc.yy | 1 - sql/tztime.h | 6 ++++-- 24 files changed, 87 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 86264bf5b7e..1c98fd18a08 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; create table t1 (ts timestamp); set time_zone='+00:00'; select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); @@ -256,18 +256,50 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; -grant usage on mysqltest.* to mysqltest_1@localhost; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); +grant all privileges on test.* to mysqltest_1@localhost; show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost' set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') 2004-10-21 15:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); select * from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost' +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC') +2004-12-01 09:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); +select * from mysql.time_zone_name; +ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; +ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; +drop table t1, t2; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index ad8089e1a37..d185a647921 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -2,7 +2,7 @@ # Preparing playground --disable_warnings -drop table if exists t1; +drop table if exists t1, t2; --enable_warnings @@ -205,25 +205,64 @@ drop table t1; # even for unprivileged users. # +# Let us prepare playground delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); -grant usage on mysqltest.* to mysqltest_1@localhost; +grant all privileges on test.* to mysqltest_1@localhost; connect (tzuser, localhost, mysqltest_1,,); connection tzuser; show grants for current_user(); set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +# Let us also check whenever multi-update works ok +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); # But still these two statements should not work: --error 1044 select * from mysql.time_zone_name; --error 1044 select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; +# +# Test for bug #6765 "Implicit access to time zone description tables +# requires privileges for them if some table or column level grants +# present" +# +connection default; +# Let use some table-level grants instead of db-level +# to make life more interesting +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +# The test itself is almost the same as previous one +connect (tzuser2, localhost, mysqltest_1,,); +connection tzuser2; +show grants for current_user(); +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); +# Again these two statements should not work (but with different errors): +--error 1142 +select * from mysql.time_zone_name; +--error 1142 +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; + +# Clean-up connection default; delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; +drop table t1, t2; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 7c3319bbfea..2f00416bddf 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -24,7 +24,6 @@ #include "mysql_priv.h" #ifdef HAVE_SPATIAL -#include "sql_acl.h" #include void Item_geometry_func::fix_length_and_dec() diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5a23eec5a1b..ebd794f1e76 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -25,7 +25,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/log.cc b/sql/log.cc index 460910fcee8..83034c79dde 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -23,7 +23,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "ha_innodb.h" // necessary to cut the binlog when crash recovery diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3f55a88b262..46f47e51b6d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -350,7 +350,6 @@ inline THD *_current_thd(void) #include "sql_udf.h" class user_var_entry; #include "item.h" -#include "tztime.h" typedef Comp_creator* (*chooser_compare_func_creator)(bool invert); /* sql_parse.cc */ void free_items(Item *item); @@ -371,6 +370,8 @@ int create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); Item *negate_expression(THD *thd, Item *expr); #include "sql_class.h" +#include "sql_acl.h" +#include "tztime.h" #include "opt_range.h" #ifdef HAVE_QUERY_CACHE diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 43407b345fa..ccb38b40802 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -17,7 +17,6 @@ #include "mysql_priv.h" #include #include -#include "sql_acl.h" #include "slave.h" #include "sql_repl.h" #include "repl_failsafe.h" diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 356ec80608c..85a51ba9b51 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -20,7 +20,6 @@ #include "repl_failsafe.h" #include "sql_repl.h" #include "slave.h" -#include "sql_acl.h" #include "log_event.h" #include diff --git a/sql/set_var.cc b/sql/set_var.cc index 2031ac15412..bbc9cf77c9f 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -55,7 +55,6 @@ #include "mysql_priv.h" #include #include "slave.h" -#include "sql_acl.h" #include #include #include diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d6f52fed1d2..b880a7b2b65 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -26,7 +26,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "hash_filo.h" #ifdef HAVE_REPLICATION #include "sql_repl.h" //for tables_ok() diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a5db02478ac..a8e1d3020ca 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -18,7 +18,6 @@ /* Basic functions needed by many modules */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" #include #include diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 1bf8d179770..0e2058d73e9 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -300,7 +300,6 @@ TODO list: #include #include #include -#include "sql_acl.h" #include "ha_myisammrg.h" #ifndef MASTER #include "../srclib/myisammrg/myrg_def.h" diff --git a/sql/sql_class.cc b/sql/sql_class.cc index bab81d785c3..1ba34595dd9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -27,7 +27,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include #include #include diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 350a7432990..cb360859049 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include -#include "sql_acl.h" #include #include #ifdef __WIN__ diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 3259e0a4f22..9475ec08c96 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -23,7 +23,6 @@ #include "mysql_priv.h" #include "sql_select.h" -#include "sql_acl.h" static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, TABLE_LIST *t); diff --git a/sql/sql_do.cc b/sql/sql_do.cc index 0d4529fb29e..af72632199f 100644 --- a/sql/sql_do.cc +++ b/sql/sql_do.cc @@ -18,7 +18,6 @@ /* Execute DO statement */ #include "mysql_priv.h" -#include "sql_acl.h" int mysql_do(THD *thd, List &values) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d590d3b5093..f191a4b327a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -18,7 +18,6 @@ /* Insert of records */ #include "mysql_priv.h" -#include "sql_acl.h" static int check_null_fields(THD *thd,TABLE *entry); #ifndef EMBEDDED_LIBRARY diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e066e447345..3dec17ae8ba 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "repl_failsafe.h" #include @@ -3571,7 +3570,7 @@ error: /* Check grants for commands which work only with one table and all other - tables belong to subselects. + tables belonging to subselects or implicitly opened tables. SYNOPSIS check_one_table_access() @@ -3593,7 +3592,7 @@ int check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables) if (grant_option && check_grant(thd, privilege, tables, 0, 1, 0)) return 1; - /* Check rights on tables of subselect (if exists) */ + /* Check rights on tables of subselects and implictly opened tables */ TABLE_LIST *subselects_tables; if ((subselects_tables= tables->next)) { @@ -5229,7 +5228,10 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info",("Checking sub query list")); for (table= tables; table; table= table->next) { - if (table->table_in_update_from_clause) + if (my_tz_check_n_skip_implicit_tables(&table, + lex->time_zone_tables_used)) + continue; + else if (table->table_in_update_from_clause) { /* If we check table by local TABLE_LIST copy then we should copy diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index a790e6fe9d8..69e3cddfdde 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -68,7 +68,6 @@ Long data handling: ***********************************************************************/ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" // for JOIN #include // for isspace() #ifdef EMBEDDED_LIBRARY diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index bbcea537ff1..6854cb24ee9 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -18,7 +18,6 @@ #ifdef HAVE_REPLICATION #include "sql_repl.h" -#include "sql_acl.h" #include "log_event.h" #include diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bda490e2916..4454499c1fc 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include "sql_select.h" // For select_describe -#include "sql_acl.h" #include "repl_failsafe.h" #include diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..4a225913eaa 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -21,7 +21,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" static bool safe_update_on_fly(JOIN_TAB *join_tab, List *fields); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8cbfaf3f99b..03acc81b5ab 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -32,7 +32,6 @@ #define Select Lex->current_select #include "mysql_priv.h" #include "slave.h" -#include "sql_acl.h" #include "lex_symbol.h" #include "item_create.h" #include diff --git a/sql/tztime.h b/sql/tztime.h index 9f969639bd0..2214c1b29d6 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -66,8 +66,8 @@ extern void my_tz_free(); /* - Check if we have pointer to the beggining of list of implictly used - time zone tables and fast-forward to its end. + Check if we have pointer to the begining of list of implicitly used time + zone tables, set SELECT_ACL for them and fast-forward to its end. SYNOPSIS my_tz_check_n_skip_implicit_tables() @@ -87,6 +87,8 @@ inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table, { if (*table == tz_tables) { + for (int i= 0; i < 4; i++) + (*table)[i].grant.privilege= SELECT_ACL; (*table)+= 3; return TRUE; } -- cgit v1.2.1 From 5535fa96fbbee28558bb2fccbc8eecf4872b37ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 12:47:20 +0200 Subject: Ensure that we free memory used with --order-by-primary (in mysqldump) Simple, non critical, fix to mysql_fix_privilege_tables client/mysqldump.c: Ensure that we free memory used with --order-by-primary mysql-test/t/system_mysql_db_fix.test: Remove warnings when compiled with support for ISAM scripts/mysql_fix_privilege_tables.sh: Ensure that 'my_print_defaults' is called correctly sql/set_var.cc: Code style cleanups sql/sql_db.cc: Fixed comments sql/udf_example.cc: Fixed comments --- client/mysqldump.c | 6 ++++-- mysql-test/t/system_mysql_db_fix.test | 6 ++++++ scripts/mysql_fix_privilege_tables.sh | 8 ++++++-- sql/set_var.cc | 14 +++++--------- sql/sql_db.cc | 28 +++++++++++++++------------- sql/udf_example.cc | 13 ++++++++----- 6 files changed, 44 insertions(+), 31 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 489063ffc73..d7cdf5c6624 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1825,8 +1825,6 @@ static void dumpTable(uint numFields, char *table) err: if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); - if (order_by) - my_free(order_by, MYF(0)); safe_exit(error); return; } /* dumpTable */ @@ -1978,6 +1976,8 @@ static int dump_all_tables_in_db(char *database) numrows = getTableStructure(table, database); if (!dFlag && numrows > 0) dumpTable(numrows,table); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; } if (opt_xml) { @@ -2027,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables) numrows = getTableStructure(*table_names, db); if (!dFlag && numrows > 0) dumpTable(numrows, *table_names); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; } if (opt_xml) { diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index 6c44535e3b7..1539d210a3a 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -9,6 +9,7 @@ use test; # create system tables as in mysql-3.20 +--disable_warnings CREATE TABLE db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -23,10 +24,12 @@ CREATE TABLE db ( KEY User (User) ) 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'); +--disable_warnings CREATE TABLE host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -39,7 +42,9 @@ CREATE TABLE host ( PRIMARY KEY Host (Host,Db) ) type=ISAM; +--enable-warnings +--disable_warnings CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, @@ -56,6 +61,7 @@ CREATE TABLE user ( PRIMARY KEY Host (Host,User) ) type=ISAM; +--enable-warnings 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'); diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index b84e512b69a..56807a81d7c 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -14,6 +14,7 @@ port="" socket="" database="mysql" bindir="" +print_defaults_bindir="." file=mysql_fix_privilege_tables.sql @@ -57,7 +58,9 @@ parse_arguments() { --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --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" then @@ -73,7 +76,8 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [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 if test -x $dir/my_print_defaults then diff --git a/sql/set_var.cc b/sql/set_var.cc index 79be4dc1c46..35a2c264f28 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -359,22 +359,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); #endif + #ifdef HAVE_NDBCLUSTER_DB -// ndb thread specific variable settings +/* ndb thread specific variable settings */ sys_var_thd_ulong sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", &SV::ndb_autoincrement_prefetch_sz); sys_var_thd_bool -sys_ndb_force_send("ndb_force_send", - &SV::ndb_force_send); +sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send); sys_var_thd_bool -sys_ndb_use_exact_count("ndb_use_exact_count", - &SV::ndb_use_exact_count); +sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count); sys_var_thd_bool -sys_ndb_use_transactions("ndb_use_transactions", - &SV::ndb_use_transactions); -// ndb server global variable settings -// none +sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions); #endif /* Time/date/datetime formats */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e3ca0328382..00dff1d713b 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -390,7 +390,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, 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)) { error= -1; @@ -514,7 +514,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) 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))) goto exit2; @@ -542,9 +542,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, /* suppress_use */ TRUE); - // Write should use the database being created as the "current - // database" and not the threads current database, which is the - // default. + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ qinfo.db = db; qinfo.db_len = strlen(db); @@ -577,7 +579,6 @@ exit2: -1 Error generated */ - int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { long deleted=0; @@ -589,7 +590,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) 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)) { error= -1; @@ -657,10 +658,11 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { Query_log_event qinfo(thd, query, query_length, 0, /* suppress_use */ TRUE); - - // Write should use the database being created as the "current - // database" and not the threads current database, which is the - // default. + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ qinfo.db = db; qinfo.db_len = strlen(db); @@ -774,7 +776,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, found_other_files++; continue; } - // just for safety we use files_charset_info + /* just for safety we use files_charset_info */ if (db && !my_strcasecmp(files_charset_info, extension, reg_ext)) { @@ -909,7 +911,7 @@ bool mysql_change_db(THD *thd, const char *name) if (!dbname || !(db_length= strlen(dbname))) { 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 */ } if (check_db_name(dbname)) diff --git a/sql/udf_example.cc b/sql/udf_example.cc index 7e2ee9113b2..50de0f187fe 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) return 1; } bzero(initid->ptr,sizeof(longlong)); - // Fool MySQL to think that this function is a constant - // This will ensure that MySQL only evalutes the function - // when the rows are sent to the client and not before any ORDER BY - // clauses + /* + Fool MySQL to think that this function is a constant + This will ensure that MySQL only evalutes the function + when the rows are sent to the client and not before any ORDER BY + clauses + */ initid->const_item=1; return 0; } @@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null, ulonglong val=0; if (args->arg_count) val= *((longlong*) args->args[0]); - return ++ *((longlong*) initid->ptr) + val; + return ++*((longlong*) initid->ptr) + val; } + /**************************************************************************** ** Some functions that handles IP and hostname conversions ** The orignal function was from Zeev Suraski. -- cgit v1.2.1 From 809ea73208ab3edd36cad744918a1d4d3785411a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 15:56:19 +0400 Subject: Bugs: #7111: server crashes when regexp is used --- mysql-test/r/ctype_uca.result | 11 +++++++++++ mysql-test/t/ctype_uca.test | 8 ++++++++ regex/regcomp.c | 21 +++++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index cb060ad7ee4..fbe876d3b66 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2375,3 +2375,14 @@ DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +a a regexp '[a]' +A 1 +B 0 +C 0 +a 1 +b 0 +c 0 +drop table t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 11833ba9bc7..8bca2a4b3c2 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -444,3 +444,11 @@ DROP TABLE t1; SET @test_character_set= 'utf8'; SET @test_collation= 'utf8_swedish_ci'; -- source include/ctype_common.inc + +# +# Bug 7111 server crashes when regexp is used +# +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +drop table t1; diff --git a/regex/regcomp.c b/regex/regcomp.c index 5f0351c32aa..998b39379aa 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -860,11 +860,28 @@ othercase(charset,ch) CHARSET_INFO *charset; int ch; { + /* + In MySQL some multi-byte character sets + have 'ctype' array but don't have 'to_lower' + and 'to_upper' arrays. In this case we handle + only basic latin letters a..z and A..Z. + + If 'to_lower' and 'to_upper' arrays are empty in a character set, + then my_isalpha(cs, ch) should never return TRUE for characters + other than basic latin letters. Otherwise it should be + considered as a mistake in character set definition. + */ assert(my_isalpha(charset,ch)); if (my_isupper(charset,ch)) - return(my_tolower(charset,ch)); + { + return(charset->to_lower ? my_tolower(charset,ch) : + ch - 'A' + 'a'); + } else if (my_islower(charset,ch)) - return(my_toupper(charset,ch)); + { + return(charset->to_upper ? my_toupper(charset,ch) : + ch - 'a' + 'A'); + } else /* peculiar, but could happen */ return(ch); } -- cgit v1.2.1 From f67fe154dd4025ccf0e1f74b0841410c80f21a46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 13:36:23 +0100 Subject: bug#6995 - fixed so that ndb_restore 4.1.8 can read files created by 4.1.7 as bugfix changed binary format ndb/tools/restore/Restore.cpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 ndb/tools/restore/Restore.hpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 ndb/tools/restore/main.cpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 --- ndb/tools/restore/Restore.cpp | 35 +++++++++++++++++++++++++++++++---- ndb/tools/restore/Restore.hpp | 4 +++- ndb/tools/restore/main.cpp | 9 ++++++++- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index de769b4c880..277cdc72532 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -192,14 +192,15 @@ RestoreMetaData::readGCPEntry() { return true; } -TableS::TableS(NdbTableImpl* tableImpl) +TableS::TableS(Uint32 version, NdbTableImpl* tableImpl) : m_dictTable(tableImpl) { m_dictTable = tableImpl; m_noOfNullable = m_nullBitmaskSize = 0; m_auto_val_id= ~(Uint32)0; m_max_auto_val= 0; - + backupVersion = version; + for (int i = 0; i < tableImpl->getNoOfColumns(); i++) createAttr(tableImpl->getColumn(i)); } @@ -226,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len) debug << "parseTableInfo " << tableImpl->getName() << " done" << endl; - TableS * table = new TableS(tableImpl); + TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl); if(table == NULL) { return false; } - table->setBackupVersion(m_fileHeader.NdbVersion); debug << "Parsed table id " << table->getTableId() << endl; debug << "Parsed table #attr " << table->getNoOfAttributes() << endl; @@ -334,6 +334,27 @@ RestoreDataIterator::getNextTuple(int & res) Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr; ptr += m_currentTable->m_nullBitmaskSize; Uint32 i; + for(i= 0; i < m_currentTable->m_fixedKeys.size(); i++){ + assert(ptr < buf_ptr + dataLength); + + const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId; + + AttributeData * attr_data = m_tuple.getData(attrId); + const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); + + const Uint32 sz = attr_desc->getSizeInWords(); + + attr_data->null = false; + attr_data->void_value = ptr; + + if(!Twiddle(attr_desc, attr_data)) + { + res = -1; + return NULL; + } + ptr += sz; + } + for(i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){ assert(ptr < buf_ptr + dataLength); @@ -678,6 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column) if (d->m_column->getAutoIncrement()) m_auto_val_id= d->attrId; + if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7)) + { + m_fixedKeys.push_back(d); + return; + } + if(!d->m_column->getNullable()) { m_fixedAttribs.push_back(d); diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index a7d4fc174c7..e0b06c1774c 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -123,6 +123,8 @@ class TableS { Uint32 schemaVersion; Uint32 backupVersion; Vector allAttributesDesc; + Vector m_fixedKeys; + //Vector m_variableKey; Vector m_fixedAttribs; Vector m_variableAttribs; @@ -138,7 +140,7 @@ class TableS { public: class NdbDictionary::Table* m_dictTable; - TableS (class NdbTableImpl* dictTable); + TableS (Uint32 version, class NdbTableImpl* dictTable); ~TableS(); Uint32 getTableId() const { diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/main.cpp index 482212911cb..575cd9b3b2f 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/main.cpp @@ -247,11 +247,18 @@ main(int argc, char** argv) ndbout << "Failed to read " << metaData.getFilename() << endl << endl; return -1; } + + const BackupFormat::FileHeader & tmp = metaData.getFileHeader(); + const Uint32 version = tmp.NdbVersion; + + ndbout << "Ndb version in backup files: " + << getVersionString(version, 0) << endl; + /** * check wheater we can restore the backup (right version). */ int res = metaData.loadContent(); - + if (res == 0) { ndbout_c("Restore: Failed to load content"); -- cgit v1.2.1 From 52a754edd3f1961998b098f1a907fb068040a8ea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 15:18:31 +0100 Subject: ndb: sunfire100c: fix aligment when 32-bit pointers and 64-bit ha_rows ndb/src/ndbapi/DictCache.cpp: fix aligment when 32-bit pointers and 64-bit ha_rows ndb/src/ndbapi/DictCache.hpp: fix aligment when 32-bit pointers and 64-bit ha_rows --- ndb/src/ndbapi/DictCache.cpp | 6 ++++-- ndb/src/ndbapi/DictCache.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 12300ce216f..afdb37aa53f 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -24,10 +24,12 @@ Ndb_local_table_info * Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) { - void *data= malloc(sizeof(NdbTableImpl)+sz-1); + if (sz % 8 != 0) // round to Uint64 + sz += 8 - sz % 8; + void *data= malloc(sizeof(NdbTableImpl)+sz-8); if (data == 0) return 0; - memset(data,0,sizeof(NdbTableImpl)+sz-1); + memset(data,0,sizeof(NdbTableImpl)+sz-8); new (data) Ndb_local_table_info(table_impl); return (Ndb_local_table_info *) data; } diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 0dc853306fa..a517acee56b 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -32,7 +32,7 @@ public: static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0); static void destroy(Ndb_local_table_info *); NdbTableImpl *m_table_impl; - char m_local_data[1]; + Uint64 m_local_data[1]; private: Ndb_local_table_info(NdbTableImpl *table_impl); ~Ndb_local_table_info(); -- cgit v1.2.1 From c4be610466b4af0ba9a88d76f951948d77815134 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 19:47:41 +0100 Subject: Do-compile: Added --with-csv and --with-example for CSV and Example storage engines Build-tools/Do-compile: Added --with-csv and --with-example for CSV and Example storage engines --- Build-tools/Do-compile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index da2be90a428..78dcd634f7c 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -10,7 +10,7 @@ use Sys::Hostname; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; +$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( @@ -57,6 +57,8 @@ GetOptions( "version-suffix=s", "with-archive", "with-cluster", + "with-csv", + "with-example", "with-debug", "with-low-memory", "with-other-libc=s", @@ -279,6 +281,8 @@ if ($opt_stage <= 1) $opt_embedded_test= 0 if ($opt_without_embedded); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); + $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); + $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) @@ -637,11 +641,17 @@ If user is empty then no mail is sent. Set name suffix (e.g. 'com' or '-max') for a distribution --with archive -Enable the Archive storage Engine +Enable the Archive storage engine --with cluster Compile and test with NDB Cluster enabled +--with-csv +Enable the CSV storage engine + +--with-example +Enable the Example storage engine + --with-debug Build binaries with debug information (implies "--no-strip") -- cgit v1.2.1 From f4f4e6367dcbe917ca6a935b881650c28949ce00 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 00:06:33 +0200 Subject: srv0srv.c: srv_printf_innodb_monitor(): Removed extraneous rewind() call. The caller of this function calls rewind() if necessary. In this way, we avoid rewind()ing stderr in srv_lock_timeout_and_monitor_thread(). innobase/srv/srv0srv.c: srv_printf_innodb_monitor(): Removed extraneous rewind() call. The caller of this function calls rewind() if necessary. In this way, we avoid rewind()ing stderr in srv_lock_timeout_and_monitor_thread(). --- innobase/srv/srv0srv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 99a2db57d79..d633c67cdf3 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1439,7 +1439,6 @@ srv_printf_innodb_monitor( srv_last_monitor_time = time(NULL); - rewind(file); fputs("\n=====================================\n", file); ut_print_timestamp(file); -- cgit v1.2.1 From 41a61e84d724e48f6d1e026e7f79469b55ac230c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 00:17:43 +0200 Subject: A fix for a crashing bug #7101, which occures when the expression involving LEFT() function is used in GROUP BY field. mysql-test/r/func_str.result: A result for bug #7101 test case mysql-test/t/func_str.test: Test case for bug #7101 --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 8 ++++++++ sql/item_strfunc.cc | 5 +++-- sql/item_strfunc.h | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 8d49d55be39..0e98f304d89 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -685,3 +685,9 @@ drop table t1; select left(1234, 3) + 0; left(1234, 3) + 0 123 +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +total reg +10 2004-12-10 +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index d5a3e80c417..2934a9733a7 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -421,3 +421,11 @@ drop table t1; # select left(1234, 3) + 0; + +# +# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation +# +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 893126b7fe6..7fc5e51621e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -955,8 +955,9 @@ String *Item_func_left::val_str(String *str) if (res->length() <= (uint) length || res->length() <= (char_pos= res->charpos(length))) return res; - str_value.set(*res, 0, char_pos); - return &str_value; + + tmp_value.set(*res, 0, char_pos); + return &tmp_value; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index afe03c31345..8efe60bbd89 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -162,6 +162,7 @@ public: class Item_func_left :public Item_str_func { + String tmp_value; public: Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {} String *val_str(String *); -- cgit v1.2.1 From 7a60d1558a89df5f198884d360a14bf2b48f2c49 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 02:36:45 +0200 Subject: dict0dict.c: Fix the bug that the character 0xA0 that EMS MySQL Manager in ALTER TABLE adds after a table name confuses the InnoDB FOREIGN KEY parser, causing an error 121 when we try to add a new constraint; a full fix would require the lexer to be aware of thd->charset_info() and UTF-8 innobase/dict/dict0dict.c: Fix the bug that the character 0xA0 that EMS MySQL Manager in ALTER TABLE adds after a table name confuses the InnoDB FOREIGN KEY parser, causing an error 121 when we try to add a new constraint; a full fix would require the lexer to be aware of thd->charset_info() and UTF-8 --- innobase/dict/dict0dict.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 183c547ab2b..ecc533ed26f 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2364,6 +2364,8 @@ dict_scan_id( ulint len = 0; const char* s; char* d; + ulint id_len; + byte* b; *id = NULL; @@ -2425,6 +2427,28 @@ dict_scan_id( *id = s; } + if (heap) { + /* EMS MySQL Manager sometimes adds characters 0xA0 (in + latin1, a 'non-breakable space') to the end of a table name. + But isspace(0xA0) is not true, which confuses our foreign key + parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2 + and 0xA0 are at the end of the string. + + TODO: we should lex the string using thd->charset_info, and + my_isspace(). Only after that, convert id names to UTF-8. */ + + b = (byte*)(*id); + id_len = strlen(b); + + if (id_len >= 3 && b[id_len - 1] == 0xA0 + && b[id_len - 2] == 0xC2) { + + /* Strip the 2 last bytes */ + + b[id_len - 2] = '\0'; + } + } + return(ptr); } @@ -2479,7 +2503,7 @@ dict_scan_col( } /************************************************************************* -Scans the referenced table name from an SQL string. */ +Scans a table name from an SQL string. */ static const char* dict_scan_table_name( @@ -2490,7 +2514,7 @@ dict_scan_table_name( const char* name, /* in: foreign key table name */ ibool* success,/* out: TRUE if ok name found */ mem_heap_t* heap, /* in: heap where to allocate the id */ - const char** ref_name)/* out,own: the referenced table name; + const char** ref_name)/* out,own: the table name; NULL if no name was scannable */ { const char* database_name = NULL; -- cgit v1.2.1 From 95056a0b657b6d4f3a9106e4f21dfdf348da3690 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 16:06:49 +0400 Subject: Fix for bug #6516 (Server crash loading spatial data) (after discussion with SerG) include/my_base.h: Handler error code added myisam/mi_write.c: New error code handled myisam/rt_index.c: check for zero length added myisam/sp_key.c: zero length check added mysql-test/r/gis-rtree.result: appropriate test result mysql-test/t/gis-rtree.test: test case sql/handler.cc: new error code handling added --- include/my_base.h | 1 + myisam/mi_write.c | 7 ++++--- myisam/rt_index.c | 3 ++- myisam/sp_key.c | 5 +++++ mysql-test/r/gis-rtree.result | 6 ++++++ mysql-test/t/gis-rtree.test | 7 +++++++ sql/handler.cc | 6 +++++- 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index d884113dc4d..7290d0da09b 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -291,6 +291,7 @@ enum ha_base_keytype { #define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ #define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ +#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ /* Other constants */ diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 303e924118f..7d053ddfd22 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record) { if (local_lock_tree) rw_unlock(&share->key_root_lock[i]); - DBUG_PRINT("error",("Got error: %d on write",my_errno)); - goto err; + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; } } if (local_lock_tree) @@ -159,7 +159,8 @@ int mi_write(MI_INFO *info, byte *record) err: save_errno=my_errno; - if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL || + my_errno == HA_ERR_NULL_IN_SPATIAL) { if (info->bulk_insert) { diff --git a/myisam/rt_index.c b/myisam/rt_index.c index cfb2ca877f4..bdf5ee9c60f 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -710,7 +710,8 @@ err1: int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) { - return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0; + return (!key_length || + (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0; } diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 0e424a9e193..b61e8094cde 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); + if (!dptr) + { + my_errno= HA_ERR_NULL_IN_SPATIAL; + return 0; + } sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 4ca8c379307..7b63654ffaf 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -798,3 +798,9 @@ INSERT INTO t1 (name, kind, line) VALUES ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +ERROR HY000: Unknown error +drop table t1, t2; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index cb1627e0500..716dd38a119 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -165,3 +165,10 @@ INSERT INTO t1 (name, kind, line) VALUES ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; + +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +--error 1105 +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +drop table t1, t2; diff --git a/sql/handler.cc b/sql/handler.cc index 530c5f137ec..3200c6932e9 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1083,6 +1083,9 @@ void handler::print_error(int error, myf errflag) textno=ER_DUP_KEY; break; } + case HA_ERR_NULL_IN_SPATIAL: + textno= ER_UNKNOWN_ERROR; + DBUG_VOID_RETURN; case HA_ERR_FOUND_DUPP_UNIQUE: textno=ER_DUP_UNIQUE; break; @@ -1196,7 +1199,8 @@ uint handler::get_dup_key(int error) { DBUG_ENTER("handler::get_dup_key"); table->file->errkey = (uint) -1; - if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE) + if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE || + error == HA_ERR_NULL_IN_SPATIAL) info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK); DBUG_RETURN(table->file->errkey); } -- cgit v1.2.1 From d408a4aad1c224bfd8be64dbdd705fd17678bef9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 13:06:58 +0100 Subject: Makefile.am: Moved "../regex/libregex.a" before "../libmysql/libmysqlclient.la" when linking. For -all-static linking libtool put -lc after the .la file and this put the libc regex functions before our regex functions when linking on Linux. client/Makefile.am: Moved "../regex/libregex.a" before "../libmysql/libmysqlclient.la" when linking, for static linking libtool put -lc after the .la and this put the libc regex functions before out regex functions in the link on Linux. --- client/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index fa317367f71..0404aacb383 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -21,6 +21,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ DEPLIB= ../libmysql/libmysqlclient.la +REGEXLIB= ../regex/libregex.a LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen @@ -37,8 +38,8 @@ mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c -mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB) +mysqltest_LDADD = $(REGEXLIB) $(LDADD) mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlmanagerc_SOURCES = mysqlmanagerc.c -- cgit v1.2.1 From 05cb2737b93ab4c8509ca78126883e6c850aa218 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 16:08:18 +0400 Subject: Bug #6819 Some ujis characters cannot be inserted into table Allow to insert not-assigned UJIS codes. --- mysql-test/r/ctype_ujis.result | 2041 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_ujis.test | 1022 ++++++++++++++++++++ strings/ctype-ujis.c | 44 +- 3 files changed, 3105 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index d02ac0062f8..aa4c347d54f 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -166,3 +166,2044 @@ SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; a b 2 iiijjjkkkl DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +HEX(c) +A2AF +A2B0 +A2B1 +A2B2 +A2B3 +A2B4 +A2B5 +A2B6 +A2B7 +A2B8 +A2B9 +A2C2 +A2C3 +A2C4 +A2C5 +A2C6 +A2C7 +A2C8 +A2C9 +A2D1 +A2D2 +A2D3 +A2D4 +A2D5 +A2D6 +A2D7 +A2D8 +A2D9 +A2DA +A2DB +A2EB +A2EC +A2ED +A2EE +A2EF +A2F0 +A2F1 +A2FA +A2FB +A2FC +A2FD +A3A1 +A3A2 +A3A3 +A3A4 +A3A5 +A3A6 +A3A7 +A3A8 +A3A9 +A3AA +A3AB +A3AC +A3AD +A3AE +A3AF +A3BA +A3BB +A3BC +A3BD +A3BE +A3BF +A3C0 +A3DB +A3DC +A3DD +A3DE +A3DF +A3E0 +A3FB +A3FC +A3FD +A3FE +A4F4 +A4F5 +A4F6 +A4F7 +A4F8 +A4F9 +A4FA +A4FB +A4FC +A4FD +A4FE +A5F7 +A5F8 +A5F9 +A5FA +A5FB +A5FC +A5FD +A5FE +A6B9 +A6BA +A6BB +A6BC +A6BD +A6BE +A6BF +A6C0 +A6D9 +A6DA +A6DB +A6DC +A6DD +A6DE +A6DF +A6E0 +A6E1 +A6E2 +A6E3 +A6E4 +A6E5 +A6E6 +A6E7 +A6E8 +A6E9 +A6EA +A6EB +A6EC +A6ED +A6EE +A6EF +A6F0 +A6F1 +A6F2 +A6F3 +A6F4 +A6F5 +A6F6 +A6F7 +A6F8 +A6F9 +A6FA +A6FB +A6FC +A6FD +A6FE +A7C2 +A7C3 +A7C4 +A7C5 +A7C6 +A7C7 +A7C8 +A7C9 +A7CA +A7CB +A7CC +A7CD +A7CE +A7CF +A7D0 +A7F2 +A7F3 +A7F4 +A7F5 +A7F6 +A7F7 +A7F8 +A7F9 +A7FA +A7FB +A7FC +A7FD +A7FE +A8C1 +A8C2 +A8C3 +A8C4 +A8C5 +A8C6 +A8C7 +A8C8 +A8C9 +A8CA +A8CB +A8CC +A8CD +A8CE +A8CF +A8D0 +A8D1 +A8D2 +A8D3 +A8D4 +A8D5 +A8D6 +A8D7 +A8D8 +A8D9 +A8DA +A8DB +A8DC +A8DD +A8DE +A8DF +A8E0 +A8E1 +A8E2 +A8E3 +A8E4 +A8E5 +A8E6 +A8E7 +A8E8 +A8E9 +A8EA +A8EB +A8EC +A8ED +A8EE +A8EF +A8F0 +A8F1 +A8F2 +A8F3 +A8F4 +A8F5 +A8F6 +A8F7 +A8F8 +A8F9 +A8FA +A8FB +A8FC +A8FD +A8FE +A9A1 +A9A2 +A9A3 +A9A4 +A9A5 +A9A6 +A9A7 +A9A8 +A9A9 +A9AA +A9AB +A9AC +A9AD +A9AE +A9AF +A9B0 +A9B1 +A9B2 +A9B3 +A9B4 +A9B5 +A9B6 +A9B7 +A9B8 +A9B9 +A9BA +A9BB +A9BC +A9BD +A9BE +A9BF +A9C0 +A9C1 +A9C2 +A9C3 +A9C4 +A9C5 +A9C6 +A9C7 +A9C8 +A9C9 +A9CA +A9CB +A9CC +A9CD +A9CE +A9CF +A9D0 +A9D1 +A9D2 +A9D3 +A9D4 +A9D5 +A9D6 +A9D7 +A9D8 +A9D9 +A9DA +A9DB +A9DC +A9DD +A9DE +A9DF +A9E0 +A9E1 +A9E2 +A9E3 +A9E4 +A9E5 +A9E6 +A9E7 +A9E8 +A9E9 +A9EA +A9EB +A9EC +A9ED +A9EE +A9EF +A9F0 +A9F1 +A9F2 +A9F3 +A9F4 +A9F5 +A9F6 +A9F7 +A9F8 +A9F9 +A9FA +A9FB +A9FC +A9FD +A9FE +AAA1 +AAA2 +AAA3 +AAA4 +AAA5 +AAA6 +AAA7 +AAA8 +AAA9 +AAAA +AAAB +AAAC +AAAD +AAAE +AAAF +AAB0 +AAB1 +AAB2 +AAB3 +AAB4 +AAB5 +AAB6 +AAB7 +AAB8 +AAB9 +AABA +AABB +AABC +AABD +AABE +AABF +AAC0 +AAC1 +AAC2 +AAC3 +AAC4 +AAC5 +AAC6 +AAC7 +AAC8 +AAC9 +AACA +AACB +AACC +AACD +AACE +AACF +AAD0 +AAD1 +AAD2 +AAD3 +AAD4 +AAD5 +AAD6 +AAD7 +AAD8 +AAD9 +AADA +AADB +AADC +AADD +AADE +AADF +AAE0 +AAE1 +AAE2 +AAE3 +AAE4 +AAE5 +AAE6 +AAE7 +AAE8 +AAE9 +AAEA +AAEB +AAEC +AAED +AAEE +AAEF +AAF0 +AAF1 +AAF2 +AAF3 +AAF4 +AAF5 +AAF6 +AAF7 +AAF8 +AAF9 +AAFA +AAFB +AAFC +AAFD +AAFE +ABA1 +ABA2 +ABA3 +ABA4 +ABA5 +ABA6 +ABA7 +ABA8 +ABA9 +ABAA +ABAB +ABAC +ABAD +ABAE +ABAF +ABB0 +ABB1 +ABB2 +ABB3 +ABB4 +ABB5 +ABB6 +ABB7 +ABB8 +ABB9 +ABBA +ABBB +ABBC +ABBD +ABBE +ABBF +ABC0 +ABC1 +ABC2 +ABC3 +ABC4 +ABC5 +ABC6 +ABC7 +ABC8 +ABC9 +ABCA +ABCB +ABCC +ABCD +ABCE +ABCF +ABD0 +ABD1 +ABD2 +ABD3 +ABD4 +ABD5 +ABD6 +ABD7 +ABD8 +ABD9 +ABDA +ABDB +ABDC +ABDD +ABDE +ABDF +ABE0 +ABE1 +ABE2 +ABE3 +ABE4 +ABE5 +ABE6 +ABE7 +ABE8 +ABE9 +ABEA +ABEB +ABEC +ABED +ABEE +ABEF +ABF0 +ABF1 +ABF2 +ABF3 +ABF4 +ABF5 +ABF6 +ABF7 +ABF8 +ABF9 +ABFA +ABFB +ABFC +ABFD +ABFE +ACA1 +ACA2 +ACA3 +ACA4 +ACA5 +ACA6 +ACA7 +ACA8 +ACA9 +ACAA +ACAB +ACAC +ACAD +ACAE +ACAF +ACB0 +ACB1 +ACB2 +ACB3 +ACB4 +ACB5 +ACB6 +ACB7 +ACB8 +ACB9 +ACBA +ACBB +ACBC +ACBD +ACBE +ACBF +ACC0 +ACC1 +ACC2 +ACC3 +ACC4 +ACC5 +ACC6 +ACC7 +ACC8 +ACC9 +ACCA +ACCB +ACCC +ACCD +ACCE +ACCF +ACD0 +ACD1 +ACD2 +ACD3 +ACD4 +ACD5 +ACD6 +ACD7 +ACD8 +ACD9 +ACDA +ACDB +ACDC +ACDD +ACDE +ACDF +ACE0 +ACE1 +ACE2 +ACE3 +ACE4 +ACE5 +ACE6 +ACE7 +ACE8 +ACE9 +ACEA +ACEB +ACEC +ACED +ACEE +ACEF +ACF0 +ACF1 +ACF2 +ACF3 +ACF4 +ACF5 +ACF6 +ACF7 +ACF8 +ACF9 +ACFA +ACFB +ACFC +ACFD +ACFE +ADA1 +ADA2 +ADA3 +ADA4 +ADA5 +ADA6 +ADA7 +ADA8 +ADA9 +ADAA +ADAB +ADAC +ADAD +ADAE +ADAF +ADB0 +ADB1 +ADB2 +ADB3 +ADB4 +ADB5 +ADB6 +ADB7 +ADB8 +ADB9 +ADBA +ADBB +ADBC +ADBD +ADBE +ADBF +ADC0 +ADC1 +ADC2 +ADC3 +ADC4 +ADC5 +ADC6 +ADC7 +ADC8 +ADC9 +ADCA +ADCB +ADCC +ADCD +ADCE +ADCF +ADD0 +ADD1 +ADD2 +ADD3 +ADD4 +ADD5 +ADD6 +ADD7 +ADD8 +ADD9 +ADDA +ADDB +ADDC +ADDD +ADDE +ADDF +ADE0 +ADE1 +ADE2 +ADE3 +ADE4 +ADE5 +ADE6 +ADE7 +ADE8 +ADE9 +ADEA +ADEB +ADEC +ADED +ADEE +ADEF +ADF0 +ADF1 +ADF2 +ADF3 +ADF4 +ADF5 +ADF6 +ADF7 +ADF8 +ADF9 +ADFA +ADFB +ADFC +ADFD +ADFE +AEA1 +AEA2 +AEA3 +AEA4 +AEA5 +AEA6 +AEA7 +AEA8 +AEA9 +AEAA +AEAB +AEAC +AEAD +AEAE +AEAF +AEB0 +AEB1 +AEB2 +AEB3 +AEB4 +AEB5 +AEB6 +AEB7 +AEB8 +AEB9 +AEBA +AEBB +AEBC +AEBD +AEBE +AEBF +AEC0 +AEC1 +AEC2 +AEC3 +AEC4 +AEC5 +AEC6 +AEC7 +AEC8 +AEC9 +AECA +AECB +AECC +AECD +AECE +AECF +AED0 +AED1 +AED2 +AED3 +AED4 +AED5 +AED6 +AED7 +AED8 +AED9 +AEDA +AEDB +AEDC +AEDD +AEDE +AEDF +AEE0 +AEE1 +AEE2 +AEE3 +AEE4 +AEE5 +AEE6 +AEE7 +AEE8 +AEE9 +AEEA +AEEB +AEEC +AEED +AEEE +AEEF +AEF0 +AEF1 +AEF2 +AEF3 +AEF4 +AEF5 +AEF6 +AEF7 +AEF8 +AEF9 +AEFA +AEFB +AEFC +AEFD +AEFE +AFA1 +AFA2 +AFA3 +AFA4 +AFA5 +AFA6 +AFA7 +AFA8 +AFA9 +AFAA +AFAB +AFAC +AFAD +AFAE +AFAF +AFB0 +AFB1 +AFB2 +AFB3 +AFB4 +AFB5 +AFB6 +AFB7 +AFB8 +AFB9 +AFBA +AFBB +AFBC +AFBD +AFBE +AFBF +AFC0 +AFC1 +AFC2 +AFC3 +AFC4 +AFC5 +AFC6 +AFC7 +AFC8 +AFC9 +AFCA +AFCB +AFCC +AFCD +AFCE +AFCF +AFD0 +AFD1 +AFD2 +AFD3 +AFD4 +AFD5 +AFD6 +AFD7 +AFD8 +AFD9 +AFDA +AFDB +AFDC +AFDD +AFDE +AFDF +AFE0 +AFE1 +AFE2 +AFE3 +AFE4 +AFE5 +AFE6 +AFE7 +AFE8 +AFE9 +AFEA +AFEB +AFEC +AFED +AFEE +AFEF +AFF0 +AFF1 +AFF2 +AFF3 +AFF4 +AFF5 +AFF6 +AFF7 +AFF8 +AFF9 +AFFA +AFFB +AFFC +AFFD +AFFE +CFD4 +CFD5 +CFD6 +CFD7 +CFD8 +CFD9 +CFDA +CFDB +CFDC +CFDD +CFDE +CFDF +CFE0 +CFE1 +CFE2 +CFE3 +CFE4 +CFE5 +CFE6 +CFE7 +CFE8 +CFE9 +CFEA +CFEB +CFEC +CFED +CFEE +CFEF +CFF0 +CFF1 +CFF2 +CFF3 +CFF4 +CFF5 +CFF6 +CFF7 +CFF8 +CFF9 +CFFA +CFFB +CFFC +CFFD +CFFE +F4A7 +F4A8 +F4A9 +F4AA +F4AB +F4AC +F4AD +F4AE +F4AF +F4B0 +F4B1 +F4B2 +F4B3 +F4B4 +F4B5 +F4B6 +F4B7 +F4B8 +F4B9 +F4BA +F4BB +F4BC +F4BD +F4BE +F4BF +F4C0 +F4C1 +F4C2 +F4C3 +F4C4 +F4C5 +F4C6 +F4C7 +F4C8 +F4C9 +F4CA +F4CB +F4CC +F4CD +F4CE +F4CF +F4D0 +F4D1 +F4D2 +F4D3 +F4D4 +F4D5 +F4D6 +F4D7 +F4D8 +F4D9 +F4DA +F4DB +F4DC +F4DD +F4DE +F4DF +F4E0 +F4E1 +F4E2 +F4E3 +F4E4 +F4E5 +F4E6 +F4E7 +F4E8 +F4E9 +F4EA +F4EB +F4EC +F4ED +F4EE +F4EF +F4F0 +F4F1 +F4F2 +F4F3 +F4F4 +F4F5 +F4F6 +F4F7 +F4F8 +F4F9 +F4FA +F4FB +F4FC +F4FD +F4FE +DROP TABLE t1; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 9cfb6b14d7e..3f0e9882179 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -119,3 +119,1025 @@ SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; DROP TABLE t1; + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +DROP TABLE t1; diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 94673a20795..fc1496df280 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){ } - /* EUC-JP encoding subcomponents: [x00-x7F] # ASCII/JIS-Roman (one-byte/character) @@ -8252,6 +8251,47 @@ my_jisx0212_uni_onechar(int code){ [xA1-xFE][xA1-xFE] # JIS X 0208:1997 (two bytes/char) */ +static +uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, uint pos) +{ + const uchar *b= (uchar *) beg; + + for ( ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + return chbeg - beg; /* unexpected EOL */ + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + return chbeg - beg; /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + return chbeg - beg; /* unexpected EOL */ + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + return chbeg - beg; /* invalid sequence */ + } + return b - (uchar *) beg; +} + + static uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), const char *str, const char *strend) @@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler= mbcharlen_ujis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, + my_well_formed_len_ujis, my_lengthsp_8bit, my_numcells_eucjp, my_mb_wc_euc_jp, /* mb_wc */ -- cgit v1.2.1 From 220edcf590308c3341057539a02512b3b8e35ff3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 14:01:03 +0100 Subject: mysql-test-run.sh: Use different TESTS_BINDIR for --embedded-server mysql-test/mysql-test-run.sh: Use different TESTS_BINDIR for --embedded-server --- mysql-test/mysql-test-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 09d3511fec8..5a7ede0cba8 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -490,6 +490,7 @@ if [ x$SOURCE_DIST = x1 ] ; then echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2 exit 1 fi + TESTS_BINDIR="$BASEDIR/libmysqld/examples" else MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then @@ -499,6 +500,7 @@ if [ x$SOURCE_DIST = x1 ] ; then else MYSQL_TEST="$BASEDIR/client/mysqltest" fi + TESTS_BINDIR="$BASEDIR/tests" fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" @@ -515,7 +517,6 @@ if [ x$SOURCE_DIST = x1 ] ; then fi CLIENT_BINDIR="$BASEDIR/client" - TESTS_BINDIR="$BASEDIR/tests" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" WAIT_PID="$BASEDIR/extra/mysql_waitpid" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" -- cgit v1.2.1 From 23145c51ca5d3263f87957fc967d5d9d2389b469 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:58:13 +0400 Subject: Privileges columns were removed from output to be able to reuse test results for both server and --embedded-server versions. BitKeeper/deleted/.del-ctype_big5.result.es~f75ebc9f8836316f: Delete: mysql-test/r/ctype_big5.result.es BitKeeper/deleted/.del-ctype_uca.result.es~9fab42f7561fa166: Delete: mysql-test/r/ctype_uca.result.es --- mysql-test/include/ctype_common.inc | 2 + mysql-test/r/ctype_big5.result | 4 +- mysql-test/r/ctype_big5.result.es | 58 - mysql-test/r/ctype_uca.result | 4 +- mysql-test/r/ctype_uca.result.es | 2377 ----------------------------------- 5 files changed, 6 insertions(+), 2439 deletions(-) delete mode 100644 mysql-test/r/ctype_big5.result.es delete mode 100644 mysql-test/r/ctype_uca.result.es diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 77937bdb854..202c508a9c9 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -25,6 +25,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); --enable_warnings # check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" SHOW FULL COLUMNS FROM t1; INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; @@ -37,6 +38,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); --enable_warnings # check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" SHOW FULL COLUMNS FROM t1; INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 789b6e586ad..9b9fcbccbe0 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -10,7 +10,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c char(10) big5_chinese_ci YES MUL NULL select,insert,update,references +c char(10) big5_chinese_ci YES MUL NULL INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; want3results @@ -21,7 +21,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) big5_chinese_ci YES MUL NULL select,insert,update,references +c1 varchar(15) big5_chinese_ci YES MUL NULL INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; want3results diff --git a/mysql-test/r/ctype_big5.result.es b/mysql-test/r/ctype_big5.result.es deleted file mode 100644 index 9b9fcbccbe0..00000000000 --- a/mysql-test/r/ctype_big5.result.es +++ /dev/null @@ -1,58 +0,0 @@ -drop table if exists t1; -SET @test_character_set= 'big5'; -SET @test_collation= 'big5_chinese_ci'; -SET @safe_character_set_server= @@character_set_server; -SET @safe_collation_server= @@collation_server; -SET character_set_server= @test_character_set; -SET collation_server= @test_collation; -CREATE DATABASE d1; -USE d1; -CREATE TABLE t1 (c CHAR(10), KEY(c)); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c char(10) big5_chinese_ci YES MUL NULL -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; -want3results -aaa -aaaa -aaaaa -DROP TABLE t1; -CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) big5_chinese_ci YES MUL NULL -INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); -SELECT c1 as want3results from t1 where c1 like 'l%'; -want3results -location -loberge -lotre -SELECT c1 as want3results from t1 where c1 like 'lo%'; -want3results -location -loberge -lotre -SELECT c1 as want1result from t1 where c1 like 'loc%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'loca%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locat%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locati%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locatio%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'location%'; -want1result -location -DROP TABLE t1; -DROP DATABASE d1; -USE test; -SET character_set_server= @safe_character_set_server; -SET collation_server= @safe_collation_server; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index fbe876d3b66..0573092e39b 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2329,7 +2329,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c char(10) utf8_swedish_ci YES MUL NULL select,insert,update,references +c char(10) utf8_swedish_ci YES MUL NULL INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; want3results @@ -2340,7 +2340,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) utf8_swedish_ci YES MUL NULL select,insert,update,references +c1 varchar(15) utf8_swedish_ci YES MUL NULL INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; want3results diff --git a/mysql-test/r/ctype_uca.result.es b/mysql-test/r/ctype_uca.result.es deleted file mode 100644 index 1f86376def6..00000000000 --- a/mysql-test/r/ctype_uca.result.es +++ /dev/null @@ -1,2377 +0,0 @@ -DROP TABLE IF EXISTS t1; -set names utf8; -set collation_connection=utf8_unicode_ci; -select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; -'a' = 'a' 'a' = 'a ' 'a ' = 'a' -1 1 1 -select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; -'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a' -0 1 0 -select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; -'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a ' -0 1 0 -select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; -'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t' -0 0 1 -select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; -'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t' -0 0 1 -select 'a a' > 'a', 'a \t' < 'a'; -'a a' > 'a' 'a \t' < 'a' -1 1 -select 'c' like '\_' as want0; -want0 -0 -CREATE TABLE t ( -c char(20) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -INSERT INTO t VALUES ('a'),('ab'),('aba'); -ALTER TABLE t ADD INDEX (c); -SELECT c FROM t WHERE c LIKE 'a%'; -c -a -ab -aba -DROP TABLE t; -create table t1 (c1 char(10) character set utf8 collate utf8_bin); -insert into t1 values ('A'),('a'); -insert into t1 values ('B'),('b'); -insert into t1 values ('C'),('c'); -insert into t1 values ('D'),('d'); -insert into t1 values ('E'),('e'); -insert into t1 values ('F'),('f'); -insert into t1 values ('G'),('g'); -insert into t1 values ('H'),('h'); -insert into t1 values ('I'),('i'); -insert into t1 values ('J'),('j'); -insert into t1 values ('K'),('k'); -insert into t1 values ('L'),('l'); -insert into t1 values ('M'),('m'); -insert into t1 values ('N'),('n'); -insert into t1 values ('O'),('o'); -insert into t1 values ('P'),('p'); -insert into t1 values ('Q'),('q'); -insert into t1 values ('R'),('r'); -insert into t1 values ('S'),('s'); -insert into t1 values ('T'),('t'); -insert into t1 values ('U'),('u'); -insert into t1 values ('V'),('v'); -insert into t1 values ('W'),('w'); -insert into t1 values ('X'),('x'); -insert into t1 values ('Y'),('y'); -insert into t1 values ('Z'),('z'); -insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); -insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); -insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); -insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); -insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); -insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); -insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); -insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); -insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); -insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); -insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); -insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); -insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); -insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); -insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); -insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); -insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); -insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); -insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); -insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); -insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); -insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); -insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); -insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); -insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); -insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); -insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); -insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); -insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); -insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); -insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); -insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); -insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); -insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); -insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); -insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); -insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); -insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); -insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); -insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); -insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); -insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); -insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); -insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); -insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); -insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); -insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); -insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); -insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); -insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); -insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); -insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); -insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); -insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); -insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); -insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); -insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); -insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); -insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); -insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); -insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); -insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); -insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); -insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); -insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); -insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); -insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); -insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); -insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); -insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); -insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); -insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); -insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); -insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); -insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); -insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); -insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); -insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); -insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); -insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); -insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); -insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); -insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); -insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); -insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); -insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); -insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); -insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); -insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); -insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); -insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); -insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); -insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); -insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); -insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); -insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); -insert into t1 values ('AA'),('Aa'),('aa'),('aA'); -insert into t1 values ('CH'),('Ch'),('ch'),('cH'); -insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); -insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); -insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); -insert into t1 values ('LL'),('Ll'),('ll'),('lL'); -insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); -insert into t1 values ('OE'),('Oe'),('oe'),('oE'); -insert into t1 values ('SS'),('Ss'),('ss'),('sS'); -insert into t1 values ('RR'),('Rr'),('rr'),('rR'); -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Â,Ã,à,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ã,á -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ã,ð -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -E,e,È,Ê,Ë,è,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -É,é -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -Ã,í -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ó,ó -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Û,Ü,ù,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Ú,ú -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,ÿ,Ŷ,Å·,Ÿ -Ã,ý -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Þ,þ -Ä,Æ,ä,æ -Ö,Ø,ö,ø -Ã…,Ã¥ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -CH,Ch,cH,ch -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ -Ä¢,Ä£ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -Y,y -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ǩ,Ç© -Ķ,Ä· -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Ä»,ļ -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Å…,ņ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Ř,Å™ -RR,Rr,rR,rr -Å–,Å— -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Ã,Ä,Ã…,à,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä‚,ă -Â,â -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,Ã,ì,í,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ÃŽ,î -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åž,ÅŸ -Æ© -ƪ -T,t,Ť,Å¥ -ƾ -Å¢,Å£ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -CH,Ch,cH,ch -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä„,Ä… -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ć,ć -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Äš,Ä› -Ę,Ä™ -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ń,Å„ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ó,ó -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åš,Å› -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ž,ž -Æ -Ź,ź -Å»,ż -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz -Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Z,z -Ž,ž -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -Õ,õ -Ä,ä -Ö,ö -Ü,ü -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Ź,ź,Å»,ż -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ñ,ñ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ü,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ã…,Ã¥ -Ä,Æ,ä,æ -Ö,Ø,ö,ø -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ç,ç -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Äž,ÄŸ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -I,ı -IJ,Ij -Æ•,Ƕ -Ħ,ħ -i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -iJ,ij,IJ,ij -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ö,ö -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åž,ÅŸ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Ü,ü -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -CH,Ch,ch -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å— -RR,Rr,rR,rr -Ř,Å™ -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -aA -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ü,Ã,ü,ý,ÿ,Ű,ű,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ä,Æ,ä,æ -Ö,Ø,ö,ø,Å,Å‘ -AA,Aa,aa,Ã…,Ã¥ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä,ä -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -CH,Ch,ch -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Õ,Ö,ò,ó,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ô,ô -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -cH -CH,Ch,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -lL -LL,Ll,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ñ,ñ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,RR,Rr,r,rr,Å”,Å•,Å–,Å—,Ř,Å™ -rR -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,J,i,j,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij -IJ,ij -ı -Æ— -Æ– -Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj -LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj -ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -U,V,u,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -drop table t1; -SET NAMES utf8; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_general_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_general_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); -INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); -SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); -SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 -COLLATE ucs2_unicode_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_unicode_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 ( -col1 CHAR(32) CHARACTER SET utf8 NOT NULL -); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); -SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; -HEX(CONVERT(col1 USING ucs2)) -0041004100410627 -0041004100410628 -0041004100410648 -0041004100410647 -0622063A06270632 -062206410631064A06420627064A064A -06220644064506270646064A -06220645062F0647 -06220646 -06220646060C -06220646062C0627 -0622064606860647 -062206480631062F -0627062D063306270646 -0627062F0628064A -0627062F064806270631062F -06270632 -06270633062A -06270634 -0627064206270645062A -062706A9062A06280631 -0627064506480631 -06270646062F -062706460642064406270628 -0627064606AF0644064A0633 -06270648 -06270648060C -0627064806510644 -0627064A -0627064A063106270646 -0627064A063106270646060C -0627064A0631062706460650 -0627064A063106270646064A -0627064A0646 -0628 -06280627 -0628062706310632 -06280627063206AF0634062A -0628062D062B -06280631062706480646200C06310627 -062806310627064A -0628063106310633064A -06280639062F0627064B -06280648062C0648062F -06280648062F -06280648062F060C -06280648062F0646062F -06280647 -0628064A0633062A -0628064A0646 -067E0631062F0627062E062A0647 -067E0631062F062706320645 -067E0633 -067E064A06480633062A -062A0627 -062A06270631064A062E -062A0623062B064A0631 -062A06280631064A0632 -062A062D062A -062A0631 -062A0634062E064A0635 -062A064106270648062A -062A064106A906510631 -062A0642064A -062A0642064A200C06320627062F0647 -062A0645062F06510646 -062A064606470627 -062A064806270646 -062C064606AF -062C064706270646 -068606340645 -0686064706310647 -062D06270644062A -062D062F0651 -062D062F0648062F -062D06330646 -062D064806320647 -062E0627064606480627062F06AF064A -062E064806270646062F0647 -062E06480631062F -062F0627062F -062F06270631062F -062F062706460634 -062F062706460634062C0648064A06270646064A -062F06270646063406AF06270647 -062F0631 -062F0633062A -062F06390648062A0650 -062F064406280633062A0647 -062F0646064A0633064F0646 -062F0648 -062F06480628062706310647 -062F064806310647 -062F06480644062A -062F064806510645 -062F064A06AF0631 -06310627 -063106270633 -06310641062A -063106470628063106270646 -06320627062F0647 -0698062706460648064A0647 -063306500631 -063306270644 -06330627064406AF064A060C -06330641064A0631 -0633064A06270633064A -0633064A0651062F -06340627064A062F -0634062E0635064A0651062A064A -0634062F -0634062F0647 -063406470631 -06350641062D0627062A -0637063106270632 -0639063106350647 -063906A90633 -063906440645 -063906440645064A -0639064406480645200C063406310642064A -06390645064400BB -063906480636060C -063A064406280647 -064106310647064606AF -0642063106270631 -06420648064A -06A90627063106470627064A -06A906270631064A -06A90627064506440627064B -06A90627064606480646 -06A9062A06270628 -06A90631062F0646062F -06A9064506280631064A062C -06A9064806340634 -06A90647 -06AF -06AF06310641062A0647 -06AF06310645064A -06440646062F0646 -064506270646062F -0645062C06440633 -0645062D064206510642 -0645062E062A06270631 -0645062F063106330647 -0645063306270639062F -064506340631064806370647 -06450635064506510645 -06450642062706440627062A -06450646 -06450646062A06340631 -06450646062A06420644 -064506480631062F -064506470645 -06450647064506270646 -0645064A -0645064A200C062F0647062F060C -0646062706450647 -064606280648062F060C -064606330628062A -0646063406270646 -064606380631 -064606450627064A0646062F0647 -064606480634062A0647 -064606470636062A -0646064A0632 -0648 -0648067E0646062C -06480632064A0631 -06480644064A -0648064A -0648064A06980647 -064706500646064A064606AF -0647063106860646062F -06470645 -0647064506270646 -0647064506330631 -06470645063306310634 -064706450647 -0647064606AF06270645064A -0647064A0626062A -064A062706310634062706370631 -064A06A9 -064A06A9062F064A06AF0631 -064A06A9064A -DROP TABLE t1; -SET @test_character_set= 'utf8'; -SET @test_collation= 'utf8_swedish_ci'; -SET @safe_character_set_server= @@character_set_server; -SET @safe_collation_server= @@collation_server; -SET character_set_server= @test_character_set; -SET collation_server= @test_collation; -CREATE DATABASE d1; -USE d1; -CREATE TABLE t1 (c CHAR(10), KEY(c)); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c char(10) utf8_swedish_ci YES MUL NULL -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; -want3results -aaa -aaaa -aaaaa -DROP TABLE t1; -CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) utf8_swedish_ci YES MUL NULL -INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); -SELECT c1 as want3results from t1 where c1 like 'l%'; -want3results -location -loberge -lotre -SELECT c1 as want3results from t1 where c1 like 'lo%'; -want3results -location -loberge -lotre -SELECT c1 as want1result from t1 where c1 like 'loc%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'loca%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locat%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locati%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locatio%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'location%'; -want1result -location -DROP TABLE t1; -DROP DATABASE d1; -USE test; -SET character_set_server= @safe_character_set_server; -SET collation_server= @safe_collation_server; -- cgit v1.2.1 From 0be6eab66564d600e2feb162a8f96835b8c154d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:05:40 +0200 Subject: dict0dict.c: In the FOREIGN KEY parser, do not cut 0xC2A0 from the end of an identifier if it was quoted innobase/dict/dict0dict.c: In the FOREIGN KEY parser, do not cut 0xC2A0 from the end of an identifier if it was quoted --- innobase/dict/dict0dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index ecc533ed26f..2e6504cac11 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2427,7 +2427,7 @@ dict_scan_id( *id = s; } - if (heap) { + if (heap && !quote) { /* EMS MySQL Manager sometimes adds characters 0xA0 (in latin1, a 'non-breakable space') to the end of a table name. But isspace(0xA0) is not true, which confuses our foreign key -- cgit v1.2.1 From c486461e4430ced16300cc86c007a8d1d980af93 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:12:47 +0200 Subject: dict0dict.h, dict0dict.c, ha_innodb.cc: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 sql/ha_innodb.cc: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 innobase/dict/dict0dict.c: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 innobase/include/dict0dict.h: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 --- innobase/dict/dict0dict.c | 41 ++++++++++++++++++++++++++++++++--------- innobase/include/dict0dict.h | 2 ++ sql/ha_innodb.cc | 5 +++++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index aa5bab210ef..b4be9108659 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -27,6 +27,8 @@ Created 1/8/1996 Heikki Tuuri #include "que0que.h" #include "rem0cmp.h" +ibool dict_char_0xA0_is_space = FALSE; /* A special fix for 4.0 */ + dict_sys_t* dict_sys = NULL; /* the dictionary system */ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve @@ -172,7 +174,28 @@ and unique key errors */ FILE* dict_foreign_err_file = NULL; mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign and unique error buffers */ - +/************************************************************************ +Checks if a byte is considered space in the current charset of MySQL. +TODO: find out if this works correctly in multibyte charsets. */ +static +ibool +dict_isspace( +/*=========*/ + /* out: TRUE if considered space */ + char c) /* in: one-byte character */ +{ + if (isspace(c)) { + + return(TRUE); + } + + if (dict_char_0xA0_is_space && (byte)c == (byte)0xA0) { + + return(TRUE); + } + + return(FALSE); +} /************************************************************************ Checks if the database name in two table names is the same. */ @@ -2198,7 +2221,7 @@ dict_accept( *success = FALSE; - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2241,7 +2264,7 @@ dict_scan_id( *id = NULL; - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2272,7 +2295,7 @@ dict_scan_id( len++; } } else { - while (!isspace(*ptr) && *ptr != '(' && *ptr != ')' + while (!dict_isspace(*ptr) && *ptr != '(' && *ptr != ')' && (accept_also_dot || *ptr != '.') && *ptr != ',' && *ptr != '\0') { @@ -2765,11 +2788,11 @@ loop: ut_a(success); - if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { + if (!dict_isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2795,7 +2818,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!isspace(*ptr)) { + if (!dict_isspace(*ptr)) { goto loop; } @@ -2883,7 +2906,7 @@ col_loop1: } ptr = dict_accept(ptr, "REFERENCES", &success); - if (!success || !isspace(*ptr)) { + if (!success || !dict_isspace(*ptr)) { dict_foreign_report_syntax_err(name, start_of_latest_foreign, ptr); return(DB_CANNOT_ADD_CONSTRAINT); @@ -3261,7 +3284,7 @@ loop: ptr = dict_accept(ptr, "DROP", &success); - if (!isspace(*ptr)) { + if (!dict_isspace(*ptr)) { goto loop; } diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 9940be9832d..8b31e6f84a5 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -26,6 +26,8 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" +extern ibool dict_char_0xA0_is_space; + /************************************************************************ Get the database name length in a table name. */ diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 91f92c8cadb..c36075207ed 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -64,6 +64,7 @@ extern "C" { #include "../innobase/include/log0log.h" #include "../innobase/include/lock0lock.h" #include "../innobase/include/dict0crea.h" +#include "../innobase/include/dict0dict.h" #include "../innobase/include/btr0cur.h" #include "../innobase/include/btr0btr.h" #include "../innobase/include/fsp0fsp.h" @@ -917,6 +918,10 @@ innobase_init(void) srv_print_verbose_log = mysql_embedded ? 0 : 1; + if (my_isspace(default_charset_info, (char)0xA0)) { + dict_char_0xA0_is_space = TRUE; + } + if (strcmp(default_charset_info->name, "latin1") == 0) { /* Store the character ordering table to InnoDB. -- cgit v1.2.1 From 070777797c50e2b99ed5a3a55d4c14fd8f9ec9dc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 18:03:43 +0200 Subject: dict0dict.c, log.cc: Remove accidentally merged 4.0 changes dict0dict.c: Remove the 4.0 fix accidentally auto-merged to 4.1 row0mysql.h, dict0dict.h: Remove a change auto-merged from 4.0 innobase/include/dict0dict.h: Remove a change auto-merged from 4.0 innobase/include/row0mysql.h: Remove a change auto-merged from 4.0 sql/log.cc: Remove accidentally merged 4.0 changes innobase/dict/dict0dict.c: Remove accidentally merged 4.0 changes --- innobase/dict/dict0dict.c | 41 +++++++++-------------------------------- innobase/include/dict0dict.h | 2 -- innobase/include/row0mysql.h | 10 ++++++++++ sql/log.cc | 18 ++++++++---------- 4 files changed, 27 insertions(+), 44 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index e3aac1f70ad..2e6504cac11 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -27,8 +27,6 @@ Created 1/8/1996 Heikki Tuuri #include "que0que.h" #include "rem0cmp.h" -ibool dict_char_0xA0_is_space = FALSE; /* A special fix for 4.0 */ - dict_sys_t* dict_sys = NULL; /* the dictionary system */ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve @@ -198,28 +196,7 @@ and unique key errors */ FILE* dict_foreign_err_file = NULL; mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign and unique error buffers */ -/************************************************************************ -Checks if a byte is considered space in the current charset of MySQL. -TODO: find out if this works correctly in multibyte charsets. */ -static -ibool -dict_isspace( -/*=========*/ - /* out: TRUE if considered space */ - char c) /* in: one-byte character */ -{ - if (isspace(c)) { - - return(TRUE); - } - - if (dict_char_0xA0_is_space && (byte)c == (byte)0xA0) { - - return(TRUE); - } - - return(FALSE); -} + /************************************************************************ Checks if the database name in two table names is the same. */ @@ -2347,7 +2324,7 @@ dict_accept( *success = FALSE; - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2392,7 +2369,7 @@ dict_scan_id( *id = NULL; - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2423,7 +2400,7 @@ dict_scan_id( len++; } } else { - while (!dict_isspace(*ptr) && *ptr != '(' && *ptr != ')' + while (!isspace(*ptr) && *ptr != '(' && *ptr != ')' && (accept_also_dot || *ptr != '.') && *ptr != ',' && *ptr != '\0') { @@ -2927,11 +2904,11 @@ loop: ut_a(success); - if (!dict_isspace(*ptr) && *ptr != '"' && *ptr != '`') { + if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2957,7 +2934,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!dict_isspace(*ptr)) { + if (!isspace(*ptr)) { goto loop; } @@ -3045,7 +3022,7 @@ col_loop1: } ptr = dict_accept(ptr, "REFERENCES", &success); - if (!success || !dict_isspace(*ptr)) { + if (!success || !isspace(*ptr)) { dict_foreign_report_syntax_err(name, start_of_latest_foreign, ptr); return(DB_CANNOT_ADD_CONSTRAINT); @@ -3426,7 +3403,7 @@ loop: ptr = dict_accept(ptr, "DROP", &success); - if (!dict_isspace(*ptr)) { + if (!isspace(*ptr)) { goto loop; } diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index b29905c8b96..ca632691450 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -26,8 +26,6 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" -extern ibool dict_char_0xA0_is_space; - /************************************************************************ Get the database name length in a table name. */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index f47ce74ce37..78f4c754c7f 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -291,6 +291,16 @@ row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx); /* in: transaction */ /************************************************************************* +Checks if a table name contains the string "/#sql" which denotes temporary +tables in MySQL. */ + +ibool +row_is_mysql_tmp_table_name( +/*========================*/ + /* out: TRUE if temporary table */ + const char* name); /* in: table name in the form + 'database/tablename' */ +/************************************************************************* Does a table creation operation for MySQL. If the name of the created table ends to characters INNODB_MONITOR, then this also starts printing of monitor output by the master thread. */ diff --git a/sql/log.cc b/sql/log.cc index e4556d71fb3..3a420866025 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2036,7 +2036,6 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); - VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -2044,7 +2043,7 @@ bool flush_error_log() the current error file. */ strmov(strmov(err_temp, err_renamed),"-tmp"); - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { freopen(err_temp,"a+",stderr); @@ -2057,21 +2056,20 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); + my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); my_close(fd, MYF(0)); } - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); } else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); - if (freopen(log_error_file,"a+",stdout)) - freopen(log_error_file,"a+",stderr); - else - result= 1; + my_rename(log_error_file,err_renamed,MYF(0)); + if (freopen(log_error_file,"a+",stdout)) + freopen(log_error_file,"a+",stderr); + else + result= 1; #endif - VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } -- cgit v1.2.1 From 111fa31f616a87435a844b9a0d5ad16ec4da8382 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 20:07:00 +0400 Subject: A fix (bug #7129: Test failure: 'type_ranges' when using '--ps-protocol' bug #7126: Test failure: 'func_str' when using '--ps-protocol' bug #7130: Test failure: 'type_uint' when using '--ps-protocol'). --- libmysql/libmysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 99fa0299de9..8989dc18fd7 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3663,8 +3663,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */ case MYSQL_TYPE_LONG: { - long value= sint4korr(*row); - longlong data= field_is_unsigned ? (longlong) (unsigned long) value : + int32 value= sint4korr(*row); + longlong data= field_is_unsigned ? (longlong) (uint32) value : (longlong) value; fetch_long_with_conversion(param, field, data); *row+= 4; -- cgit v1.2.1 From dec3467588e9525f598bc608a6757c7647d78905 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 18:09:07 +0200 Subject: row0mysql.h: Remove accidentally pushed unnecessary change innobase/include/row0mysql.h: Remove accidentally pushed unnecessary change --- innobase/include/row0mysql.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 78f4c754c7f..f47ce74ce37 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -291,16 +291,6 @@ row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx); /* in: transaction */ /************************************************************************* -Checks if a table name contains the string "/#sql" which denotes temporary -tables in MySQL. */ - -ibool -row_is_mysql_tmp_table_name( -/*========================*/ - /* out: TRUE if temporary table */ - const char* name); /* in: table name in the form - 'database/tablename' */ -/************************************************************************* Does a table creation operation for MySQL. If the name of the created table ends to characters INNODB_MONITOR, then this also starts printing of monitor output by the master thread. */ -- cgit v1.2.1 From 90ce7aea5feb3ff64ae898350cd62dc3c3ed3345 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 23:50:09 +0100 Subject: Fix results file for insert_select test with embedded server. (Bug #7167) mysql-test/r/insert_select.result.es: add output to embedded server results --- mysql-test/r/insert_select.result.es | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es index 3955c0534f2..9e11402733d 100644 --- a/mysql-test/r/insert_select.result.es +++ b/mysql-test/r/insert_select.result.es @@ -78,6 +78,13 @@ a 1 2 drop table t1, t2; +create table t1(a int); +insert into t1 values(1),(1); +reset master; +create table t2(unique(a)) select a from t1; +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events; +drop table t1; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); -- cgit v1.2.1 From 35aaf2222d2ecc374beccb1e1b564d8ad3906d47 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 09:39:29 +0100 Subject: getting rid of now() is tests --- mysql-test/r/func_str.result | 2 +- mysql-test/t/func_str.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0e98f304d89..41203566aab 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -686,7 +686,7 @@ select left(1234, 3) + 0; left(1234, 3) + 0 123 create table t1 (a int not null primary key, b varchar(40), c datetime); -insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; total reg 10 2004-12-10 diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2934a9733a7..4404429cf7e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -426,6 +426,6 @@ select left(1234, 3) + 0; # Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation # create table t1 (a int not null primary key, b varchar(40), c datetime); -insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; drop table t1; -- cgit v1.2.1 From da6a5f6ec095b88fb9d0bf63a4d9e4675f1450a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 10:17:25 +0100 Subject: sql/password.c: check for buffer overflow in check_scramble_323 (BUG#7187) sql/password.c: check for buffer overflow in check_scramble_323 --- sql/password.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/password.c b/sql/password.c index b9f3a07e596..04b3a46bd48 100644 --- a/sql/password.c +++ b/sql/password.c @@ -211,12 +211,13 @@ check_scramble_323(const char *scrambled, const char *message, ulong hash_message[2]; char buff[16],*to,extra; /* Big enough for check */ const char *pos; - + hash_password(hash_message, message, SCRAMBLE_LENGTH_323); randominit(&rand_st,hash_pass[0] ^ hash_message[0], hash_pass[1] ^ hash_message[1]); to=buff; - for (pos=scrambled ; *pos ; pos++) + DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323); + for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++) *to++=(char) (floor(my_rnd(&rand_st)*31)+64); if (pos-scrambled != SCRAMBLE_LENGTH_323) return 1; -- cgit v1.2.1 From 8e4251dd855e81215281b958e97a3dc6b9153a4b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 15:51:52 +0300 Subject: Fix for BUG#5837 - attempt 3. Call mark_as_null_row in join_read_const and join_read_system. mysql-test/r/multi_update.result: Testcase for BUG#5837 mysql-test/t/multi_update.test: Testcase for BUG#5837 sql/table.h: Added comments --- mysql-test/r/multi_update.result | 6 ++++++ mysql-test/t/multi_update.test | 9 +++++++++ sql/sql_select.cc | 10 ++++++++-- sql/table.h | 10 ++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index fc414f2f46b..5e7b392b503 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -399,3 +399,9 @@ select * from t2; c2_id c2_p_id c2_note c2_active 1 1 A Note 1 drop table t1, t2; +drop table if exists t2, t1; +create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; +create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +insert into t2 values(1,null); +delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +drop table t1, t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 3494126f890..2d6770f77ed 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -337,3 +337,12 @@ update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; drop table t1, t2; + +# Test for BUG#5837 - delete with outer join and const tables +drop table if exists t2, t1; +create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; +create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +insert into t2 values(1,null); +delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +drop table t1, t2; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e46b7fb8b97..2df0d45f8ed 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4951,7 +4951,10 @@ join_read_system(JOIN_TAB *tab) table->file->print_error(error,MYF(0)); return 1; } - table->null_row=1; // This is ok. + if (tab->on_expr) + mark_as_null_row(tab->table); + else + table->null_row=1; // Why do this for inner join? empty_record(table); // Make empty record return -1; } @@ -4981,7 +4984,10 @@ join_read_const(JOIN_TAB *tab) } if (error) { - table->null_row=1; + if (tab->on_expr) + mark_as_null_row(tab->table); + else + table->null_row=1; empty_record(table); if (error != HA_ERR_KEY_NOT_FOUND) { diff --git a/sql/table.h b/sql/table.h index 84df7ba127e..0a1d1893531 100644 --- a/sql/table.h +++ b/sql/table.h @@ -89,8 +89,14 @@ struct st_table { int current_lock; /* Type of lock on table */ enum tmp_table_type tmp_table; my_bool copy_blobs; /* copy_blobs when storing */ - my_bool null_row; /* All columns are null */ - my_bool maybe_null,outer_join; /* Used with OUTER JOIN */ + /* + Used in outer joins: if true, all columns are considered to have NULL + values, including columns declared as "not null". + */ + my_bool null_row; + /* 0 or JOIN_TYPE_{LEFT|RIGHT}, same as TABLE_LIST::outer_join */ + my_bool outer_join; + my_bool maybe_null; /* true if (outer_join != 0) */ my_bool force_index; my_bool distinct,const_table,no_rows; my_bool key_read, bulk_insert; -- cgit v1.2.1 From 0a3590f6d08342512deecfe15e91424eb01c0be4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 16:36:12 +0300 Subject: Post-merge fixes --- mysql-test/r/multi_update.result | 13 +++++++++---- mysql-test/t/multi_update.test | 14 ++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 75a7c3e5a0c..dba10296063 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -464,9 +464,14 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; ERROR HY000: You can't specify target table 't1' for update in FROM clause drop table t1,t2; -drop table if exists t2, t1; -create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; -create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +create table t1 ( +aclid bigint not null primary key, +status tinyint(1) not null +) engine = innodb; +create table t2 ( +refid bigint not null primary key, +aclid bigint, index idx_acl(aclid) +) engine = innodb; insert into t2 values(1,null); -delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 005ce74db83..e90de399500 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -433,10 +433,16 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 drop table t1,t2; # Test for BUG#5837 - delete with outer join and const tables -drop table if exists t2, t1; -create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; -create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +create table t1 ( + aclid bigint not null primary key, + status tinyint(1) not null +) engine = innodb; + +create table t2 ( + refid bigint not null primary key, + aclid bigint, index idx_acl(aclid) +) engine = innodb; insert into t2 values(1,null); -delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; -- cgit v1.2.1 From 3ce0df59372a3598ae39423e35bab877459693ad Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 17:13:19 +0200 Subject: new reference which refer to current value not to result used for resolving outer refernces if subqueri is not in HAVING clause (BUG#7079) and the same used for subquery transformetion mysql-test/r/subselect.result: reference on changable fields from subquery mysql-test/t/subselect.test: reference on changable fields from subquery sql/item.cc: new reference which refer to current value not to result used sql/item.h: new reference which refer to current value not to result used sql/item_subselect.cc: new reference which refer to current value not to result used --- mysql-test/r/subselect.result | 28 ++++++++++++++++++++++++++++ mysql-test/t/subselect.test | 28 ++++++++++++++++++++++++++++ sql/item.cc | 34 ++++++++++++++++++++++++++-------- sql/item.h | 39 +++++++++++++++++++++++++++++++++++++++ sql/item_subselect.cc | 13 +++++++------ 5 files changed, 128 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 956ddb655ee..9c52b25a577 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2105,3 +2105,31 @@ s1 s1 < all (select s1 from t1) 1 0 NULL NULL drop table t1; +CREATE TABLE t1 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '' +) TYPE=MyISAM; +Warnings: +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +c +Oceania +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e09aa489983..b5b5de069bf 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1358,3 +1358,31 @@ insert into t1 values (1),(null); select * from t1 where s1 < all (select s1 from t1); select s1, s1 < all (select s1 from t1) from t1; drop table t1; + +# +# reference on changable fields from subquery +# +CREATE TABLE t1 ( + Code char(3) NOT NULL default '', + Name char(52) NOT NULL default '', + Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', + Region char(26) NOT NULL default '', + SurfaceArea float(10,2) NOT NULL default '0.00', + IndepYear smallint(6) default NULL, + Population int(11) NOT NULL default '0', + LifeExpectancy float(3,1) default NULL, + GNP float(10,2) default NULL, + GNPOld float(10,2) default NULL, + LocalName char(45) NOT NULL default '', + GovernmentForm char(45) NOT NULL default '', + HeadOfState char(60) default NULL, + Capital int(11) default NULL, + Code2 char(2) NOT NULL default '' +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index 31c35e87cd4..3fca0033be2 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -69,7 +69,7 @@ Item::Item(): } /* - Constructor used by Item_field, Item_ref & agregate (sum) functions. + Constructor used by Item_field, Item_*_ref & agregate (sum) functions. Used for duplicating lists in processing queries with temporary tables */ @@ -114,7 +114,7 @@ Item_ident::Item_ident(const char *db_name_par,const char *table_name_par, name = (char*) field_name_par; } -// Constructor used by Item_field & Item_ref (see Item comment) +// Constructor used by Item_field & Item_*_ref (see Item comment) Item_ident::Item_ident(THD *thd, Item_ident *item) :Item(thd, item), orig_db_name(item->orig_db_name), @@ -1372,6 +1372,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { + enum_parsing_place place; DBUG_ASSERT(fixed == 0); if (!field) // If field is not checked { @@ -1419,8 +1420,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } Item_subselect *prev_subselect_item= prev_unit->item; - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or outer SELECT do not use groupping (i.e. tables are @@ -1489,8 +1489,13 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return -1; } - Item_ref *rf= new Item_ref(last->ref_pointer_array + counter, - (char *)table_name, (char *)field_name); + Item_ref *rf= (place == IN_HAVING ? + new Item_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name) : + new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name)); if (!rf) return 1; thd->change_item_tree(ref, rf); @@ -2039,6 +2044,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { DBUG_ASSERT(fixed == 0); uint counter; + enum_parsing_place place; bool not_used; if (!ref) { @@ -2097,8 +2103,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) // it is primary INSERT st_select_lex => skip first table resolving table_list= table_list->next; } - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or SELECT list or outer SELECT do not use groupping (i.e. tables @@ -2168,6 +2173,19 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) } mark_as_dependent(thd, last, thd->lex->current_select, this); + if (place == IN_HAVING) + { + Item_ref *rf; + if (!(rf= new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name))) + return 1; + ref= 0; // Safety + if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1)) + return 1; + thd->change_item_tree(reference, rf); + return 0; + } ref= last->ref_pointer_array + counter; } else if (!ref) diff --git a/sql/item.h b/sql/item.h index 3c4f80e3857..3ae1da23f15 100644 --- a/sql/item.h +++ b/sql/item.h @@ -889,6 +889,45 @@ public: void print(String *str); }; + +class Item_direct_ref :public Item_ref +{ +public: + Item_direct_ref(Item **item, const char *table_name_par, + const char *field_name_par) + :Item_ref(item, table_name_par, field_name_par) {} + /* Constructor need to process subselect with temporary tables (see Item) */ + Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + double val() + { + double tmp=(*ref)->val(); + null_value=(*ref)->null_value; + return tmp; + } + longlong val_int() + { + longlong tmp=(*ref)->val_int(); + null_value=(*ref)->null_value; + return tmp; + } + String *val_str(String* tmp) + { + tmp=(*ref)->val_str(tmp); + null_value=(*ref)->null_value; + return tmp; + } + bool is_null() + { + (void) (*ref)->val_int(); + return (*ref)->null_value; + } + bool get_date(TIME *ltime,uint fuzzydate) + { + return (null_value=(*ref)->get_date(ltime,fuzzydate)); + } +}; + + class Item_in_subselect; class Item_ref_null_helper: public Item_ref { diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 69941b36ca0..ffa3b072801 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -797,9 +797,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, As far as Item_ref_in_optimizer do not substitude itself on fix_fields we can use same item for all selects. */ - expr= new Item_ref((Item**)optimizer->get_cache(), - (char *)"", - (char *)in_left_expr_name); + expr= new Item_direct_ref((Item**)optimizer->get_cache(), + (char *)"", + (char *)in_left_expr_name); unit->uncacheable|= UNCACHEABLE_DEPENDENT; } @@ -993,9 +993,10 @@ Item_in_subselect::row_value_transformer(JOIN *join) (char *) "", (char *) ""); func= - eq_creator.create(new Item_ref((*optimizer->get_cache())->addr(i), - (char *)"", - (char *)in_left_expr_name), + eq_creator.create(new Item_direct_ref((*optimizer->get_cache())-> + addr(i), + (char *)"", + (char *)in_left_expr_name), func); item= and_items(item, func); } -- cgit v1.2.1 From b5c119e7c0f3b0ff6885c0dc247f53902ef7f621 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 19:59:09 +0300 Subject: Fix for BUG#6976: In Item_ref::Item_ref set maybe_null (and other fields fix_fields sets) to be the same as in (*ref), because Item_ref::fix_fields() will not be called. Previously maybe_null was 0 always and this produced a bogus state where maybe_null==0 && is_null() == true which broke evaluation for some upper-level Items, like AND and OR. mysql-test/r/group_by.result: Test for BUG#6976 mysql-test/t/group_by.test: Test for BUG#6976 sql/item.cc: Comment added sql/item.h: Fix for BUG#6976: in Item_ref::Item_ref(Item**...) fix all fields because fix_fields() will not be called. --- mysql-test/r/group_by.result | 12 ++++++++++++ mysql-test/t/group_by.test | 9 +++++++++ sql/item.cc | 1 + sql/item.h | 14 +++++++++++++- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index dba95614052..f636692c0d9 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -626,3 +626,15 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +min(a) is null +1 +select min(a) is null or null from t1; +min(a) is null or null +1 +select 1 and min(a) is null from t1; +1 and min(a) is null +1 +drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 58bb4b3e268..5af78b924f8 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -447,3 +447,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5); SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; + +#Test for BUG#6976: Aggregate functions have incorrect NULL-ness +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +select min(a) is null or null from t1; +select 1 and min(a) is null from t1; +drop table t1; + diff --git a/sql/item.cc b/sql/item.cc index 739b5385b55..8737cc06bbd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -687,6 +687,7 @@ bool Item_null::send(THD *thd, String *packet) /* This is used for HAVING clause Find field in select list having the same name + This is not always called, see also Item_ref::Item_ref */ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables) diff --git a/sql/item.h b/sql/item.h index f6f9e1c0621..cc6a846d6c1 100644 --- a/sql/item.h +++ b/sql/item.h @@ -401,7 +401,19 @@ public: Item_ref(char *db_par,char *table_name_par,char *field_name_par) :Item_ident(db_par,table_name_par,field_name_par),ref(0) {} Item_ref(Item **item, char *table_name_par,char *field_name_par) - :Item_ident(NullS,table_name_par,field_name_par),ref(item) {} + :Item_ident(NullS,table_name_par,field_name_par),ref(item) + { + /* + This ctor is called from Item_XXX::split_sum_func, and fix_fields will + not be called for *this, so we must setup everything here. **ref is + already fixed at this point. + */ + max_length= (*ref)->max_length; + decimals= (*ref)->decimals; + binary= (*ref)->binary; + with_sum_func= (*ref)->with_sum_func; + maybe_null= (*ref)->maybe_null; + } enum Type type() const { return REF_ITEM; } bool eq(const Item *item, bool binary_cmp) const { return (*ref)->eq(item, binary_cmp); } -- cgit v1.2.1 From a9457c573df0ce1b7505ee735140322badd628c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 01:21:14 +0200 Subject: fixed optimized SOME subquery mysql-test/r/subselect.result: correct results of SOME subquery sql/item_cmpfunc.cc: some comments added fixed optimized SOME subquery --- mysql-test/r/subselect.result | 6 ------ sql/item_cmpfunc.cc | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 9c52b25a577..fc23331ad7b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1490,9 +1490,6 @@ Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) select * from t3 where a >= some (select b from t2); a -6 -7 -3 explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where @@ -1512,9 +1509,6 @@ Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select test.t2.b AS `b` from test.t2 group by test.t2.b))) select * from t3 where a >= some (select b from t2 group by 1); a -6 -7 -3 explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 51212418b09..88083878053 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -120,7 +120,7 @@ longlong Item_func_not_all::val_int() /* return TRUE if there was records in underlaying select in max/min - optimisation + optimisation (ALL subquery) */ if (empty_underlying_subquery()) return 1; @@ -157,11 +157,11 @@ longlong Item_func_nop_all::val_int() double value= args[0]->val(); /* - return TRUE if there was records in underlaying select in max/min - optimisation + return FALSE if there was records in underlaying select in max/min + optimisation (SAME/ANY subquery) */ if (empty_underlying_subquery()) - return 1; + return 0; null_value= args[0]->null_value; return (null_value || value == 0) ? 0 : 1; -- cgit v1.2.1 From 8f318cf1825176faba9cf8dcae9df78bc54d1e15 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 00:48:06 +0100 Subject: fix bug#7193 added start backup parameter to enable setting wait state and set different timeouts depending on waitstate moved listen of backup event out of backup and into separete thread thread created at connect() and destroyed at disconnect() added start backup command options "nowait" "wait completed" "wait started" fixed log level settings ndb/include/mgmapi/mgmapi.h: added start backup parameter to enable setting wait state ndb/src/common/debugger/EventLogger.cpp: changed to unsigned printout ndb/src/mgmapi/mgmapi.cpp: added start backup parameter to enable setting wait state, and set different timeouts depending on waitstate ndb/src/mgmclient/CommandInterpreter.cpp: moved listen of backup event out of backup and into separete thread thread created at connect() and destroyed at disconnect() added start backup command options "nowait" "wait completed" "wait started" ndb/src/mgmsrv/MgmtSrvr.cpp: added more options to start backup to set wait state + set timeout depending on wait state + some debug printouts ndb/src/mgmsrv/MgmtSrvr.hpp: added more options to start backup to set wait state ndb/src/mgmsrv/Services.cpp: removed old backup code added use of stard backup otions fixed log level settings ndb/test/src/NdbBackup.cpp: adopted to new wait state option in start backup --- ndb/include/mgmapi/mgmapi.h | 6 +- ndb/src/common/debugger/EventLogger.cpp | 8 +- ndb/src/mgmapi/mgmapi.cpp | 14 ++- ndb/src/mgmclient/CommandInterpreter.cpp | 199 +++++++++++++++++++++++++------ ndb/src/mgmsrv/MgmtSrvr.cpp | 28 ++++- ndb/src/mgmsrv/MgmtSrvr.hpp | 6 +- ndb/src/mgmsrv/Services.cpp | 138 ++++++++------------- ndb/test/src/NdbBackup.cpp | 3 +- 8 files changed, 263 insertions(+), 139 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 5329ded4f19..fd4baea3e1f 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -666,11 +666,15 @@ extern "C" { * Start backup * * @param handle NDB management handle. + * @param wait_completed 0=don't wait for confirmation + 1=wait for backup started + 2=wait for backup completed * @param backup_id Backup id is returned from function. * @param reply Reply message. * @return -1 on error. */ - int ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* backup_id, + int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* backup_id, struct ndb_mgm_reply* reply); /** diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8bb797b7855..877f5dee243 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1280,10 +1280,10 @@ EventLogger::getText(char * m_text, size_t m_text_len, case EventReport::BackupCompleted: BaseString::snprintf(m_text, m_text_len, - "%sBackup %d started from node %d completed\n" - " StartGCP: %d StopGCP: %d\n" - " #Records: %d #LogRecords: %d\n" - " Data: %d bytes Log: %d bytes", + "%sBackup %u started from node %u completed\n" + " StartGCP: %u StopGCP: %u\n" + " #Records: %u #LogRecords: %u\n" + " Data: %u bytes Log: %u bytes", theNodeId, theData[2], refToNode(theData[1]), theData[3], theData[4], theData[6], theData[8], theData[5], theData[7]); diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 1a4a10f9421..adf0d26d632 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1545,7 +1545,8 @@ ndb_mgm_start(NdbMgmHandle handle, int no_of_nodes, const int * node_list) *****************************************************************************/ extern "C" int -ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, +ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* _backup_id, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_start_backup"); @@ -1559,8 +1560,17 @@ ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, CHECK_CONNECTED(handle, -1); Properties args; + args.put("completed", wait_completed); const Properties *reply; - reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + { // start backup can take some time, set timeout high + Uint64 old_timeout= handle->read_timeout; + if (wait_completed == 2) + handle->read_timeout= 30*60*1000; // 30 minutes + else if (wait_completed == 1) + handle->read_timeout= 5*60*1000; // 5 minutes + reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + handle->read_timeout= old_timeout; + } CHECK_REPLY(reply, -1); BaseString result; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e4c66d04624..4855b716d99 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -154,7 +154,8 @@ private: const char * param); NdbMgmHandle m_mgmsrv; - bool connected; + NdbMgmHandle m_mgmsrv2; + bool m_connected; int m_verbose; int try_reconnect; int m_error; @@ -163,6 +164,7 @@ private: const char *rep_host; bool rep_connected; #endif + struct NdbThread* m_event_thread; }; @@ -261,7 +263,8 @@ static const char* helpText = "SHOW CONFIG Print configuration\n" "SHOW PARAMETERS Print configuration parameters\n" #endif -"START BACKUP Start backup\n" +"START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" +" Start backup (default WAIT COMPLETED)\n" "ABORT BACKUP Abort backup\n" "SHUTDOWN Shutdown all processes in cluster and quit\n" "CLUSTERLOG ON [] ... Enable Cluster logging\n" @@ -386,13 +389,19 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) ndbout_c("Cannot create handle to management server."); exit(-1); } + m_mgmsrv2 = ndb_mgm_create_handle(); + if(m_mgmsrv2 == NULL) { + ndbout_c("Cannot create handle to management server."); + exit(-1); + } if (ndb_mgm_set_connectstring(m_mgmsrv, _host)) { printError(); exit(-1); } - connected = false; + m_connected= false; + m_event_thread= 0; try_reconnect = 0; #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; @@ -406,8 +415,9 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) */ CommandInterpreter::~CommandInterpreter() { - connected = false; + disconnect(); ndb_mgm_destroy_handle(&m_mgmsrv); + ndb_mgm_destroy_handle(&m_mgmsrv2); } static bool @@ -430,7 +440,10 @@ void CommandInterpreter::printError() { if (ndb_mgm_check_connection(m_mgmsrv)) - connected= false; + { + m_connected= false; + disconnect(); + } ndbout_c("* %5d: %s", ndb_mgm_get_latest_error(m_mgmsrv), ndb_mgm_get_latest_error_msg(m_mgmsrv)); @@ -440,32 +453,90 @@ CommandInterpreter::printError() //***************************************************************************** //***************************************************************************** -bool +static int do_event_thread; +static void* +event_thread_run(void* m) +{ + NdbMgmHandle handle= *(NdbMgmHandle*)m; + + my_thread_init(); + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; + int fd = ndb_mgm_listen_event(handle, filter); + if (fd > 0) + { + char *tmp= 0; + char buf[1024]; + SocketInputStream in(fd,10); + do { + if (tmp == 0) NdbSleep_MilliSleep(10); + if((tmp = in.gets(buf, 1024))) + ndbout << tmp; + } while(do_event_thread); + } + + my_thread_end(); + NdbThread_Exit(0); + return 0; +} + +bool CommandInterpreter::connect() { - if(!connected) { + if(!m_connected) + { if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) { - connected = true; - if (m_verbose) + const char *host= ndb_mgm_get_connected_host(m_mgmsrv); + unsigned port= ndb_mgm_get_connected_port(m_mgmsrv); + if(!ndb_mgm_set_connectstring(m_mgmsrv2, + BaseString(host).appfmt(":%d",port).c_str()) + && + !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { - printf("Connected to Management Server at: %s:%d\n", - ndb_mgm_get_connected_host(m_mgmsrv), - ndb_mgm_get_connected_port(m_mgmsrv)); + m_connected= true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + host, port); + } + { + do_event_thread= 1; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&m_mgmsrv2, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); + } + } + else + { + ndb_mgm_disconnect(m_mgmsrv); } } } - return connected; + return m_connected; } bool CommandInterpreter::disconnect() { - if (connected && (ndb_mgm_disconnect(m_mgmsrv) == -1)) { - ndbout_c("Could not disconnect from management server"); - printError(); + if (m_event_thread) { + void *res; + do_event_thread= 0; + NdbThread_WaitFor(m_event_thread, &res); + NdbThread_Destroy(&m_event_thread); + m_event_thread= 0; + ndb_mgm_disconnect(m_mgmsrv2); + } + if (m_connected) + { + if (ndb_mgm_disconnect(m_mgmsrv) == -1) { + ndbout_c("Could not disconnect from management server"); + printError(); + } + m_connected= false; } - connected = false; return true; } @@ -914,7 +985,8 @@ CommandInterpreter::executeShutdown(char* parameters) return result; } - connected = false; + m_connected= false; + disconnect(); ndbout << "NDB Cluster management server shutdown." << endl; return 0; } @@ -1882,21 +1954,68 @@ CommandInterpreter::executeEventReporting(int processId, * Backup *****************************************************************************/ int -CommandInterpreter::executeStartBackup(char* /*parameters*/) +CommandInterpreter::executeStartBackup(char* parameters) { struct ndb_mgm_reply reply; unsigned int backupId; - +#if 0 int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; int fd = ndb_mgm_listen_event(m_mgmsrv, filter); - int result = ndb_mgm_start_backup(m_mgmsrv, &backupId, &reply); + if (fd < 0) + { + ndbout << "Initializing start of backup failed" << endl; + printError(); + return fd; + } +#endif + Vector args; + { + BaseString(parameters).split(args); + for (unsigned i= 0; i < args.size(); i++) + if (args[i].length() == 0) + args.erase(i--); + else + args[i].ndb_toupper(); + } + int sz= args.size(); + + int result; + if (sz == 2 && + args[1] == "NOWAIT") + { + result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply); + } + else if (sz == 1 || + (sz == 3 && + args[1] == "WAIT" && + args[2] == "COMPLETED")) + { + ndbout_c("Waiting for completed, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply); + } + else if (sz == 3 && + args[1] == "WAIT" && + args[2] == "STARTED") + { + ndbout_c("Waiting for started, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply); + } + else + { + invalid_command(parameters); + return -1; + } + if (result != 0) { ndbout << "Start of backup failed" << endl; printError(); +#if 0 close(fd); +#endif return result; } - +#if 0 + ndbout_c("Waiting for completed, this may take several minutes"); char *tmp; char buf[1024]; { @@ -1923,29 +2042,39 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) ndbout << tmp; } } while(tmp && tmp[0] != 0); - + close(fd); +#endif return 0; } void CommandInterpreter::executeAbortBackup(char* parameters) { - strtok(parameters, " "); - struct ndb_mgm_reply reply; - char* id = strtok(NULL, "\0"); int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; + struct ndb_mgm_reply reply; + if (emptyString(parameters)) + goto executeAbortBackupError1; + + { + strtok(parameters, " "); + char* id = strtok(NULL, "\0"); + if(id == 0 || sscanf(id, "%d", &bid) != 1) + goto executeAbortBackupError1; } - int result = ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); - if (result != 0) { - ndbout << "Abort of backup " << bid << " failed" << endl; - printError(); - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; + { + int result= ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); + if (result != 0) { + ndbout << "Abort of backup " << bid << " failed" << endl; + printError(); + } else { + ndbout << "Abort of backup " << bid << " ordered" << endl; + } } + return; + executeAbortBackupError1: + ndbout << "Invalid arguments: expected " << endl; + return; } #ifdef HAVE_GLOBAL_REPLICATION diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index c5f08df8a6c..d0e1207cef0 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2397,7 +2397,7 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) * Backup ***************************************************************************/ int -MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) +MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) { bool next; NodeId nodeId = 0; @@ -2419,11 +2419,16 @@ MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) req->backupDataLen = 0; int result; - if (waitCompleted) { - result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, signal, true); + if (waitCompleted == 2) { + result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, + signal, true, 30*60*1000 /*30 secs*/); + } + else if (waitCompleted == 1) { + result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, + signal, true, 5*60*1000 /*5 mins*/); } else { - result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, signal, true); + result = sendRecSignal(nodeId, NO_WAIT, signal, true); } if (result == -1) { return SEND_OR_RECEIVE_FAILED; @@ -2502,18 +2507,31 @@ MgmtSrvr::abortBackup(Uint32 backupId) void MgmtSrvr::backupCallback(BackupEvent & event) { + DBUG_ENTER("MgmtSrvr::backupCallback"); m_lastBackupEvent = event; switch(event.Event){ case BackupEvent::BackupFailedToStart: + DBUG_PRINT("info",("BackupEvent::BackupFailedToStart")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupAborted: + DBUG_PRINT("info",("BackupEvent::BackupAborted")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupCompleted: + DBUG_PRINT("info",("BackupEvent::BackupCompleted")); theWaitState = NO_WAIT; break; case BackupEvent::BackupStarted: if(theWaitState == WAIT_BACKUP_STARTED) + { + DBUG_PRINT("info",("BackupEvent::BackupStarted NO_WAIT")); theWaitState = NO_WAIT; + } else { + DBUG_PRINT("info",("BackupEvent::BackupStarted")); + } } - return; + DBUG_VOID_RETURN; } diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 0cad99e9d86..21311ad78c9 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -60,6 +60,8 @@ public: } void add_listener(const Event_listener&); + void update_max_log_level(const LogLevel&); + void update_log_level(const LogLevel&); void log(int eventType, const Uint32* theData, NodeId nodeId); @@ -67,6 +69,8 @@ public: Event_listener& operator[](unsigned i) { return m_clients[i]; } const Event_listener& operator[](unsigned i) const { return m_clients[i]; } + void lock() { m_clients.lock(); } + void unlock(){ m_clients.unlock(); } }; /** @@ -360,7 +364,7 @@ public: /** * Backup functionallity */ - int startBackup(Uint32& backupId, bool waitCompleted = false); + int startBackup(Uint32& backupId, int waitCompleted= 2); int abortBackup(Uint32 backupId); int performBackup(Uint32* backupId); diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5b8d12e44d5..edd1e6ef07e 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -176,6 +176,7 @@ ParserRow commands[] = { MGM_ARG("args", String, Mandatory, "Args(space separated int's)"), MGM_CMD("start backup", &MgmApiSession::startBackup, ""), + MGM_ARG("completed", Int, Optional ,"Wait until completed"), MGM_CMD("abort backup", &MgmApiSession::abortBackup, ""), MGM_ARG("id", Int, Mandatory, "Backup id"), @@ -629,85 +630,30 @@ MgmApiSession::getVersion(Parser::Context &, m_output->println("string: %s", NDB_VERSION_STRING); m_output->println(""); } -#if 0 - -/***************************************************************************** - * BACKUP - *****************************************************************************/ - -int completed; -MgmtSrvr::BackupEvent globalEvent; - -static void -completedCallback(const MgmtSrvr::BackupEvent & event){ - - ndbout << "WaitCallback" << endl; - // Save event in the latestEvent var - - switch(event.Event){ - case MgmtSrvr::BackupEvent::BackupCompleted: - case MgmtSrvr::BackupEvent::BackupFailedToStart: - globalEvent = event; - completed = 1; - break; - } -} void MgmApiSession::startBackup(Parser::Context &, - Properties const &) { + Properties const &args) { + DBUG_ENTER("MgmApiSession::startBackup"); unsigned backupId; + Uint32 completed= 2; int result; - MgmtSrvr::BackupCallback prevCallback; - prevCallback = m_mgmsrv.setCallback(completedCallback); - completed = 0; - result = m_mgmsrv.startBackup(backupId); - if (result == 0){ - - // Wait for the callback to call our condition - // waitFor(); - while (completed == 0) - NdbSleep_SecSleep(0); - - if (globalEvent.Event == MgmtSrvr::BackupEvent::BackupFailedToStart) - result = globalEvent.FailedToStart.ErrorCode; - else - backupId = globalEvent.Completed.BackupId; - } - - // restore old callback - m_mgmsrv.setCallback(prevCallback); - - m_output->println("start backup reply"); - if(result != 0) - m_output->println("result: %s(%d)", get_error_text(result), result); - else{ - m_output->println("result: Ok"); - m_output->println("id: %d", backupId); - } - m_output->println(""); - -} -#endif - -void -MgmApiSession::startBackup(Parser::Context &, - Properties const &) { - unsigned backupId; - int result; + args.get("completed", &completed); - result = m_mgmsrv.startBackup(backupId, true); + result = m_mgmsrv.startBackup(backupId, completed); m_output->println("start backup reply"); if(result != 0) + { m_output->println("result: %s", get_error_text(result)); + } else{ m_output->println("result: Ok"); m_output->println("id: %d", backupId); } m_output->println(""); - + DBUG_VOID_RETURN; } void @@ -804,19 +750,22 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, LogLevel::EventCategory category= (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + m_mgmsrv.m_event_listner.lock(); if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level)) { m_output->println(reply); m_output->println("result: Invalid category %d", category); m_output->println(""); + m_mgmsrv.m_event_listner.unlock(); DBUG_VOID_RETURN; } + m_mgmsrv.m_event_listner.unlock(); - EventSubscribeReq req; - req.blockRef = 0; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); + } m_output->println(reply); m_output->println("result: Ok"); @@ -827,13 +776,13 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, void MgmApiSession::setLogLevel(Parser::Context &, Properties const &args) { - Uint32 node = 0, level = 0, category; + Uint32 node = 0, level = 0, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; logLevel.clear(); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); /* XXX should use constants for this value */ @@ -844,12 +793,15 @@ MgmApiSession::setLogLevel(Parser::Context &, return; } - EventSubscribeReq req; - req.blockRef = node; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); - + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); + } + m_output->println("set loglevel reply"); m_output->println("result: Ok"); m_output->println(""); @@ -1319,24 +1271,22 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) tmp.set_max(m_clients[i].m_logLevel); } m_clients.unlock(); - - if(!(tmp == m_logLevel)){ - m_logLevel = tmp; - EventSubscribeReq req; - req = tmp; - req.blockRef = 0; - m_mgmsrv->m_log_level_requests.push_back(req); - } + update_log_level(tmp); } - DBUG_VOID_RETURN; + DBUG_VOID_RETURN; } void -Ndb_mgmd_event_service::add_listener(const Event_listener& client){ - m_clients.push_back(client); - LogLevel tmp = m_logLevel; - tmp.set_max(client.m_logLevel); - +Ndb_mgmd_event_service::update_max_log_level(const LogLevel &log_level) +{ + LogLevel tmp= m_logLevel; + tmp.set_max(log_level); + update_log_level(tmp); +} + +void +Ndb_mgmd_event_service::update_log_level(const LogLevel &tmp) +{ if(!(tmp == m_logLevel)){ m_logLevel = tmp; EventSubscribeReq req; @@ -1346,14 +1296,22 @@ Ndb_mgmd_event_service::add_listener(const Event_listener& client){ } } +void +Ndb_mgmd_event_service::add_listener(const Event_listener& client){ + m_clients.push_back(client); + update_max_log_level(client.m_logLevel); +} + void Ndb_mgmd_event_service::stop_sessions(){ + m_clients.lock(); for(int i = m_clients.size() - 1; i >= 0; i--){ if(m_clients[i].m_socket >= 0){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i); } } + m_clients.unlock(); } void diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 09f52bf0bed..5e22468692e 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -46,7 +46,8 @@ NdbBackup::start(unsigned int & _backup_id){ ndb_mgm_reply reply; reply.return_code = 0; - if (ndb_mgm_start_backup(handle, + if (ndb_mgm_start_backup(handle, + 2, // wait until completed &_backup_id, &reply) == -1) { g_err << "Could not start backup " << endl; -- cgit v1.2.1 From f916abf3796de564676d2a6e96427caef20b325b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 00:51:30 +0100 Subject: CommandInterpreter.cpp: changed help text ndb/src/mgmclient/CommandInterpreter.cpp: changed help text --- ndb/src/mgmclient/CommandInterpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 4855b716d99..a169d21f97c 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -266,7 +266,7 @@ static const char* helpText = "START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" " Start backup (default WAIT COMPLETED)\n" "ABORT BACKUP Abort backup\n" -"SHUTDOWN Shutdown all processes in cluster and quit\n" +"SHUTDOWN Shutdown all processes in cluster\n" "CLUSTERLOG ON [] ... Enable Cluster logging\n" "CLUSTERLOG OFF [] ... Disable Cluster logging\n" "CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" -- cgit v1.2.1 From 1e314961893c2f5a460bb16c72c320ad3fedd037 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 08:45:00 +0200 Subject: initialize variables (addition for BUG#7079) sql/item.cc: initialize variables --- sql/item.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 3fca0033be2..9ed8b39dece 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1372,7 +1372,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { - enum_parsing_place place; + enum_parsing_place place= NO_MATTER; DBUG_ASSERT(fixed == 0); if (!field) // If field is not checked { @@ -2044,7 +2044,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { DBUG_ASSERT(fixed == 0); uint counter; - enum_parsing_place place; + enum_parsing_place place= NO_MATTER; bool not_used; if (!ref) { -- cgit v1.2.1 From f40f838f50bda025cacd0529e1ec41bb4f1e5579 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:31:17 +0200 Subject: dict0load.c: dict_load_table(): detect the new table format of MySQL 5.0.3 innobase/dict/dict0load.c: dict_load_table(): detect the new table format of MySQL 5.0.3 --- innobase/dict/dict0load.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index a4637e09d07..0bbf0511b57 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -647,6 +647,22 @@ dict_load_table( return(NULL); } +#if MYSQL_VERSION_ID < 50300 + /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the + "compact format" flag. */ + field = rec_get_nth_field(rec, 7, &len); + if (mach_read_from_1(field) & 0x80) { + btr_pcur_close(&pcur); + mtr_commit(&mtr); + mem_heap_free(heap); + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: table %s is in the new compact format\n" + "InnoDB: of MySQL 5.0.3 or later\n", name); + return(NULL); + } +#endif /* MYSQL_VERSION_ID < 50300 */ + ut_a(0 == ut_strcmp((char *) "SPACE", dict_field_get_col( dict_index_get_nth_field( -- cgit v1.2.1 From be19c6f72109d8ffd3adbee84a1289ad05bcf14f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 11:45:45 +0100 Subject: bug #7230 + fixed testcase mysql-test/ndb/basic.result: fixed testcase ndb/include/debugger/EventLogger.hpp: bug #7230 --- mysql-test/ndb/basic.result | 5 +++-- ndb/include/debugger/EventLogger.hpp | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result index 6bd907a11d0..7049c02f304 100644 --- a/mysql-test/ndb/basic.result +++ b/mysql-test/ndb/basic.result @@ -6,9 +6,10 @@ HELP Print help text HELP SHOW Help for SHOW command HELP DEBUG Help for debug compiled version SHOW Print information about cluster -START BACKUP Start backup +START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED] + Start backup (default WAIT COMPLETED) ABORT BACKUP Abort backup -SHUTDOWN Shutdown all processes in cluster and quit +SHUTDOWN Shutdown all processes in cluster CLUSTERLOG ON [] ... Enable Cluster logging CLUSTERLOG OFF [] ... Disable Cluster logging CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index b82c823ee0b..ddf21b79f5f 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -48,11 +48,10 @@ public: static const EventRepLogLevelMatrix matrix[]; static const Uint32 matrixSize; - static int - EventLoggerBase::event_lookup(int eventType, - LogLevel::EventCategory &cat, - Uint32 &threshold, - Logger::LoggerLevel &severity); + static int event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity); }; /** -- cgit v1.2.1 From f507b37767334fb52ce3f7d32c710754ef15d022 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:50:33 +0100 Subject: ndb - Handle shm-transporter wo/ busy-wait + also handled mixed tcp/shm transporters + bug#7124 ndb/src/common/transporter/SHM_Transporter.cpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/common/transporter/SHM_Transporter.hpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/common/transporter/TransporterRegistry.cpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/kernel/main.cpp: Set pid to use for shm-signaling ndb/src/mgmsrv/ConfigInfo.cpp: bug#7124 ndb/src/ndbapi/TransporterFacade.cpp: Set pid to use for shm-signaling --- ndb/src/common/transporter/SHM_Transporter.cpp | 83 ++--- ndb/src/common/transporter/SHM_Transporter.hpp | 33 +- ndb/src/common/transporter/TransporterRegistry.cpp | 398 +++++++++++---------- ndb/src/kernel/main.cpp | 3 + ndb/src/mgmsrv/ConfigInfo.cpp | 63 +++- ndb/src/ndbapi/TransporterFacade.cpp | 4 + 6 files changed, 336 insertions(+), 248 deletions(-) diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index ab161d8c18c..7c2c2aafb85 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -26,6 +26,8 @@ #include #include +extern int g_shm_pid; + SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, @@ -52,6 +54,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, #ifdef DEBUG_TRANSPORTER printf("shm key (%d - %d) = %d\n", lNodeId, rNodeId, shmKey); #endif + m_signal_threshold = 4096; } SHM_Transporter::~SHM_Transporter(){ @@ -182,42 +185,6 @@ SHM_Transporter::setupBuffers(){ #endif } -#if 0 -SendStatus -SHM_Transporter::prepareSend(const SignalHeader * const signalHeader, - Uint8 prio, - const Uint32 * const signalData, - const LinearSegmentPtr ptr[3], - bool force){ - - if(isConnected()){ - - const Uint32 lenBytes = m_packer.getMessageLength(signalHeader, ptr); - - Uint32 * insertPtr = (Uint32 *)writer->getWritePtr(lenBytes); - - if(insertPtr != 0){ - - m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr); - - /** - * Do funky membar stuff - */ - - writer->updateWritePtr(lenBytes); - return SEND_OK; - - } else { - // NdbSleep_MilliSleep(3); - //goto tryagain; - return SEND_BUFFER_FULL; - } - } - return SEND_DISCONNECTED; -} -#endif - - bool SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) { @@ -247,10 +214,17 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to client - s_output.println("shm server 1 ok"); - + s_output.println("shm server 1 ok: %d", g_shm_pid); + // Wait for ok from client - if (s_input.gets(buf, 256) == 0) { + if (s_input.gets(buf, 256) == 0) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + + if(sscanf(buf, "shm client 1 ok: %d", &m_remote_pid) != 1) + { NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } @@ -289,6 +263,12 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) DBUG_RETURN(false); } + if(sscanf(buf, "shm server 1 ok: %d", &m_remote_pid) != 1) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + // Create if(!_shmSegCreated){ if (!ndb_shm_get()) { @@ -313,10 +293,10 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to server - s_output.println("shm client 1 ok"); - + s_output.println("shm client 1 ok: %d", g_shm_pid); + int r= connect_common(sockfd); - + if (r) { // Wait for ok from server if (s_input.gets(buf, 256) == 0) { @@ -344,18 +324,33 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd) return false; } - if(!setupBuffersDone) { + if(!setupBuffersDone) + { setupBuffers(); setupBuffersDone=true; } - if(setupBuffersDone) { + if(setupBuffersDone) + { NdbSleep_MilliSleep(m_timeOutMillis); if(*serverStatusFlag == 1 && *clientStatusFlag == 1) + { + m_last_signal = 0; return true; + } } DBUG_PRINT("error", ("Failed to set up buffers to node %d", remoteNodeId)); return false; } + +void +SHM_Transporter::doSend() +{ + if(m_last_signal) + { + m_last_signal = 0; + kill(m_remote_pid, SIGUSR1); + } +} diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index 27692209ffe..b501f652168 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -47,18 +47,25 @@ public: * SHM destructor */ virtual ~SHM_Transporter(); - + /** * Do initialization */ bool initTransporter(); - - Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio){ + + Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio) + { return (Uint32 *)writer->getWritePtr(lenBytes); } - void updateWritePtr(Uint32 lenBytes, Uint32 prio){ + void updateWritePtr(Uint32 lenBytes, Uint32 prio) + { writer->updateWritePtr(lenBytes); + m_last_signal += lenBytes; + if(m_last_signal >= m_signal_threshold) + { + doSend(); + } } void getReceivePtr(Uint32 ** ptr, Uint32 ** eod){ @@ -123,28 +130,36 @@ protected: */ void setupBuffers(); + /** + * doSend (i.e signal receiver) + */ + void doSend(); + int m_remote_pid; + Uint32 m_last_signal; + Uint32 m_signal_threshold; + private: bool _shmSegCreated; bool _attached; bool m_connected; - + key_t shmKey; volatile Uint32 * serverStatusFlag; volatile Uint32 * clientStatusFlag; bool setupBuffersDone; - + #ifdef NDB_WIN32 HANDLE hFileMapping; #else int shmId; #endif - + int shmSize; char * shmBuf; - + SHM_Reader * reader; SHM_Writer * writer; - + /** * @return - True if the reader has data to read on its segment. */ diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index a2fab8f9806..61924fe55b2 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -47,6 +47,8 @@ #include #include +int g_shm_pid = 0; + SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); @@ -622,11 +624,28 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ return retVal; #endif - if((nSHMTransporters+nSCITransporters) > 0) + if((nSCITransporters) > 0) + { timeOutMillis=0; + } + +#ifdef NDB_SHM_TRANSPORTER + if(nSHMTransporters > 0) + { + Uint32 res = poll_SHM(0); + if(res) + { + retVal |= res; + timeOutMillis = 0; + } + } +#endif + #ifdef NDB_TCP_TRANSPORTER - if(nTCPTransporters > 0) + if(nTCPTransporters > 0 || retVal == 0) + { retVal |= poll_TCP(timeOutMillis); + } else tcpReadSelectReply = 0; #endif @@ -635,8 +654,11 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ retVal |= poll_SCI(timeOutMillis); #endif #ifdef NDB_SHM_TRANSPORTER - if(nSHMTransporters > 0) - retVal |= poll_SHM(timeOutMillis); + if(nSHMTransporters > 0 && retVal == 0) + { + int res = poll_SHM(0); + retVal |= res; + } #endif return retVal; } @@ -644,8 +666,8 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ #ifdef NDB_SCI_TRANSPORTER Uint32 -TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ - +TransporterRegistry::poll_SCI(Uint32 timeOutMillis) +{ for (int i=0; iisConnected()) { @@ -659,73 +681,29 @@ TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ #ifdef NDB_SHM_TRANSPORTER +static int g_shm_counter = 0; Uint32 TransporterRegistry::poll_SHM(Uint32 timeOutMillis) { - for(int j=0; j < 20; j++) - for (int i=0; iisConnected()) { - if(t->hasDataToRead()) { - return 1; - } - } - } - /** - * @note: granularity of linux/i386 timer is not good enough. - * Can't sleep if using SHM as it is now. - */ - /* - if(timeOutMillis > 0) - NdbSleep_MilliSleep(timeOutMillis); - else - NdbSleep_MilliSleep(1); - */ - return 0; -#if 0 - NDB_TICKS startTime = NdbTick_CurrentMillisecond(); - for(int i=0; i<100; i++) { + for(int j=0; j < 100; j++) + { for (int i=0; iisConnected()) { - if(t->hasDataToRead()){ + if(t->hasDataToRead()) { return 1; } - else - continue; - } - else - continue; - } - - if(NdbTick_CurrentMillisecond() > (startTime +timeOutMillis)) - return 0; - } - NdbSleep_MilliSleep(5); - return 0; - -#endif -#if 0 - - for(int j=0; j < 100; j++) { - for (int i=0; iisConnected()) { - if(t->hasDataToRead()) - return 1; } } } return 0; -#endif } - - #endif #ifdef NDB_OSE_TRANSPORTER Uint32 -TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ +TransporterRegistry::poll_OSE(Uint32 timeOutMillis) +{ if(theOSEReceiver != NULL){ return theOSEReceiver->doReceive(timeOutMillis); } @@ -736,18 +714,18 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ #ifdef NDB_TCP_TRANSPORTER Uint32 -TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ - - if (nTCPTransporters == 0){ +TransporterRegistry::poll_TCP(Uint32 timeOutMillis) +{ + if (false && nTCPTransporters == 0) + { tcpReadSelectReply = 0; return 0; } struct timeval timeout; #ifdef NDB_OSE - // Return directly if there are no TCP transporters configured - + if(timeOutMillis <= 1){ timeout.tv_sec = 0; timeout.tv_usec = 1025; @@ -760,7 +738,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ timeout.tv_usec = (timeOutMillis % 1000) * 1000; #endif - NDB_SOCKET_TYPE maxSocketValue = 0; + NDB_SOCKET_TYPE maxSocketValue = -1; // Needed for TCP/IP connections // The read- and writeset are used by select @@ -788,23 +766,29 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ maxSocketValue++; tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout); + if(false && tcpReadSelectReply == -1 && errno == EINTR) + ndbout_c("woke-up by signal"); + #ifdef NDB_WIN32 if(tcpReadSelectReply == SOCKET_ERROR) { NdbSleep_MilliSleep(timeOutMillis); } #endif - + return tcpReadSelectReply; } #endif void -TransporterRegistry::performReceive(){ +TransporterRegistry::performReceive() +{ #ifdef NDB_OSE_TRANSPORTER - if(theOSEReceiver != 0){ - while(theOSEReceiver->hasData()){ + if(theOSEReceiver != 0) + { + while(theOSEReceiver->hasData()) + { NodeId remoteNodeId; Uint32 * readPtr; Uint32 sz = theOSEReceiver->getReceiveData(&remoteNodeId, &readPtr); @@ -827,16 +811,20 @@ TransporterRegistry::performReceive(){ #endif #ifdef NDB_TCP_TRANSPORTER - if(tcpReadSelectReply > 0){ - for (int i=0; i 0) + { + for (int i=0; igetRemoteNodeId(); const NDB_SOCKET_TYPE socket = t->getSocket(); if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) { + if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) + { const int receiveSize = t->doReceive(); - if(receiveSize > 0){ + if(receiveSize > 0) + { Uint32 * ptr; Uint32 sz = t->getReceiveData(&ptr); Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]); @@ -847,142 +835,165 @@ TransporterRegistry::performReceive(){ } } #endif - - + #ifdef NDB_SCI_TRANSPORTER //performReceive //do prepareReceive on the SCI transporters (prepareReceive(t,,,,)) - for (int i=0; igetRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; igetRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif #ifdef NDB_SHM_TRANSPORTER - for (int i=0; igetRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; igetRemoteNodeId(); + if(is_connected(nodeId)){ + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif } static int x = 0; void -TransporterRegistry::performSend(){ - int i; - sendCounter = 1; - +TransporterRegistry::performSend() +{ + int i; + sendCounter = 1; + #ifdef NDB_OSE_TRANSPORTER - for (int i = 0; i < nOSETransporters; i++){ - OSE_Transporter *t = theOSETransporters[i]; - if((is_connected(t->getRemoteNodeId()) && - (t->isConnected())) { - t->doSend(); - }//if - }//for + for (int i = 0; i < nOSETransporters; i++) + { + OSE_Transporter *t = theOSETransporters[i]; + if(is_connected(t->getRemoteNodeId()) &&& (t->isConnected())) + { + t->doSend(); + }//if + }//for #endif - + #ifdef NDB_TCP_TRANSPORTER #ifdef NDB_OSE + { + int maxSocketValue = 0; + + // Needed for TCP/IP connections + // The writeset are used by select + fd_set writeset; + FD_ZERO(&writeset); + + // Prepare for sending and receiving + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter * t = theTCPTransporters[i]; + + // If the transporter is connected + if ((t->hasDataToSend()) && (t->isConnected())) { + const int socket = t->getSocket(); + // Find the highest socket value. It will be used by select + if (socket > maxSocketValue) { + maxSocketValue = socket; + }//if + FD_SET(socket, &writeset); + }//if + }//for + + // The highest socket value plus one + if(maxSocketValue == 0) + return; + + maxSocketValue++; + struct timeval timeout = { 0, 1025 }; + Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); + + if (tmp == 0) { - int maxSocketValue = 0; - - // Needed for TCP/IP connections - // The writeset are used by select - fd_set writeset; - FD_ZERO(&writeset); - - // Prepare for sending and receiving - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter * t = theTCPTransporters[i]; - - // If the transporter is connected - if ((t->hasDataToSend()) && (t->isConnected())) { - const int socket = t->getSocket(); - // Find the highest socket value. It will be used by select - if (socket > maxSocketValue) { - maxSocketValue = socket; - }//if - FD_SET(socket, &writeset); - }//if - }//for - - // The highest socket value plus one - if(maxSocketValue == 0) - return; - - maxSocketValue++; - struct timeval timeout = { 0, 1025 }; - Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); - - if (tmp == 0) { - return; - }//if - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - const int socket = t->getSocket(); - if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &writeset)) { - t->doSend(); - }//if - }//if - }//for + return; + }//if + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter *t = theTCPTransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + const int socket = t->getSocket(); + if(is_connected(nodeId)){ + if(t->isConnected() && FD_ISSET(socket, &writeset)) { + t->doSend(); + }//if + }//if + }//for } #endif #ifdef NDB_TCP_TRANSPORTER - for (i = x; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - for (i = 0; i < x && i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - x++; - if (x == nTCPTransporters) x = 0; + for (i = x; i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + for (i = 0; i < x && i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + x++; + if (x == nTCPTransporters) x = 0; #endif #endif #ifdef NDB_SCI_TRANSPORTER - //scroll through the SCI transporters, - // get each transporter, check if connected, send data - for (i=0; igetRemoteNodeId(); - - if(is_connected(nodeId)){ - if(t->isConnected() && t->hasDataToSend()) { - t->doSend(); - } //if + //scroll through the SCI transporters, + // get each transporter, check if connected, send data + for (i=0; igetRemoteNodeId(); + + if(is_connected(nodeId)) + { + if(t->isConnected() && t->hasDataToSend()) { + t->doSend(); } //if - } //if + } //if + } +#endif + +#ifdef NDB_SHM_TRANSPORTER + for (i=0; igetRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected()) + { + t->doSend(); + } + } + } #endif } @@ -1169,7 +1180,8 @@ TransporterRegistry::stop_clients() } void -TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port) +TransporterRegistry::add_transporter_interface(const char *interface, + unsigned short port) { DBUG_ENTER("TransporterRegistry::add_transporter_interface"); DBUG_PRINT("enter",("interface=%s, port= %d", interface, port)); @@ -1232,6 +1244,15 @@ TransporterRegistry::start_service(SocketServer& socket_server) return true; } +#ifdef NDB_SHM_TRANSPORTER +static +RETSIGTYPE +shm_sig_handler(int signo) +{ + g_shm_counter++; +} +#endif + void TransporterRegistry::startReceiving() { @@ -1250,6 +1271,13 @@ TransporterRegistry::startReceiving() for(int i = 0; itheReceiverPid = theReceiverPid; #endif + +#ifdef NDB_SHM_TRANSPORTER + if(nSHMTransporters) + { + signal(SIGUSR1, shm_sig_handler); + } +#endif } void diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 926647838c9..7d6b597e6dd 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -49,6 +49,8 @@ void catchsigs(bool ignore); // for process signal handling extern "C" void handler_shutdown(int signum); // for process signal handling extern "C" void handler_error(int signum); // for process signal handling +extern int g_shm_pid; + // Shows system information void systemInfo(const Configuration & conf, const LogLevel & ll); @@ -145,6 +147,7 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); + g_shm_pid = getpid(); theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 4af1556a0c0..35229d1f666 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -82,7 +82,7 @@ static bool transformConnection(InitConfigFileParser::Context & ctx, const char static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *); static bool fixPortNumber(InitConfigFileParser::Context & ctx, const char *); -static bool fixShmkey(InitConfigFileParser::Context & ctx, const char *); +static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *); static bool checkDbConstraints(InitConfigFileParser::Context & ctx, const char *); static bool checkConnectionConstraints(InitConfigFileParser::Context &, const char *); static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *); @@ -131,13 +131,15 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixHostname, "HostName2" }, { "SCI", fixHostname, "HostName1" }, { "SCI", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "OSE", fixHostname, "HostName1" }, { "OSE", fixHostname, "HostName2" }, { "TCP", fixPortNumber, 0 }, // has to come after fixHostName { "SHM", fixPortNumber, 0 }, // has to come after fixHostName { "SCI", fixPortNumber, 0 }, // has to come after fixHostName - //{ "SHM", fixShmKey, 0 }, + { "SHM", fixShmKey, 0 }, /** * fixExtConnection must be after fixNodeId @@ -168,6 +170,8 @@ ConfigInfo::m_SectionRules[] = { { "TCP", checkTCPConstraints, "HostName2" }, { "SCI", checkTCPConstraints, "HostName1" }, { "SCI", checkTCPConstraints, "HostName2" }, + { "SHM", checkTCPConstraints, "HostName1" }, + { "SHM", checkTCPConstraints, "HostName2" }, { "*", checkMandatory, 0 }, @@ -1687,16 +1691,27 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 0, 0 }, { - CFG_CONNECTION_NODE_1, - "NodeId1", + CFG_CONNECTION_HOSTNAME_1, + "HostName1", "SHM", - "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + "Name/IP of computer on one side of the connection", + ConfigInfo::INTERNAL, false, ConfigInfo::STRING, - MANDATORY, + UNDEFINED, 0, 0 }, - + + { + CFG_CONNECTION_HOSTNAME_2, + "HostName2", + "SHM", + "Name/IP of computer on one side of the connection", + ConfigInfo::INTERNAL, + false, + ConfigInfo::STRING, + UNDEFINED, + 0, 0 }, + { CFG_CONNECTION_SERVER_PORT, "PortNumber", @@ -1709,6 +1724,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "0", STR_VALUE(MAX_INT_RNIL) }, + { + CFG_CONNECTION_NODE_1, + "NodeId1", + "SHM", + "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", + ConfigInfo::USED, + false, + ConfigInfo::STRING, + MANDATORY, + 0, 0 }, + { CFG_CONNECTION_NODE_2, "NodeId2", @@ -3025,15 +3051,32 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ << "per connection, please remove from config. " << "Will be changed to " << port << endl; ctx.m_currentSection->put("PortNumber", port, true); - } else + } + else + { ctx.m_currentSection->put("PortNumber", port); - + } DBUG_PRINT("info", ("connection %d-%d port %d host %s", id1, id2, port, hostname.c_str())); DBUG_RETURN(true); } +static +bool +fixShmKey(InitConfigFileParser::Context & ctx, const char *) +{ + Uint32 id1= 0, id2= 0, key= 0; + require(ctx.m_currentSection->get("NodeId1", &id1)); + require(ctx.m_currentSection->get("NodeId2", &id2)); + if(ctx.m_currentSection->get("ShmKey", &key)) + return true; + + key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1); + ctx.m_currentSection->put("ShmKey", key); + return true; +} + /** * DB Node rule: Check various constraints */ diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index dfb090c8416..f6a7496decc 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -450,8 +450,12 @@ runReceiveResponse_C(void * me) return me; } +extern int g_shm_pid; + void TransporterFacade::threadMainReceive(void) { + g_shm_pid = getpid(); + theTransporterRegistry->startReceiving(); NdbMutex_Lock(theMutexPtr); theTransporterRegistry->update_connections(); -- cgit v1.2.1 From f4dc786ec88e700a3d3e3b90cf090eec0bf29c84 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:19:34 +0200 Subject: Some fixes for Netware. --- netware/init_db.sql | 30 +++++++++++++++--------------- netware/mysql_fix_privilege_tables.pl | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/netware/init_db.sql b/netware/init_db.sql index 15111c9043b..c5810b50e8e 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -3,14 +3,14 @@ CREATE DATABASE test; USE mysql; -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -18,21 +18,21 @@ INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('',''); -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; +CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics'; +CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories'; +CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords'; +CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation'; -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names'; -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones'; +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions'; -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types'; +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones'; diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl index c0a428eff0f..20af37be2d7 100644 --- a/netware/mysql_fix_privilege_tables.pl +++ b/netware/mysql_fix_privilege_tables.pl @@ -206,7 +206,7 @@ unique index (name) \ print "Filling online help tables with contents...\n"; # Generate the path for "fill_help_tables.sql" file which is in different folder. $fill_help_table=$0; -$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/support-files\\fill_help_tables.sql/; +$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/share\\fill_help_tables.sql/; #read all content from the sql file which contains recordsfor help tables. open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!"); -- cgit v1.2.1 From 46364ddb1978802ad9bf5418738b03d0cfe8bd61 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:26:28 +0000 Subject: WL#2274 - INSERT..SELECT..UPDATE UPDATE clause conflicts with SELECT for use of item_list field. Alter UPDATE clause to use new lex field update_list Tests included mysql-test/r/insert_update.result: WL#2274 New tests for INSERT..SELECT..UPDATE mysql-test/t/insert_update.test: WL#2274 New tests for INSERT..SELECT..UPDATE sql/mysql_priv.h: Remove function - insert_select_precheck() sql/sql_class.h: WL#2274 New constructor for class select_insert sql/sql_insert.cc: WL#2274 Move code into mysql_prepare_insert Add checks as param values may be NULL sql/sql_lex.cc: WL#2274 initialize lex->update_list sql/sql_lex.h: WL#2274 New field in LEX: update_list sql/sql_parse.cc: WL#2274 INSERT..UPDATE clause now populates lex->update_list Remove redundant function: insert_select_precheck() sql/sql_prepare.cc: WL#2274 invoke insert_precheck() instead of insert_select_precheck() sql/sql_yacc.yy: WL#2274 Enable INSERT..SELECT..UPDATE syntax New rule - insert_update_list, to populate lex->update_list --- mysql-test/r/insert_update.result | 62 +++++++++++++++++++++++++++++++++++++++ mysql-test/t/insert_update.test | 31 ++++++++++++++++++++ sql/mysql_priv.h | 1 - sql/sql_class.h | 10 +++++++ sql/sql_insert.cc | 27 +++++++++-------- sql/sql_lex.cc | 1 + sql/sql_lex.h | 2 +- sql/sql_parse.cc | 45 +++++++++------------------- sql/sql_prepare.cc | 2 +- sql/sql_yacc.yy | 45 ++++++++++++++-------------- 10 files changed, 157 insertions(+), 69 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 303d7186015..753dc2cd749 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -105,3 +105,65 @@ a b 8 28 9 29 drop table t1; +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 30 +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 130 +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +a b c +1 2 10 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +ERROR 23000: Duplicate entry '4' for key 2 +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (x INT, y INT, z INT, d INT); +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 6 30 +8 9 60 +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 0 30 +8 9 60 +INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +a b c VALUES(a) +1 2 10 NULL +3 4 127 NULL +5 0 30 NULL +8 9 60 NULL +2 1 11 NULL +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index fc54ce88f8a..182baa641da 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -48,3 +48,34 @@ disable_info; select * from t1; drop table t1; + +# WorkLog #2274 - enable INSERT .. SELECT .. UPDATE syntax +# Same tests as beginning of this test except that insert source +# is a result from a select statement +# +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +-- error 1062 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +SELECT * FROM t1; +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (x INT, y INT, z INT, d INT); +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +DROP TABLE t1; +DROP TABLE t2; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 8350122c4e2..c90935f4cf9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -362,7 +362,6 @@ bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list); int multi_update_precheck(THD *thd, TABLE_LIST *tables); int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count); -int insert_select_precheck(THD *thd, TABLE_LIST *tables); int update_precheck(THD *thd, TABLE_LIST *tables); int delete_precheck(THD *thd, TABLE_LIST *tables); int insert_precheck(THD *thd, TABLE_LIST *tables); diff --git a/sql/sql_class.h b/sql/sql_class.h index 419c087afbc..169835f3324 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1238,6 +1238,16 @@ class select_insert :public select_result_interceptor { bzero((char*) &info,sizeof(info)); info.handle_duplicates=duplic; } + select_insert(TABLE *table_par, List *fields_par, + List *update_fields, List *update_values, + enum_duplicates duplic) + :table(table_par), fields(fields_par), last_insert_id(0) + { + bzero((char*) &info,sizeof(info)); + info.handle_duplicates=duplic; + info.update_fields= update_fields; + info.update_values= update_values; + } ~select_insert(); int prepare(List &list, SELECT_LEX_UNIT *u); bool send_data(List &items); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 768acb0cf9e..ce64890523a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -197,15 +197,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->used_tables=0; values= its++; - if (duplic == DUP_UPDATE && !table->insert_values) - { - /* it should be allocated before Item::fix_fields() */ - table->insert_values= - (byte *)alloc_root(thd->mem_root, table->rec_buff_length); - if (!table->insert_values) - goto abort; - } - if (mysql_prepare_insert(thd, table_list, insert_table_list, table, fields, values, update_fields, update_values, duplic)) @@ -448,14 +439,24 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, enum_duplicates duplic) { DBUG_ENTER("mysql_prepare_insert"); - if (check_insert_fields(thd, table, fields, *values, 1) || + if (duplic == DUP_UPDATE && !table->insert_values) + { + /* it should be allocated before Item::fix_fields() */ + table->insert_values= + (byte *)alloc_root(thd->mem_root, table->rec_buff_length); + if (!table->insert_values) + DBUG_RETURN(-1); + } + if ((values && check_insert_fields(thd, table, fields, *values, 1)) || setup_tables(insert_table_list) || - setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) || + (values && setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0)) || (duplic == DUP_UPDATE && (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0) || setup_fields(thd, 0, insert_table_list, update_values, 1, 0, 0)))) DBUG_RETURN(-1); - if (find_real_table_in_list(table_list->next, + if ((thd->lex->sql_command==SQLCOM_INSERT || + thd->lex->sql_command==SQLCOM_REPLACE) && + find_real_table_in_list(table_list->next, table_list->db, table_list->real_name)) { my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); @@ -550,8 +551,10 @@ int write_record(TABLE *table,COPY_INFO *info) that matches, is updated. If update causes a conflict again, an error is returned */ + DBUG_ASSERT(table->insert_values != NULL); store_record(table,insert_values); restore_record(table,record[1]); + DBUG_ASSERT(info->update_fields->elements==info->update_values->elements); if (fill_record(*info->update_fields, *info->update_values, 0)) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 1d9afcc94a4..d2ac0df1472 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -123,6 +123,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->unit.thd= thd; lex->select_lex.init_query(); lex->value_list.empty(); + lex->update_list.empty(); lex->param_list.empty(); lex->unit.next= lex->unit.master= lex->unit.link_next= lex->unit.return_to= 0; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index b055a022eb4..8421be7e735 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -587,7 +587,7 @@ typedef struct st_lex List columns; List key_list; List create_list; - List *insert_list,field_list,value_list; + List *insert_list,field_list,value_list,update_list; List many_values; List var_list; List param_list; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e73c3d95b42..8dc1339993e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2717,7 +2717,7 @@ unsent_create_error: if ((res= insert_precheck(thd, tables))) break; res = mysql_insert(thd,tables,lex->field_list,lex->many_values, - select_lex->item_list, lex->value_list, + lex->update_list, lex->value_list, lex->duplicates); if (thd->net.report_error) res= -1; @@ -2727,7 +2727,7 @@ unsent_create_error: case SQLCOM_INSERT_SELECT: { TABLE_LIST *first_local_table= (TABLE_LIST *) select_lex->table_list.first; - if ((res= insert_select_precheck(thd, tables))) + if ((res= insert_precheck(thd, tables))) break; /* Fix lock for first table */ @@ -2749,11 +2749,16 @@ unsent_create_error: select_lex->options |= OPTION_BUFFER_RESULT; } - if (!(res= open_and_lock_tables(thd, tables)) && + !(res= mysql_prepare_insert(thd, tables, first_local_table, + tables->table, lex->field_list, 0, + lex->update_list, lex->value_list, + lex->duplicates)) && (result= new select_insert(tables->table, &lex->field_list, + &lex->update_list, &lex->value_list, lex->duplicates))) { + TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*) first_local_table->next; /* @@ -2766,6 +2771,7 @@ unsent_create_error: lex->select_lex.table_list.first= (byte*) first_local_table; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; delete result; + table->insert_values= 0; if (thd->net.report_error) res= -1; } @@ -5304,33 +5310,6 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) } -/* - INSERT ... SELECT query pre-check - - SYNOPSIS - insert_delete_precheck() - thd Thread handler - tables Global table list - - RETURN VALUE - 0 OK - 1 Error (message is sent to user) - -1 Error (message is not sent to user) -*/ - -int insert_select_precheck(THD *thd, TABLE_LIST *tables) -{ - DBUG_ENTER("insert_select_precheck"); - /* - Check that we have modify privileges for the first table and - select privileges for the rest - */ - ulong privilege= (thd->lex->duplicates == DUP_REPLACE ? - INSERT_ACL | DELETE_ACL : INSERT_ACL); - DBUG_RETURN(check_one_table_access(thd, privilege, tables) ? 1 : 0); -} - - /* simple UPDATE query pre-check @@ -5402,6 +5381,10 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) LEX *lex= thd->lex; DBUG_ENTER("insert_precheck"); + /* + Check that we have modify privileges for the first table and + select privileges for the rest + */ ulong privilege= INSERT_ACL | (lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) | (lex->duplicates == DUP_UPDATE ? UPDATE_ACL : 0); @@ -5409,7 +5392,7 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) if (check_one_table_access(thd, privilege, tables)) DBUG_RETURN(1); - if (lex->select_lex.item_list.elements != lex->value_list.elements) + if (lex->update_list.elements != lex->value_list.elements) { my_error(ER_WRONG_VALUE_COUNT, MYF(0)); DBUG_RETURN(-1); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index bcb9d18d827..f4a96d751cd 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1343,7 +1343,7 @@ static int mysql_test_insert_select(Prepared_statement *stmt, { int res; LEX *lex= stmt->lex; - if ((res= insert_select_precheck(stmt->thd, tables))) + if ((res= insert_precheck(stmt->thd, tables))) return res; TABLE_LIST *first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1b629e72ecc..a09694ee1e6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4161,21 +4161,8 @@ expr_or_default: opt_insert_update: /* empty */ - | ON DUPLICATE_SYM - { - LEX *lex= Lex; - /* - For simplicity, let's forget about INSERT ... SELECT ... UPDATE - for a moment. - */ - if (lex->sql_command != SQLCOM_INSERT) - { - yyerror(ER(ER_SYNTAX_ERROR)); - YYABORT; - } - lex->duplicates= DUP_UPDATE; - } - KEY_SYM UPDATE_SYM update_list + | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; } + KEY_SYM UPDATE_SYM insert_update_list ; /* Update rows in a table */ @@ -4211,16 +4198,28 @@ update: ; update_list: - update_list ',' simple_ident equal expr_or_default + update_list ',' update_elem + | update_elem; + +update_elem: + simple_ident equal expr_or_default { - if (add_item_to_list(YYTHD, $3) || add_value_to_list(YYTHD, $5)) + if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) YYABORT; - } - | simple_ident equal expr_or_default - { - if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) - YYABORT; - }; + }; + +insert_update_list: + insert_update_list ',' insert_update_elem + | insert_update_elem; + +insert_update_elem: + simple_ident equal expr_or_default + { + LEX *lex= Lex; + if (lex->update_list.push_back($1) || + lex->value_list.push_back($3)) + YYABORT; + }; opt_low_priority: /* empty */ { $$= YYTHD->update_lock_default; } -- cgit v1.2.1 From ca4d47dc086902c109259cc6e870a63616ed5c59 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:43:28 +0100 Subject: fixed event thread for better error handling --- ndb/src/mgmclient/CommandInterpreter.cpp | 41 +++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index a169d21f97c..0c7fe642e54 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -465,6 +465,7 @@ event_thread_run(void* m) int fd = ndb_mgm_listen_event(handle, filter); if (fd > 0) { + do_event_thread= 1; char *tmp= 0; char buf[1024]; SocketInputStream in(fd,10); @@ -474,6 +475,10 @@ event_thread_run(void* m) ndbout << tmp; } while(do_event_thread); } + else + { + do_event_thread= -1; + } my_thread_end(); NdbThread_Exit(0); @@ -494,24 +499,38 @@ CommandInterpreter::connect() && !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { - m_connected= true; - if (m_verbose) + assert(m_event_thread == 0); + assert(do_event_thread == 0); + do_event_thread= 0; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&m_mgmsrv2, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); + if (m_event_thread != 0) { - printf("Connected to Management Server at: %s:%d\n", - host, port); + int iter= 1000; // try for 30 seconds + while(do_event_thread == 0 && + iter-- > 0) + NdbSleep_MilliSleep(30); } + if (m_event_thread == 0 || + do_event_thread == 0 || + do_event_thread == -1) { - do_event_thread= 1; - m_event_thread = NdbThread_Create(event_thread_run, - (void**)&m_mgmsrv2, - 32768, - "CommandInterpreted_event_thread", - NDB_THREAD_PRIO_LOW); + printf("Warning, event thread startup failed, degraded printouts as result\n"); + do_event_thread= 0; } } else { - ndb_mgm_disconnect(m_mgmsrv); + printf("Warning, event connect failed, degraded printouts as result\n"); + } + m_connected= true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + host, port); } } } -- cgit v1.2.1 From 4d3362b431c16058d355917a291636eed7b05c60 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:54:13 +0200 Subject: fixed parameter to avoid accessing unallocated memory --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ba2a227bf95..f2499966815 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1418,7 +1418,7 @@ JOIN::exec() WHERE clause for any tables after the sorted one. */ JOIN_TAB *curr_table= &curr_join->join_tab[curr_join->const_tables+1]; - JOIN_TAB *end_table= &curr_join->join_tab[tables]; + JOIN_TAB *end_table= &curr_join->join_tab[curr_join->tables]; for (; curr_table < end_table ; curr_table++) { /* -- cgit v1.2.1 From fe6baf9f60c268adc971c4f628a3cc918ce32cfa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:58:58 +0100 Subject: changed back to just restricting max meta objects in dict to make sure we can "always" configure ourselves out of unforseen limits ndb/src/kernel/vm/Configuration.cpp: changed back to just restricting mac meta objects in dict to make sure we can "always" confiure ourselves out of unforseen limits --- ndb/src/kernel/vm/Configuration.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 931b4da5a17..25b6ed272f9 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -609,8 +609,9 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + noOfUniqueHashIndexes; - if (noOfMetaTables > MAX_TABLES) - noOfMetaTables= MAX_TABLES; + Uint32 noOfMetaTablesDict= noOfMetaTables; + if (noOfMetaTablesDict > MAX_TABLES) + noOfMetaTablesDict= MAX_TABLES; { /** @@ -619,8 +620,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ cfg.put(CFG_DICT_ATTRIBUTE, noOfAttributes); - cfg.put(CFG_DICT_TABLE, - noOfMetaTables); + cfg.put(CFG_DICT_TABLE, + noOfMetaTablesDict); } -- cgit v1.2.1 From 8621164bd1c53c7b0d629142d8f91e8c74a97bb6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 15:05:52 +0200 Subject: comment of class edded --- sql/item.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/item.h b/sql/item.h index 3ae1da23f15..7a288473533 100644 --- a/sql/item.h +++ b/sql/item.h @@ -890,6 +890,10 @@ public: }; +/* + The same as Item_ref, but get value from val_* family of method to get + value of item on which it referred instead of result* family. +*/ class Item_direct_ref :public Item_ref { public: -- cgit v1.2.1 From f61f828cc52e73608becf7b30acd83674412afef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:26:39 +0100 Subject: BackupInit.cpp: quick fix for wrong allocation of size ndb/src/kernel/blocks/backup/BackupInit.cpp: quick fix for wrong allocation of size --- ndb/src/kernel/blocks/backup/BackupInit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index f1130c3e8a7..37c579bfe84 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -44,7 +44,8 @@ Backup::Backup(const Configuration & conf) : Uint32 noBackups = 0, noTables = 0, noAttribs = 0; ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless)); ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups); - ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + // ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs)); noAttribs++; //RT 527 bug fix -- cgit v1.2.1 From 36c7c702fc7e04d66e2734c8ab2fb31d5483f9d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 15:10:54 +0100 Subject: correcting --expire_logs_days description in mysqld --help --- sql/mysqld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index da834080bc0..f349f672ba8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4758,7 +4758,8 @@ replicating a LOAD DATA INFILE command.", (gptr*) &delayed_queue_size, (gptr*) &delayed_queue_size, 0, GET_ULONG, REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1, 0}, {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, - "Binary logs will be rotated after expire-log-days days ", + "If non-zero, binary logs will be purged after expire_logs_days " + "days; possible purges happen at startup and at binary log rotation.", (gptr*) &expire_logs_days, (gptr*) &expire_logs_days, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, -- cgit v1.2.1 From 6d7fe8520a938d92a6a7b0e569e8f56d926936ac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 20:06:06 +0300 Subject: Merging fix for BUG#6976 from 4.0 to 4.1 The problem in 4.1 was the same as in 4.0 - fix_fields() not called for created Item_ref. The fix is similar too - initialize Item_refs in ctor (but don't interfere with cases when Item_ref is used by subselects). sql/item.cc: Fix for BUG#6976 ported from 4.0 sql/item_cmpfunc.cc: Fix for BUG#6976 ported from 4.0 sql/item_func.cc: Fix for BUG#6976 ported from 4.0 sql/item_row.cc: Fix for BUG#6976 ported from 4.0 sql/item_strfunc.cc: Fix for BUG#6976 ported from 4.0 --- sql/item.cc | 4 ++-- sql/item.h | 21 +++++++++++++++++++++ sql/item_cmpfunc.cc | 3 ++- sql/item_func.cc | 2 +- sql/item_row.cc | 3 ++- sql/item_strfunc.cc | 2 +- 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 31c35e87cd4..85e200920f1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1488,9 +1488,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) "forward reference in item list"); return -1; } - Item_ref *rf= new Item_ref(last->ref_pointer_array + counter, - (char *)table_name, (char *)field_name); + (char *)table_name, (char *)field_name, + this); if (!rf) return 1; thd->change_item_tree(ref, rf); diff --git a/sql/item.h b/sql/item.h index 3c4f80e3857..cf697f59727 100644 --- a/sql/item.h +++ b/sql/item.h @@ -835,6 +835,26 @@ public: :Item_ident(db_par, table_name_par, field_name_par), ref(0) {} Item_ref(Item **item, const char *table_name_par, const char *field_name_par) :Item_ident(NullS, table_name_par, field_name_par), ref(item) {} + + /* + This constructor is used when processing GROUP BY and referred Item is + available. We set all properties here because fix_fields() will not be + called for the created Item_ref. (see BUG#6976) + TODO check if we could get rid of *_name_par parameters and if we need to + perform similar initialization for other ctors. + TODO we probably fix a superset of problems like in BUG#6658. Check this + with Bar, and if we have a more broader set of problems like this. + */ + Item_ref(Item **item, const char *table_name_par, + const char *field_name_par, Item *src) + : Item_ident(NullS, table_name_par, field_name_par), ref(item) + { + collation.set(src->collation); + max_length= src->max_length; + decimals= src->decimals; + with_sum_func= src->with_sum_func; + maybe_null= src->maybe_null; + } /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), ref(item->ref) {} enum Type type() const { return REF_ITEM; } @@ -890,6 +910,7 @@ public: }; class Item_in_subselect; + class Item_ref_null_helper: public Item_ref { protected: diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 51212418b09..b225889d916 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2022,7 +2022,8 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **ref= li.ref(); uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, + item); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(ref, new_item); diff --git a/sql/item_func.cc b/sql/item_func.cc index 98b204d1809..af53a771720 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -349,7 +349,7 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, item); new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; diff --git a/sql/item_row.cc b/sql/item_row.cc index 289efe45300..b65b0b7b608 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -95,7 +95,8 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name, + *arg); fields.push_front(*arg); ref_pointer_array[el]= *arg; thd->change_item_tree(arg, new_item); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index aaeeb9d8bb8..82cbd1fed72 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1748,7 +1748,7 @@ void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name,item); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(&item, new_item); -- cgit v1.2.1 From 06cbb73f26c7eba54ef4a435b27bce5c4d2a6cdf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 20:25:26 +0300 Subject: Merged fixes for BUG#6976 and BUG#7079 --- sql/item.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/item.h b/sql/item.h index 119fad83746..52a644677a6 100644 --- a/sql/item.h +++ b/sql/item.h @@ -922,6 +922,10 @@ public: :Item_ref(item, table_name_par, field_name_par) {} /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + Item_direct_ref(Item **item, const char *table_name_par, + const char *field_name_par, Item *src) + : Item_ref(item, table_name_par, field_name_par, src) {} + double val() { double tmp=(*ref)->val(); -- cgit v1.2.1 From 6dad55159110c113df366e3b1dd377f30ae91efe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:48:37 -0600 Subject: Makefile.am: Add running of test suite with --ps-protocol to 'test' target Makefile.am: Add running of test suite with --ps-protocol to 'test' target --- Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 0770854f176..6d089cee698 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,5 +100,8 @@ tags: # Test installation test: - cd mysql-test ; ./mysql-test-run + cd mysql-test + ./mysql-test-run + ./mysql-test-run --ps-protocol + -- cgit v1.2.1 From bd8f96f759a1b633de5d6359c824277663ebd3f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 21:00:43 +0100 Subject: Small bug fix ps-modify1 used the user variables @1, @2, @100 set within ps_query and ps_modify. That architecture was wrong, because the dependence of ps_modify1 on ps_query and ps_modify makes the test script maintenance and the use of these test cases during bug fixing/ debugging of single sub test cases very uncomfortable. Therefore these user variables (@1, @2, @100) are also set within ps-modify1. The result files of the test cases ps_2myisam, ps_3innodb, ps_4heap, ps_6bdb, ps_7ndb will be affected by that change and show 3 additional lines, but nothing else will change. mysql-test/include/ps_modify1.inc: Initialization of three user variables, with values derived from ps_query and ps_modify mysql-test/r/ps_2myisam.result: updated result set mysql-test/r/ps_3innodb.result: updated result set mysql-test/r/ps_4heap.result: updated result sset mysql-test/r/ps_6bdb.result: updated result set mysql-test/r/ps_7ndb.result: updated result set --- mysql-test/include/ps_modify1.inc | 3 +++ mysql-test/r/ps_2myisam.result | 3 +++ mysql-test/r/ps_3innodb.result | 3 +++ mysql-test/r/ps_4heap.result | 3 +++ mysql-test/r/ps_6bdb.result | 3 +++ mysql-test/r/ps_7ndb.result | 3 +++ 6 files changed, 18 insertions(+) diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index 5fba7faa59a..345654b2d66 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -65,6 +65,9 @@ execute stmt1 using @1000, @duplicate, @5; select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; --disable_warnings diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 24c1102306f..c2799c6faed 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1688,6 +1688,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index ad2912529a5..034cd75ea4b 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 123e3d58b38..60a9ddd2bf2 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1672,6 +1672,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5f2419bdda5..baf273c84c0 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 41c55cac0ca..3dbe3ed6218 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; -- cgit v1.2.1 From 844c6e3495712e30a21090d481428f82ff39e51a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:03:19 -0600 Subject: Makefile.am: s/spaces/TAB/ Makefile.am: s/spaces/TAB/ --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6d089cee698..b00b3747294 100644 --- a/Makefile.am +++ b/Makefile.am @@ -101,7 +101,7 @@ tags: test: cd mysql-test - ./mysql-test-run - ./mysql-test-run --ps-protocol + ./mysql-test-run + ./mysql-test-run --ps-protocol -- cgit v1.2.1 From 01e2c3f0994731ff552f93d36e6928cdcbf10148 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 21:43:30 +0100 Subject: - a fix for the fix - now "make test" will run the test suite with and without the PS protocol --- Makefile.am | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index b00b3747294..c1ae9217e8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,8 +100,4 @@ tags: # Test installation test: - cd mysql-test - ./mysql-test-run - ./mysql-test-run --ps-protocol - - + cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol -- cgit v1.2.1 From 0e4868529124dd1048acf1cbf2b10edee0614fb3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 01:07:06 +0300 Subject: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Item_ref::Item_ref now expects to get in *item either NULL - then fix_fields() will be called later or ptr to Item it will refer to - then an equivalent of fix_fields() call is performed sql/item.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item.h: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Item_ref::Item_ref now expects to get in *item either NULL - then fix_fields() will be called later or ptr to Item it will refer to - then an equivalent of fix_fields() call is performed sql/item_cmpfunc.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_func.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_row.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_strfunc.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention --- sql/item.cc | 27 ++++++++++++++++++++------- sql/item.h | 41 ++++++++++++++++++++++------------------- sql/item_cmpfunc.cc | 4 ++-- sql/item_func.cc | 3 ++- sql/item_row.cc | 4 ++-- sql/item_strfunc.cc | 3 ++- 6 files changed, 50 insertions(+), 32 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index ec637eb8bce..aa67219ab53 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1488,16 +1488,24 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) "forward reference in item list"); return -1; } + /* + Here, a subset of actions performed by Item_ref::set_properties + is not enough. So we pass ptr to NULL into Item_[direct]_ref ctor, + so no initialization is performed, and call fix_fields() below. + */ + Item *save= last->ref_pointer_array[counter]; + last->ref_pointer_array[counter]= NULL; Item_ref *rf= (place == IN_HAVING ? new Item_ref(last->ref_pointer_array + counter, (char *)table_name, - (char *)field_name, this) : + (char *)field_name) : new Item_direct_ref(last->ref_pointer_array + counter, (char *)table_name, - (char *)field_name, this)); + (char *)field_name)); if (!rf) return 1; thd->change_item_tree(ref, rf); + last->ref_pointer_array[counter]= save; /* rf is Item_ref => never substitute other items (in this case) during fix_fields() => we can use rf after fix_fields() @@ -2220,19 +2228,24 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) "forward reference in item list")); return 1; } + + set_properties(); + + if (ref && (*ref)->check_cols(1)) + return 1; + return 0; +} + +void Item_ref::set_properties() +{ max_length= (*ref)->max_length; maybe_null= (*ref)->maybe_null; decimals= (*ref)->decimals; collation.set((*ref)->collation); with_sum_func= (*ref)->with_sum_func; fixed= 1; - - if (ref && (*ref)->check_cols(1)) - return 1; - return 0; } - void Item_ref::print(String *str) { if (ref && *ref) diff --git a/sql/item.h b/sql/item.h index 52a644677a6..2411904a00f 100644 --- a/sql/item.h +++ b/sql/item.h @@ -827,34 +827,35 @@ public: class Item_ref :public Item_ident { +protected: + void set_properties(); public: Field *result_field; /* Save result here */ Item **ref; Item_ref(const char *db_par, const char *table_name_par, const char *field_name_par) :Item_ident(db_par, table_name_par, field_name_par), ref(0) {} - Item_ref(Item **item, const char *table_name_par, const char *field_name_par) - :Item_ident(NullS, table_name_par, field_name_par), ref(item) {} - /* - This constructor is used when processing GROUP BY and referred Item is - available. We set all properties here because fix_fields() will not be - called for the created Item_ref. (see BUG#6976) - TODO check if we could get rid of *_name_par parameters and if we need to - perform similar initialization for other ctors. + This constructor is used in two scenarios: + A) *item = NULL + No initialization is performed, fix_fields() call will be necessary. + + B) *item points to an Item this Item_ref will refer to. This is + used for GROUP BY. fix_fields() will not be called in this case, + so we call set_properties to make this item "fixed". set_properties + performs a subset of action Item_ref::fix_fields does, and this subset + is enough for Item_ref's used in GROUP BY. + TODO we probably fix a superset of problems like in BUG#6658. Check this with Bar, and if we have a more broader set of problems like this. */ - Item_ref(Item **item, const char *table_name_par, - const char *field_name_par, Item *src) - : Item_ident(NullS, table_name_par, field_name_par), ref(item) + Item_ref(Item **item, const char *table_name_par, const char *field_name_par) + :Item_ident(NullS, table_name_par, field_name_par), ref(item) { - collation.set(src->collation); - max_length= src->max_length; - decimals= src->decimals; - with_sum_func= src->with_sum_func; - maybe_null= src->maybe_null; + if (*item) + set_properties(); } + /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), ref(item->ref) {} enum Type type() const { return REF_ITEM; } @@ -862,29 +863,34 @@ public: { return ref && (*ref)->eq(item, binary_cmp); } double val() { + DBUG_ASSERT(fixed); double tmp=(*ref)->val_result(); null_value=(*ref)->null_value; return tmp; } longlong val_int() { + DBUG_ASSERT(fixed); longlong tmp=(*ref)->val_int_result(); null_value=(*ref)->null_value; return tmp; } String *val_str(String* tmp) { + DBUG_ASSERT(fixed); tmp=(*ref)->str_result(tmp); null_value=(*ref)->null_value; return tmp; } bool is_null() { + DBUG_ASSERT(fixed); (void) (*ref)->val_int_result(); return (*ref)->null_value; } bool get_date(TIME *ltime,uint fuzzydate) { + DBUG_ASSERT(fixed); return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } bool send(Protocol *prot, String *tmp){ return (*ref)->send(prot, tmp); } @@ -922,9 +928,6 @@ public: :Item_ref(item, table_name_par, field_name_par) {} /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} - Item_direct_ref(Item **item, const char *table_name_par, - const char *field_name_par, Item *src) - : Item_ref(item, table_name_par, field_name_par, src) {} double val() { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 0b824178afd..26ed8f4e9c1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2022,8 +2022,8 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **ref= li.ref(); uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, - item); + ref_pointer_array[el]= item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(ref, new_item); diff --git a/sql/item_func.cc b/sql/item_func.cc index af53a771720..8220db40ecb 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -349,7 +349,8 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, item); + ref_pointer_array[el]= item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; diff --git a/sql/item_row.cc b/sql/item_row.cc index b65b0b7b608..4e4957b980e 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -95,8 +95,8 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name, - *arg); + ref_pointer_array[el]=*arg; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); fields.push_front(*arg); ref_pointer_array[el]= *arg; thd->change_item_tree(arg, new_item); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 82cbd1fed72..e1b063cd5e0 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1748,7 +1748,8 @@ void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name,item); + ref_pointer_array[el]=item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(&item, new_item); -- cgit v1.2.1 From 8322eb0aaaf410819da5eaa95ecd5e3b6ce3c2b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 03:36:19 +0300 Subject: * Added comments and one assert * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.cc: * More comments * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.h: Assert added sql/item_cmpfunc.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_func.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_strfunc.h: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_subselect.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_sum.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/set_var.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_base.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_handler.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_help.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_select.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() --- sql/item.cc | 9 +++++---- sql/item.h | 1 + sql/item_cmpfunc.cc | 6 ++++-- sql/item_func.cc | 4 ++-- sql/item_strfunc.h | 3 ++- sql/item_subselect.cc | 3 ++- sql/item_sum.cc | 4 +++- sql/set_var.cc | 6 ++++-- sql/sql_base.cc | 6 ++++-- sql/sql_handler.cc | 6 ++++-- sql/sql_help.cc | 3 ++- sql/sql_select.cc | 3 ++- 12 files changed, 35 insertions(+), 19 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index aa67219ab53..92a15694e89 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1490,8 +1490,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } /* Here, a subset of actions performed by Item_ref::set_properties - is not enough. So we pass ptr to NULL into Item_[direct]_ref ctor, - so no initialization is performed, and call fix_fields() below. + is not enough. So we pass ptr to NULL into Item_[direct]_ref + constructor, so no initialization is performed, and call + fix_fields() below. */ Item *save= last->ref_pointer_array[counter]; last->ref_pointer_array[counter]= NULL; @@ -2291,7 +2292,7 @@ bool Item_default_value::fix_fields(THD *thd, fixed= 1; return 0; } - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) @@ -2338,7 +2339,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) { DBUG_ASSERT(fixed == 0); - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) diff --git a/sql/item.h b/sql/item.h index 2411904a00f..71b92cd1efc 100644 --- a/sql/item.h +++ b/sql/item.h @@ -852,6 +852,7 @@ public: Item_ref(Item **item, const char *table_name_par, const char *field_name_par) :Item_ident(NullS, table_name_par, field_name_par), ref(item) { + DBUG_ASSERT(item); if (*item) set_properties(); } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 26ed8f4e9c1..a135f08ae45 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2374,8 +2374,10 @@ bool Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { DBUG_ASSERT(fixed == 0); - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1) || - args[1]->fix_fields(thd,tables, args + 1) || args[1]->check_cols(1)) + if ((!args[0]->fixed && + args[0]->fix_fields(thd, tables, args)) || args[0]->check_cols(1) || + (!args[1]->fixed && + args[1]->fix_fields(thd,tables, args + 1)) || args[1]->check_cols(1)) return 1; /* purecov: inspected */ with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func; max_length= 1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 8220db40ecb..2d939f47716 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -351,7 +351,6 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, uint el= fields.elements; ref_pointer_array[el]= item; Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(arg, new_item); @@ -1664,7 +1663,8 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func, arg != arg_end ; arg++,i++) { - if ((*arg)->fix_fields(thd, tables, arg)) + if (!(*arg)->fixed && + (*arg)->fix_fields(thd, tables, arg)) DBUG_RETURN(1); // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 8efe60bbd89..698536a61c7 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -397,7 +397,8 @@ public: bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) { DBUG_ASSERT(fixed == 0); - return (item->fix_fields(thd, tlist, &item) || + return (!item->fixed && + item->fix_fields(thd, tlist, &item) || item->check_cols(1) || Item_func::fix_fields(thd, tlist, ref)); } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index ffa3b072801..1d0f46fd196 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -766,7 +766,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; thd->lex->current_select= up= current->return_after_parsing(); - if (left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) + if (!left_expr->fixed && + left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) { thd->lex->current_select= current; goto err; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 66d4fba205c..029a1fd6c48 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1918,7 +1918,9 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) for (i=0 ; i < arg_count ; i++) { - if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1)) + if ((!args[i]->fixed && + args[i]->fix_fields(thd, tables, args + i)) || + args[i]->check_cols(1)) return 1; if (i < arg_count_field) maybe_null|= args[i]->maybe_null; diff --git a/sql/set_var.cc b/sql/set_var.cc index b7f410c207d..d10ea3e11c1 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2799,7 +2799,8 @@ int set_var::check(THD *thd) return 0; } - if (value->fix_fields(thd, 0, &value) || value->check_cols(1)) + if ((!value->fixed && + value->fix_fields(thd, 0, &value)) || value->check_cols(1)) return -1; if (var->check_update_type(value->result_type())) { @@ -2834,7 +2835,8 @@ int set_var::light_check(THD *thd) if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)) return 1; - if (value && (value->fix_fields(thd, 0, &value) || value->check_cols(1))) + if (value && ((!value->fixed && value->fix_fields(thd, 0, &value)) || + value->check_cols(1))) return -1; return 0; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 05b11646cd7..5c71049e565 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2684,7 +2684,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) thd->restore_backup_item_arena(arena, &backup); if (*conds && !(*conds)->fixed) { - if ((*conds)->fix_fields(thd, tables, conds)) + if (!(*conds)->fixed && + (*conds)->fix_fields(thd, tables, conds)) DBUG_RETURN(1); } } @@ -2696,7 +2697,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) thd->restore_backup_item_arena(arena, &backup); if (table->on_expr && !table->on_expr->fixed) { - if (table->on_expr->fix_fields(thd, tables, &table->on_expr)) + if (!table->on_expr->fixed && + table->on_expr->fix_fields(thd, tables, &table->on_expr)) DBUG_RETURN(1); } } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index f98bb0a9131..f250a00eca1 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -429,7 +429,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, } tables->table=table; - if (cond && (cond->fix_fields(thd, tables, &cond) || cond->check_cols(1))) + if (cond && ((!cond->fixed && + cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1))) goto err0; table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it @@ -516,7 +517,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, for (key_len=0 ; (item=it_ke++) ; key_part++) { // 'item' can be changed by fix_fields() call - if (item->fix_fields(thd, tables, it_ke.ref()) || + if ((!item->fixed && + item->fix_fields(thd, tables, it_ke.ref())) || (item= *it_ke.ref())->check_cols(1)) goto err; if (item->used_tables() & ~RAND_TABLE_BIT) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 04ecbbd43b9..0e0d32a922d 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -557,7 +557,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, TABLE *table, int *error) { - cond->fix_fields(thd, tables, &cond); // can never fail + if (!cond->fixed) + cond->fix_fields(thd, tables, &cond); // can never fail SQL_SELECT *res= make_select(table,0,0,cond,error); if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR))) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f2499966815..2d701e668cf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8904,7 +8904,8 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab) if (thd->is_fatal_error) DBUG_RETURN(TRUE); - cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); + if (!cond->fixed) + cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); if (join_tab->select) { error=(int) cond->add(join_tab->select->cond); -- cgit v1.2.1 From 7e7a2b32e8a9c3e784e6e3f3a6927635cd4ec9a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:10:22 +0100 Subject: ndb - shm transporter benchmark result ndb/docs/wl2077.txt: Add result from micro benchmark with shm-transporter ndb/include/transporter/TransporterRegistry.hpp: Move pid into transporter registry ndb/src/common/transporter/SHM_Transporter.cpp: Move pid into transporter registry ndb/src/common/transporter/TransporterRegistry.cpp: Move pid into transporter registry ndb/src/kernel/main.cpp: Move pid into transporter registry ndb/src/ndbapi/TransporterFacade.cpp: Move pid into transporter registry --- ndb/docs/wl2077.txt | 37 +++++++++++++++------- ndb/include/transporter/TransporterRegistry.hpp | 2 ++ ndb/src/common/transporter/SHM_Transporter.cpp | 6 ++-- ndb/src/common/transporter/TransporterRegistry.cpp | 6 ++-- ndb/src/kernel/main.cpp | 3 -- ndb/src/ndbapi/TransporterFacade.cpp | 4 --- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ndb/docs/wl2077.txt b/ndb/docs/wl2077.txt index 5a77c18aa2a..f5b10bb702e 100644 --- a/ndb/docs/wl2077.txt +++ b/ndb/docs/wl2077.txt @@ -3,18 +3,24 @@ 1 host, 1 ndbd, api co-hosted results in 1000 rows / sec - wo/reset bounds w/ rb -4.1-read committed a) 4.9 b) 7.4 -4.1-read hold lock c) 4.7 d) 6.7 - -wl2077-read committed 6.4 (+30%) 10.8 (+45%) -wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) - --- Comparision e) -serial pk: 10.9' -batched (1000): 59' -serial uniq index: 8.4' -batched (1000): 33' + wo/reset bounds w/ rb +4.1-read committed a) 4.9 b) 7.4 +4.1-read hold lock c) 4.7 d) 6.7 + +wl2077-read committed 6.4 (+30%) 10.8 (+45%) +wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) + +5.0-ndb batch read committed f) 50' (+680%) g) 50' (+360%) +5.0-ndb batch read hold lock h) 12' (+160%) i) 13' (+79%) + +shm-mem read committed (cmp. wl2077) a) 9.5' (+48%) b) 14' (+30%) + read hold lock c) 6.7' (+45%) d) 9.8' (+46%) + +-- Comparision e) shm +serial pk: 10.9' 20' (+83%) +batched (1000): 59' 62' (+5%) +serial uniq index: 8.4' 14' (+66%) +batched (1000): 33' 36' (+9%) index range (1000): 186' ---- @@ -25,6 +31,8 @@ b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 e) testReadPerf -i 25 -c 0 -d 0 T1 +f) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 0 -m 1000 -i 10 T1 +g) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 1 -m 1000 -i 10 T1 --- music join 1db-co 2db-co @@ -33,3 +41,8 @@ e) testReadPerf -i 25 -c 0 -d 0 T1 wl2077 12s 14s wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%) + +pekka-blob-fix 1.3s + +shm 1.2s 2.0s +shm wo/ blobs 1.1s 2.0s diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index ac6291f9e57..4ca288d0a0a 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -312,6 +312,8 @@ private: Uint32 poll_TCP(Uint32 timeOutMillis); Uint32 poll_SCI(Uint32 timeOutMillis); Uint32 poll_SHM(Uint32 timeOutMillis); + + int m_shm_own_pid; }; #endif // Define of TransporterRegistry_H diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 7c2c2aafb85..e4051519b86 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -214,7 +214,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to client - s_output.println("shm server 1 ok: %d", g_shm_pid); + s_output.println("shm server 1 ok: %d", + m_transporter_registry.m_shm_own_pid); // Wait for ok from client if (s_input.gets(buf, 256) == 0) @@ -293,7 +294,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to server - s_output.println("shm client 1 ok: %d", g_shm_pid); + s_output.println("shm client 1 ok: %d", + m_transporter_registry.m_shm_own_pid); int r= connect_common(sockfd); diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 61924fe55b2..77e72a4fa2c 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1273,10 +1273,8 @@ TransporterRegistry::startReceiving() #endif #ifdef NDB_SHM_TRANSPORTER - if(nSHMTransporters) - { - signal(SIGUSR1, shm_sig_handler); - } + m_shm_own_pid = getpid(); + signal(SIGUSR1, shm_sig_handler); #endif } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 7d6b597e6dd..926647838c9 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -49,8 +49,6 @@ void catchsigs(bool ignore); // for process signal handling extern "C" void handler_shutdown(int signum); // for process signal handling extern "C" void handler_error(int signum); // for process signal handling -extern int g_shm_pid; - // Shows system information void systemInfo(const Configuration & conf, const LogLevel & ll); @@ -147,7 +145,6 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); - g_shm_pid = getpid(); theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index f6a7496decc..dfb090c8416 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -450,12 +450,8 @@ runReceiveResponse_C(void * me) return me; } -extern int g_shm_pid; - void TransporterFacade::threadMainReceive(void) { - g_shm_pid = getpid(); - theTransporterRegistry->startReceiving(); NdbMutex_Lock(theMutexPtr); theTransporterRegistry->update_connections(); -- cgit v1.2.1 From ebee4cfad31de754185483811219135b5ef7c68a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:26:53 +0100 Subject: ndb - fix protection wrt shm ndb/include/transporter/TransporterRegistry.hpp: fix protection --- ndb/include/transporter/TransporterRegistry.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index 4ca288d0a0a..4946222d23e 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -87,6 +87,7 @@ public: */ class TransporterRegistry { friend class OSE_Receiver; + friend class SHM_Transporter; friend class Transporter; friend class TransporterService; public: @@ -312,7 +313,7 @@ private: Uint32 poll_TCP(Uint32 timeOutMillis); Uint32 poll_SCI(Uint32 timeOutMillis); Uint32 poll_SHM(Uint32 timeOutMillis); - + int m_shm_own_pid; }; -- cgit v1.2.1 From 00d9273aa59d5ec424daf7c3b76224ce55d61d62 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 11:35:23 +0400 Subject: Portability fix (bug #7203: "delayed" test fails on QNX when using prepared statements) mysql-test/t/delayed.test: Portability fix (bug #7203: "delayed" test fails on QNX when using prepared statements) 1 is not enough delay for QNX. --- mysql-test/t/delayed.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 4cf26b330c6..40bd7a912f3 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -14,7 +14,7 @@ insert delayed into t1 set a = 4; insert delayed into t1 set a = 5, tmsp = 19711006010203; insert delayed into t1 (a, tmsp) values (6, 19711006010203); insert delayed into t1 (a, tmsp) values (7, NULL); ---sleep 1 +--sleep 2 insert into t1 set a = 8,tmsp=19711006010203; select * from t1 where tmsp=0; select * from t1 where tmsp=19711006010203; -- cgit v1.2.1 From 379fe351ee5583b88d7682e97f1aa60a6bbb7642 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 10:57:30 +0300 Subject: Test for BUG#7242: Testing prepare + several times execute (here in client_test.c because we need to check if several PS execution works and the bug shows up with binary protocol only ) tests/client_test.c: Test for BUG#7242: Testing prepare + several times execute --- tests/client_test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/client_test.c b/tests/client_test.c index 75ce242900a..b0bf40799da 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1026,6 +1026,56 @@ static void test_tran_innodb() } +/* Test for BUG#7242 */ + +static void test_prepare_insert_update() +{ + MYSQL_STMT *stmt; + int rc; + int i; + const char *testcase[]= { + "CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B))", + "INSERT t1 VALUES (1,2,10), (3,4,20)", + "INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100", + "SELECT * FROM t1", + "INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0", + "SELECT * FROM t1", + "INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a)", + NULL}; + const char **cur_query; + + myheader("test_prepare_insert_update"); + + for (cur_query= testcase; *cur_query; cur_query++) + { + printf("\nRunning query: %s", *cur_query); + strmov(query, *cur_query); + stmt= mysql_simple_prepare(mysql, query); + check_stmt(stmt); + + verify_param_count(stmt, 0); + rc= mysql_stmt_execute(stmt); + + check_execute(stmt, rc); + /* try the last query several times */ + if (!cur_query[1]) + { + for (i=0; i < 3;i++) + { + printf("\nExecuting last statement again"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + } + } + mysql_stmt_close(stmt); + } + + rc= mysql_commit(mysql); + myquery(rc); +} + /* Test simple prepares of all DML statements */ static void test_prepare_simple() @@ -11513,6 +11563,7 @@ and you are welcome to modify and redistribute it under the GPL license\n"); static struct my_tests_st my_tests[]= { { "client_query", client_query }, + { "test_prepare_insert_update", test_prepare_insert_update}, #if NOT_YET_WORKING { "test_drop_temp", test_drop_temp }, #endif -- cgit v1.2.1 From 63b36352d8af260af499596f1188f1f56c62b73f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:57:50 +0100 Subject: ndb - Handle connections without corresponding node ndb/src/mgmsrv/ConfigInfo.cpp: Handle connections without corresponding node --- ndb/src/mgmsrv/ConfigInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 35229d1f666..7417bef5619 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2973,7 +2973,13 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){ require(ctx.m_currentSection->get(buf, &id)); const Properties * node; - require(ctx.m_config->get("Node", id, &node)); + if(!ctx.m_config->get("Node", id, &node)) + { + ctx.reportError("Unknown node: \"%d\" specified in connection " + "[%s] starting at line: %d", + id, ctx.fname, ctx.m_sectionLineno); + return false; + } const char * hostname; require(node->get("HostName", &hostname)); -- cgit v1.2.1 From 17d1552bbb555f5fe52c39bd4ffee99ad6d823c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:12:04 +0000 Subject: Bug#7242 The "insert_update" causes a server crash when using prepared statements Must clear table->insert_values after completing every prepared statement --- sql/sql_prepare.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index f4a96d751cd..6d2ddf03b50 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1514,6 +1514,27 @@ static bool init_param_array(Prepared_statement *stmt) } +/* Init statement before execution */ + +static void cleanup_stmt_for_execute(Prepared_statement *stmt) +{ + THD *thd= stmt->thd; + LEX *lex= stmt->lex; + SELECT_LEX *sl= lex->all_selects_list; + + for (; sl; sl= sl->next_select_in_list()) + { + for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first; + tables; + tables= tables->next) + { + if (tables->table) + tables->table->insert_values= 0; + } + } +} + + /* Given a query string with parameter markers, create a Prepared Statement from it and send PS info back to the client. @@ -1614,6 +1635,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (!error) error= send_prepare_results(stmt, test(name)); + cleanup_stmt_for_execute(stmt); /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */ if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -1904,6 +1926,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, reset_stmt_params(stmt); close_thread_tables(thd); // to close derived tables thd->set_statement(&thd->stmt_backup); + cleanup_stmt_for_execute(stmt); DBUG_VOID_RETURN; } -- cgit v1.2.1 From 16de85317eb31b928b7b9b8c43eeffc3609443c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 10:23:35 +0100 Subject: mysql-test-run.sh: removed diskless option for ndb test mysql-test/mysql-test-run.sh: removed diskless option for ndb test --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5a7ede0cba8..426b8b486be 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -947,7 +947,7 @@ start_ndbcluster() else NDBCLUSTER_EXTRA_OPTS="--small" fi - ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1 + ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || exit 1 NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" -- cgit v1.2.1 From 54745a18a19c9deeda279e22bf05b4741dcaa1ce Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 15:41:01 +0400 Subject: A quick fix for bug #7257: Crash in default tests: 'subselect' sql/item.h: A quick fix for bug #7257: Crash in default tests: 'subselect' We have to pass &item instead of &store to the Item_ref_null_helper() then set ref. --- sql/item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item.h b/sql/item.h index 71b92cd1efc..fb649547fa2 100644 --- a/sql/item.h +++ b/sql/item.h @@ -983,9 +983,9 @@ class Item_null_helper :public Item_ref_null_helper public: Item_null_helper(Item_in_subselect* master, Item *item, const char *table_name_par, const char *field_name_par) - :Item_ref_null_helper(master, &store, table_name_par, field_name_par), + :Item_ref_null_helper(master, &item, table_name_par, field_name_par), store(item) - {} + { ref= &store; } void print(String *str); }; -- cgit v1.2.1 From cef35aeb1c338743d5bfa4cae46e63486aa2c7c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 15:58:30 +0400 Subject: bug#6275 "client_test" fail in 4.1.7 make test bug#6911 resultset metadata always return client character set --- mysql-test/r/type_enum.result | 6 +++--- sql/item.h | 2 +- sql/protocol.cc | 12 ++++++++++-- tests/client_test.c | 29 ++++++++++++++++++----------- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index e5239dcf769..14d3443bda9 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1731,9 +1731,9 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; select * from t1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 a a 254 3 1 Y 384 0 8 -def test t1 t1 b b 254 9 0 Y 2176 0 8 -def test t1 t1 c c 254 3 0 Y 384 0 8 +def test t1 t1 a a 254 1 1 Y 384 0 8 +def test t1 t1 b b 254 3 0 Y 2176 0 8 +def test t1 t1 c c 254 1 0 Y 384 0 8 a b c Y NULL NULL drop table t1; diff --git a/sql/item.h b/sql/item.h index 71b92cd1efc..1024251793e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -765,7 +765,7 @@ class Item_empty_string :public Item_string public: Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_string("",0, cs ? cs : &my_charset_bin) - { name=(char*) header; max_length=length;} + { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } void make_field(Send_field *field); }; diff --git a/sql/protocol.cc b/sql/protocol.cc index eaa0fd55b25..95cd8415c85 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -549,10 +549,18 @@ bool Protocol::send_fields(List *list, uint flag) pos= (char*) local_packet->ptr()+local_packet->length(); *pos++= 12; // Length of packed fields if (item->collation.collation == &my_charset_bin || thd_charset == NULL) + { + /* No conversion */ int2store(pos, field.charsetnr); + int4store(pos+2, field.length); + } else - int2store(pos, thd_charset->number); - int4store(pos+2, field.length); + { + /* With conversion */ + int2store(pos, thd_charset->number); + uint char_len= field.length / item->collation.collation->mbmaxlen; + int4store(pos+2, char_len * thd_charset->mbmaxlen); + } pos[6]= field.type; int2store(pos+7,field.flags); pos[9]= (char) field.decimals; diff --git a/tests/client_test.c b/tests/client_test.c index b0bf40799da..b78339cc9bb 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1101,7 +1101,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* update */ - strmov(query, "UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?"); + strmov(query, "UPDATE test_prepare_simple SET id=? " + "WHERE id=? AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1129,7 +1130,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* select */ - strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? AND name= ?"); + strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? " + "AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1158,7 +1160,7 @@ static void test_prepare_field_result() rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, " "var_c varchar(50), ts_c timestamp(14), " - "char_c char(3), date_c date, extra tinyint)"); + "char_c char(4), date_c date, extra tinyint)"); myquery(rc); /* insert */ @@ -1184,8 +1186,8 @@ static void test_prepare_field_result() "t1", "test_prepare_field_result", current_db, 10, 0); verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP, "t1", "test_prepare_field_result", current_db, 19, 0); - verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_STRING, - "t1", "test_prepare_field_result", current_db, 3, 0); + verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_VAR_STRING, + "t1", "test_prepare_field_result", current_db, 4, 0); verify_field_count(result, 5); mysql_free_result(result); @@ -1921,7 +1923,8 @@ static void test_select() rc= mysql_commit(mysql); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE id= ? AND name=?"); + strmov(query, "SELECT * FROM test_select WHERE id= ? " + "AND CONVERT(name USING utf8) =?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1981,7 +1984,8 @@ static void test_ps_conj_select() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); - strmov(query, "select id1, value1 from t1 where id1= ? or value1= ?"); + strmov(query, "select id1, value1 from t1 where id1= ? or " + "CONVERT(value1 USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \ "(\"abx\", 1, 2, 3, 2003-08-30)"); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE session_id= ?"); + strmov(query, "SELECT * FROM test_select WHERE " + "CONVERT(session_id USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2898,7 +2903,8 @@ static void test_simple_delete() myquery(rc); /* insert by prepare */ - strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100"); + strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND " + "CONVERT(col2 USING utf8)= ? AND col3= 100"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -4866,7 +4872,8 @@ static void test_multi_stmt() /* alter the table schema now */ stmt1= mysql_simple_prepare(mysql, "DELETE FROM test_multi_table " - "WHERE id= ? AND name=?"); + "WHERE id= ? AND " + "CONVERT(name USING utf8)=?"); check_stmt(stmt1); verify_param_count(stmt1, 2); @@ -6632,7 +6639,7 @@ static void test_field_misc() "@@table_type", "", /* field and its org name */ MYSQL_TYPE_STRING, /* field type */ "", "", /* table and its org name */ - "", type_length*3, 0); /* db name, length */ + "", type_length, 0); /* db name, length */ mysql_free_result(result); mysql_stmt_close(stmt); -- cgit v1.2.1 From 820d68d9033ed566177a4ff9c2c4c1e98b0deb6e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 18:46:55 +0500 Subject: corrected mysqltest.dsp corrected mysql_test_run_new.dsp added dependency corrected path of mysql_test_run_new.dsp fixed wrong code added my_create_tables.c removed command_line fixed #elif restored NAME_MAX and MAX_FNAME added create_system_files() added compare() for windows added all files of testes in script added mysql-test in script BitKeeper/etc/ignore: Added mysql-4.1.8-win-src.zip to the ignore list VC++Files/client/mysqltest.dsp: corrected dsp file VC++Files/mysql-test/mysql_test_run_new.dsp: corrected mysql_test_run_new.dsp VC++Files/mysql.dsw: added dependency corrected path of mysql_test_run_new.dsp client/mysqltest.c: fixed wrong code mysql-test/Makefile.am: added my_create_tables.c mysql-test/my_manage.c: removed command_line fixed #elif mysql-test/my_manage.h: restored NAME_MAX and MAX_FNAME mysql-test/mysql_test_run_new.c: added create_system_files() added compare for windows scripts/make_win_src_distribution.sh: added all files of testes added mysql-test --- .bzrignore | 1 + VC++Files/client/mysqltest.dsp | 16 +- VC++Files/mysql-test/mysql_test_run_new.dsp | 54 +-- VC++Files/mysql.dsw | 17 +- client/mysqltest.c | 5 +- mysql-test/Makefile.am | 2 +- mysql-test/my_create_tables.c | 646 ++++++++++++++++++++++++++++ mysql-test/my_manage.c | 3 +- mysql-test/my_manage.h | 4 + mysql-test/mysql_test_run_new.c | 16 +- scripts/make_win_src_distribution.sh | 7 +- 11 files changed, 726 insertions(+), 45 deletions(-) create mode 100644 mysql-test/my_create_tables.c diff --git a/.bzrignore b/.bzrignore index dee0812c9b0..37f82b008f8 100644 --- a/.bzrignore +++ b/.bzrignore @@ -945,3 +945,4 @@ libmysqld/ha_example.cc libmysqld/ha_tina.cc analyse.test client/mysqladmin.c +mysql-4.1.8-win-src.zip diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index badd61a70b9..1f1613026a9 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -42,8 +42,8 @@ RSC=rc.exe # PROP Output_Dir ".\debug" # PROP Intermediate_Dir ".\debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX # ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "_DEBUG" @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 classic" @@ -77,8 +77,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 Release" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index bbdabb98a37..7e43da20b26 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -2,7 +2,7 @@ # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** -# TARGTYPE "Win32 (x86) Application" 0x0101 +# TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=mysql_test_run_new - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, @@ -17,8 +17,8 @@ CFG=mysql_test_run_new - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -33,51 +33,51 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" +# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD BASE MTL /nologo /win32 -# ADD MTL /nologo /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console !ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX -# ADD BASE MTL /nologo /win32 -# ADD MTL /nologo /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows !ENDIF @@ -87,19 +87,19 @@ LINK32=link.exe # Name "mysql_test_run_new - Win32 Release" # Begin Source File -SOURCE=my_create_tables.c +SOURCE=.\my_create_tables.c # End Source File # Begin Source File -SOURCE=my_manage.c +SOURCE=.\my_manage.c # End Source File # Begin Source File -SOURCE=my_manage.h +SOURCE=.\my_manage.h # End Source File # Begin Source File -SOURCE=mysql_test_run_new.c +SOURCE=.\mysql_test_run_new.c # End Source File # End Target # End Project diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 222b09c3d80..0ce2acfed23 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -824,11 +824,20 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name libmysql + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysys + End Project Dependency + Begin Project Dependency + Project_Dep_Name regex + End Project Dependency }}} ############################################################################### -Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4> +Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> Package=<5> {{{ @@ -836,6 +845,12 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name mysqltest + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysqladmin + End Project Dependency }}} ############################################################################### diff --git a/client/mysqltest.c b/client/mysqltest.c index dfaf48dd60e..18d5660d1a7 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -227,7 +227,7 @@ typedef struct int alloced; } VAR; -#ifdef __NETWARE__ +#if defined(__NETWARE__) || defined(__WIN__) /* Netware doesn't proved environment variable substitution that is done by the shell in unix environments. We do this in the following function: @@ -4600,6 +4600,9 @@ static char *subst_env_var(const char *str) */ #undef popen /* Remove wrapper */ +#ifdef __WIN__ +#define popen _popen /* redefine for windows */ +#endif FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) { diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index c4b3fae40f9..d718935cca8 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -39,7 +39,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. EXTRA_PROGRAMS = mysql_test_run_new noinst_HEADERS = my_manage.h -mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c +mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c dist-hook: diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c new file mode 100644 index 00000000000..405f66dc8df --- /dev/null +++ b/mysql-test/my_create_tables.c @@ -0,0 +1,646 @@ +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#include +#else +#include +#ifndef __WIN__ +#include +#include +#else +#include +#include +#include +#endif +#endif +#include +#include +#include +#include +#include "my_manage.h" + +/* + Synopsis: + This function testes a exist file + +Arguments: + mdata: path to data + file_name: name of file +Output: + A zero value indicates that file is exist. +*/ +bool test_sys_file(const char *mdata,const char *file_name) +{ + struct stat file; + char path_file_name[PATH_MAX]; + snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name); + return(stat(path_file_name,&file)); +} + +/* + Synopsis: + This function creates a file with sql requstes for creating + system data files. + +Arguments: + mdata: path to data + output_file: file name for output file + test: to create system files with test data +Output: + A zero value indicates a success. +*/ +bool create_system_files(const char *mdata,const char *output_file, bool test) +{ + FILE *out; + + out = fopen(output_file, "w+"); + + if (!out) + return 1; + + if (test_sys_file(mdata,"mysql")) + { + fprintf(out,"CREATE DATABASE mysql;\n"); + } + + if (test && test_sys_file(mdata,"test")) + { + fprintf(out,"CREATE DATABASE test;\n"); + } + + fprintf(out,"USE mysql;\n"); + + if (test_sys_file(mdata,"mysql/db.frm")) + { + fprintf(out, + "CREATE TABLE db (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db,User)," + "KEY User (User))" + "comment='Database privileges';\n"); + + if (test) + { + fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'" + ",'Y','Y','N','Y','Y','Y','Y','Y');\n"); + fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'" + ",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n"); + } + } + + if (test_sys_file(mdata,"mysql/host.frm")) + { + fprintf(out, + "CREATE TABLE host (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db))" + "comment='Host privileges;" + " Merged with database privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/user.frm")) + { +#ifdef __WIN__ + WSADATA wsa_data; +#endif + char hostname[FN_REFLEN]; + +#ifdef __WIN__ + if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data)) + return 1; +#endif + if (gethostname(hostname, FN_REFLEN)) + return 1; +#ifdef __WIN__ + WSACleanup( ); +#endif + + if (strchr(hostname, '.') == NULL) + strcat(hostname, "%"); + + fprintf(out, + "CREATE TABLE user (" + "Host char(60) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Password char(41) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "File_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + "ssl_cipher BLOB NOT NULL," + "x509_issuer BLOB NOT NULL," + "x509_subject BLOB NOT NULL," + "max_questions int(11) unsigned DEFAULT 0 NOT NULL," + "max_updates int(11) unsigned DEFAULT 0 NOT NULL," + "max_connections int(11) unsigned DEFAULT 0 NOT NULL," + "PRIMARY KEY Host (Host,User)" + ") comment='Users and global privileges';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','','','','',0,0,0);\n"); + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n",hostname); + fprintf(out, + "REPLACE INTO user VALUES ('127.0.0.1','root',''," + "'Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','','','','',0,0,0);\n"); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + } + else + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n"); +#ifndef __WIN__ + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y'" + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''" + ",'','',0,0,0);\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); +#else + fprintf(out, + "INSERT INTO user VALUES ('localhost','','','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''," + "'','',0,0,0);\n"); +#endif + } + } + + + if (test_sys_file(mdata,"mysql/func.frm")) + { + fprintf(out, + "CREATE TABLE func (" + "name char(64) binary DEFAULT '' NOT NULL," + "ret tinyint(1) DEFAULT '0' NOT NULL," + "dl char(128) DEFAULT '' NOT NULL," + "type enum ('function','aggregate') NOT NULL," + "PRIMARY KEY (name)" + ") comment='User defined functions';\n"); + } + + if (test_sys_file(mdata,"mysql/tables_priv.frm")) + { + fprintf(out, + "CREATE TABLE tables_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Grantor char(77) DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Table_priv set('Select','Insert','Update','Delete'," + "'Create','Drop','Grant','References','Index','Alter')" + " DEFAULT '' NOT NULL," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name)," + "KEY Grantor (Grantor)" + ") comment='Table privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/columns_priv.frm")) + { + fprintf(out, + "CREATE TABLE columns_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Column_name char(64) binary DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name,Column_name)" + ") comment='Column privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/help_topic.frm")) + { + fprintf(out, + "CREATE TABLE help_topic (" + "help_topic_id int unsigned not null," + "name varchar(64) not null," + "help_category_id smallint unsigned not null," + "description text not null," + "example text not null," + "url varchar(128) not null," + "primary key (help_topic_id)," + "unique index (name)" + ") comment='help topics';\n"); + } + + if (test_sys_file(mdata,"mysql/help_category.frm")) + { + fprintf(out, + "CREATE TABLE help_category (" + "help_category_id smallint unsigned not null," + "name varchar(64) not null," + "parent_category_id smallint unsigned null," + "url varchar(128) not null," + "primary key (help_category_id)," + "unique index (name)" + ") comment='help categories';\n"); + } + + if (test_sys_file(mdata,"mysql/help_keyword.frm")) + { + fprintf(out, + "CREATE TABLE help_keyword (" + "help_keyword_id int unsigned not null," + "name varchar(64) not null," + "primary key (help_keyword_id)," + "unique index (name)" + ") comment='help keywords';\n"); + } + + if (test_sys_file(mdata,"mysql/help_relation.frm")) + { + fprintf(out, + "CREATE TABLE help_relation (" + "help_topic_id int unsigned not null references help_topic," + "help_keyword_id int unsigned not null references help_keyword," + "primary key (help_keyword_id, help_topic_id)" + ") comment='keyword-topic relation';\n"); + } + + if (test_sys_file(mdata,"mysql/time_zone_name.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_name (" + "Name char(64) NOT NULL," + "Time_zone_id int unsigned NOT NULL," + "PRIMARY KEY Name (Name)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone names';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" + "('MET', 1), ('UTC', 2), ('Universal', 2), " + "('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n"); + } + } + + + if (test_sys_file(mdata,"mysql/time_zone.frm")) + { + fprintf(out, + "CREATE TABLE time_zone (" + "Time_zone_id int unsigned NOT NULL auto_increment," + "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + "PRIMARY KEY TzId (Time_zone_id)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zones';\n"); + + if (test) + { + fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" + "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition (" + "Time_zone_id int unsigned NOT NULL," + "Transition_time bigint signed NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone transitions';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition" + "(Time_zone_id, Transition_time, Transition_type_id)" + "VALUES" + " (1, -1693706400, 0) ,(1, -1680483600, 1)" + ",(1, -1663455600, 2) ,(1, -1650150000, 3)" + ",(1, -1632006000, 2) ,(1, -1618700400, 3)" + ",(1, -938905200, 2) ,(1, -857257200, 3)" + ",(1, -844556400, 2) ,(1, -828226800, 3)" + ",(1, -812502000, 2) ,(1, -796777200, 3)" + ",(1, 228877200, 2) ,(1, 243997200, 3)" + ",(1, 260326800, 2) ,(1, 276051600, 3)" + ",(1, 291776400, 2) ,(1, 307501200, 3)" + ",(1, 323830800, 2) ,(1, 338950800, 3)" + ",(1, 354675600, 2) ,(1, 370400400, 3)" + ",(1, 386125200, 2) ,(1, 401850000, 3)" + ",(1, 417574800, 2) ,(1, 433299600, 3)" + ",(1, 449024400, 2) ,(1, 465354000, 3)" + ",(1, 481078800, 2) ,(1, 496803600, 3)" + ",(1, 512528400, 2) ,(1, 528253200, 3)" + ",(1, 543978000, 2) ,(1, 559702800, 3)" + ",(1, 575427600, 2) ,(1, 591152400, 3)" + ",(1, 606877200, 2) ,(1, 622602000, 3)" + ",(1, 638326800, 2) ,(1, 654656400, 3)" + ",(1, 670381200, 2) ,(1, 686106000, 3)" + ",(1, 701830800, 2) ,(1, 717555600, 3)" + ",(1, 733280400, 2) ,(1, 749005200, 3)" + ",(1, 764730000, 2) ,(1, 780454800, 3)" + ",(1, 796179600, 2) ,(1, 811904400, 3)" + ",(1, 828234000, 2) ,(1, 846378000, 3)" + ",(1, 859683600, 2) ,(1, 877827600, 3)" + ",(1, 891133200, 2) ,(1, 909277200, 3)" + ",(1, 922582800, 2) ,(1, 941331600, 3)" + ",(1, 954032400, 2) ,(1, 972781200, 3)" + ",(1, 985482000, 2) ,(1, 1004230800, 3)" + ",(1, 1017536400, 2) ,(1, 1035680400, 3)" + ",(1, 1048986000, 2) ,(1, 1067130000, 3)" + ",(1, 1080435600, 2) ,(1, 1099184400, 3)" + ",(1, 1111885200, 2) ,(1, 1130634000, 3)" + ",(1, 1143334800, 2) ,(1, 1162083600, 3)" + ",(1, 1174784400, 2) ,(1, 1193533200, 3)" + ",(1, 1206838800, 2) ,(1, 1224982800, 3)" + ",(1, 1238288400, 2) ,(1, 1256432400, 3)" + ",(1, 1269738000, 2) ,(1, 1288486800, 3)" + ",(1, 1301187600, 2) ,(1, 1319936400, 3)" + ",(1, 1332637200, 2) ,(1, 1351386000, 3)" + ",(1, 1364691600, 2) ,(1, 1382835600, 3)" + ",(1, 1396141200, 2) ,(1, 1414285200, 3)" + ",(1, 1427590800, 2) ,(1, 1445734800, 3)" + ",(1, 1459040400, 2) ,(1, 1477789200, 3)" + ",(1, 1490490000, 2) ,(1, 1509238800, 3)" + ",(1, 1521939600, 2) ,(1, 1540688400, 3)" + ",(1, 1553994000, 2) ,(1, 1572138000, 3)" + ",(1, 1585443600, 2) ,(1, 1603587600, 3)" + ",(1, 1616893200, 2) ,(1, 1635642000, 3)" + ",(1, 1648342800, 2) ,(1, 1667091600, 3)" + ",(1, 1679792400, 2) ,(1, 1698541200, 3)" + ",(1, 1711846800, 2) ,(1, 1729990800, 3)" + ",(1, 1743296400, 2) ,(1, 1761440400, 3)" + ",(1, 1774746000, 2) ,(1, 1792890000, 3)" + ",(1, 1806195600, 2) ,(1, 1824944400, 3)" + ",(1, 1837645200, 2) ,(1, 1856394000, 3)" + ",(1, 1869094800, 2) ,(1, 1887843600, 3)" + ",(1, 1901149200, 2) ,(1, 1919293200, 3)" + ",(1, 1932598800, 2) ,(1, 1950742800, 3)" + ",(1, 1964048400, 2) ,(1, 1982797200, 3)" + ",(1, 1995498000, 2) ,(1, 2014246800, 3)" + ",(1, 2026947600, 2) ,(1, 2045696400, 3)" + ",(1, 2058397200, 2) ,(1, 2077146000, 3)" + ",(1, 2090451600, 2) ,(1, 2108595600, 3)" + ",(1, 2121901200, 2) ,(1, 2140045200, 3)" + ",(3, -1688265000, 2) ,(3, -1656819048, 1)" + ",(3, -1641353448, 2) ,(3, -1627965048, 3)" + ",(3, -1618716648, 1) ,(3, -1596429048, 3)" + ",(3, -1593829848, 5) ,(3, -1589860800, 4)" + ",(3, -1542427200, 5) ,(3, -1539493200, 6)" + ",(3, -1525323600, 5) ,(3, -1522728000, 4)" + ",(3, -1491188400, 7) ,(3, -1247536800, 4)" + ",(3, 354920400, 5) ,(3, 370728000, 4)" + ",(3, 386456400, 5) ,(3, 402264000, 4)" + ",(3, 417992400, 5) ,(3, 433800000, 4)" + ",(3, 449614800, 5) ,(3, 465346800, 8)" + ",(3, 481071600, 9) ,(3, 496796400, 8)" + ",(3, 512521200, 9) ,(3, 528246000, 8)" + ",(3, 543970800, 9) ,(3, 559695600, 8)" + ",(3, 575420400, 9) ,(3, 591145200, 8)" + ",(3, 606870000, 9) ,(3, 622594800, 8)" + ",(3, 638319600, 9) ,(3, 654649200, 8)" + ",(3, 670374000, 10) ,(3, 686102400, 11)" + ",(3, 695779200, 8) ,(3, 701812800, 5)" + ",(3, 717534000, 4) ,(3, 733273200, 9)" + ",(3, 748998000, 8) ,(3, 764722800, 9)" + ",(3, 780447600, 8) ,(3, 796172400, 9)" + ",(3, 811897200, 8) ,(3, 828226800, 9)" + ",(3, 846370800, 8) ,(3, 859676400, 9)" + ",(3, 877820400, 8) ,(3, 891126000, 9)" + ",(3, 909270000, 8) ,(3, 922575600, 9)" + ",(3, 941324400, 8) ,(3, 954025200, 9)" + ",(3, 972774000, 8) ,(3, 985474800, 9)" + ",(3, 1004223600, 8) ,(3, 1017529200, 9)" + ",(3, 1035673200, 8) ,(3, 1048978800, 9)" + ",(3, 1067122800, 8) ,(3, 1080428400, 9)" + ",(3, 1099177200, 8) ,(3, 1111878000, 9)" + ",(3, 1130626800, 8) ,(3, 1143327600, 9)" + ",(3, 1162076400, 8) ,(3, 1174777200, 9)" + ",(3, 1193526000, 8) ,(3, 1206831600, 9)" + ",(3, 1224975600, 8) ,(3, 1238281200, 9)" + ",(3, 1256425200, 8) ,(3, 1269730800, 9)" + ",(3, 1288479600, 8) ,(3, 1301180400, 9)" + ",(3, 1319929200, 8) ,(3, 1332630000, 9)" + ",(3, 1351378800, 8) ,(3, 1364684400, 9)" + ",(3, 1382828400, 8) ,(3, 1396134000, 9)" + ",(3, 1414278000, 8) ,(3, 1427583600, 9)" + ",(3, 1445727600, 8) ,(3, 1459033200, 9)" + ",(3, 1477782000, 8) ,(3, 1490482800, 9)" + ",(3, 1509231600, 8) ,(3, 1521932400, 9)" + ",(3, 1540681200, 8) ,(3, 1553986800, 9)" + ",(3, 1572130800, 8) ,(3, 1585436400, 9)" + ",(3, 1603580400, 8) ,(3, 1616886000, 9)" + ",(3, 1635634800, 8) ,(3, 1648335600, 9)" + ",(3, 1667084400, 8) ,(3, 1679785200, 9)" + ",(3, 1698534000, 8) ,(3, 1711839600, 9)" + ",(3, 1729983600, 8) ,(3, 1743289200, 9)" + ",(3, 1761433200, 8) ,(3, 1774738800, 9)" + ",(3, 1792882800, 8) ,(3, 1806188400, 9)" + ",(3, 1824937200, 8) ,(3, 1837638000, 9)" + ",(3, 1856386800, 8) ,(3, 1869087600, 9)" + ",(3, 1887836400, 8) ,(3, 1901142000, 9)" + ",(3, 1919286000, 8) ,(3, 1932591600, 9)" + ",(3, 1950735600, 8) ,(3, 1964041200, 9)" + ",(3, 1982790000, 8) ,(3, 1995490800, 9)" + ",(3, 2014239600, 8) ,(3, 2026940400, 9)" + ",(3, 2045689200, 8) ,(3, 2058390000, 9)" + ",(3, 2077138800, 8) ,(3, 2090444400, 9)" + ",(3, 2108588400, 8) ,(3, 2121894000, 9)" + ",(3, 2140038000, 8)" + ",(4, -1688265000, 2) ,(4, -1656819048, 1)" + ",(4, -1641353448, 2) ,(4, -1627965048, 3)" + ",(4, -1618716648, 1) ,(4, -1596429048, 3)" + ",(4, -1593829848, 5) ,(4, -1589860800, 4)" + ",(4, -1542427200, 5) ,(4, -1539493200, 6)" + ",(4, -1525323600, 5) ,(4, -1522728000, 4)" + ",(4, -1491188400, 7) ,(4, -1247536800, 4)" + ",(4, 354920409, 5) ,(4, 370728010, 4)" + ",(4, 386456410, 5) ,(4, 402264011, 4)" + ",(4, 417992411, 5) ,(4, 433800012, 4)" + ",(4, 449614812, 5) ,(4, 465346812, 8)" + ",(4, 481071612, 9) ,(4, 496796413, 8)" + ",(4, 512521213, 9) ,(4, 528246013, 8)" + ",(4, 543970813, 9) ,(4, 559695613, 8)" + ",(4, 575420414, 9) ,(4, 591145214, 8)" + ",(4, 606870014, 9) ,(4, 622594814, 8)" + ",(4, 638319615, 9) ,(4, 654649215, 8)" + ",(4, 670374016, 10) ,(4, 686102416, 11)" + ",(4, 695779216, 8) ,(4, 701812816, 5)" + ",(4, 717534017, 4) ,(4, 733273217, 9)" + ",(4, 748998018, 8) ,(4, 764722818, 9)" + ",(4, 780447619, 8) ,(4, 796172419, 9)" + ",(4, 811897219, 8) ,(4, 828226820, 9)" + ",(4, 846370820, 8) ,(4, 859676420, 9)" + ",(4, 877820421, 8) ,(4, 891126021, 9)" + ",(4, 909270021, 8) ,(4, 922575622, 9)" + ",(4, 941324422, 8) ,(4, 954025222, 9)" + ",(4, 972774022, 8) ,(4, 985474822, 9)" + ",(4, 1004223622, 8) ,(4, 1017529222, 9)" + ",(4, 1035673222, 8) ,(4, 1048978822, 9)" + ",(4, 1067122822, 8) ,(4, 1080428422, 9)" + ",(4, 1099177222, 8) ,(4, 1111878022, 9)" + ",(4, 1130626822, 8) ,(4, 1143327622, 9)" + ",(4, 1162076422, 8) ,(4, 1174777222, 9)" + ",(4, 1193526022, 8) ,(4, 1206831622, 9)" + ",(4, 1224975622, 8) ,(4, 1238281222, 9)" + ",(4, 1256425222, 8) ,(4, 1269730822, 9)" + ",(4, 1288479622, 8) ,(4, 1301180422, 9)" + ",(4, 1319929222, 8) ,(4, 1332630022, 9)" + ",(4, 1351378822, 8) ,(4, 1364684422, 9)" + ",(4, 1382828422, 8) ,(4, 1396134022, 9)" + ",(4, 1414278022, 8) ,(4, 1427583622, 9)" + ",(4, 1445727622, 8) ,(4, 1459033222, 9)" + ",(4, 1477782022, 8) ,(4, 1490482822, 9)" + ",(4, 1509231622, 8) ,(4, 1521932422, 9)" + ",(4, 1540681222, 8) ,(4, 1553986822, 9)" + ",(4, 1572130822, 8) ,(4, 1585436422, 9)" + ",(4, 1603580422, 8) ,(4, 1616886022, 9)" + ",(4, 1635634822, 8) ,(4, 1648335622, 9)" + ",(4, 1667084422, 8) ,(4, 1679785222, 9)" + ",(4, 1698534022, 8) ,(4, 1711839622, 9)" + ",(4, 1729983622, 8) ,(4, 1743289222, 9)" + ",(4, 1761433222, 8) ,(4, 1774738822, 9)" + ",(4, 1792882822, 8) ,(4, 1806188422, 9)" + ",(4, 1824937222, 8) ,(4, 1837638022, 9)" + ",(4, 1856386822, 8) ,(4, 1869087622, 9)" + ",(4, 1887836422, 8) ,(4, 1901142022, 9)" + ",(4, 1919286022, 8) ,(4, 1932591622, 9)" + ",(4, 1950735622, 8) ,(4, 1964041222, 9)" + ",(4, 1982790022, 8) ,(4, 1995490822, 9)" + ",(4, 2014239622, 8) ,(4, 2026940422, 9)" + ",(4, 2045689222, 8) ,(4, 2058390022, 9)" + ",(4, 2077138822, 8) ,(4, 2090444422, 9)" + ",(4, 2108588422, 8) ,(4, 2121894022, 9)" + ",(4, 2140038022, 8);\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition_type (" + "Time_zone_id int unsigned NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "Offset int signed DEFAULT 0 NOT NULL," + "Is_DST tinyint unsigned DEFAULT 0 NOT NULL," + "Abbreviation char(8) DEFAULT '' NOT NULL," + "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone transition types';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition_type (Time_zone_id," + "Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" + "(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" + ",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" + ",(2, 0, 0, 0, 'UTC')" + ",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" + ",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" + ",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" + ",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" + ",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" + ",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" + ",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" + ",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" + ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" + ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" + ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" + ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_leap_second (" + "Transition_time bigint signed NOT NULL," + "Correction int signed NOT NULL," + "PRIMARY KEY TranTime (Transition_time)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Leap seconds information for time zones';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_leap_second " + "(Transition_time, Correction) VALUES " + "(78796800, 1) ,(94694401, 2) ,(126230402, 3)" + ",(157766403, 4) ,(189302404, 5) ,(220924805, 6)" + ",(252460806, 7) ,(283996807, 8) ,(315532808, 9)" + ",(362793609, 10) ,(394329610, 11) ,(425865611, 12)" + ",(489024012, 13) ,(567993613, 14) ,(631152014, 15)" + ",(662688015, 16) ,(709948816, 17) ,(741484817, 18)" + ",(773020818, 19) ,(820454419, 20) ,(867715220, 21)" + ",(915148821, 22);\n"); + } + } + + return fclose(out); +} diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index cc27558f131..472b0d32683 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -333,7 +333,6 @@ int spawn(char *path, arg_list_t *al, int join, char *input, PROCESS_INFORMATION process_information; DWORD exit_code; char win_args[1024]= ""; - char command_line[1024]= ""; /* Skip the first parameter */ for (i= 1; i < al->argc; i++) @@ -724,7 +723,7 @@ int removef(const char *format, ...) va_end(ap); return remove(path); -#eldef __WIN__ +#elif __WIN__ { va_list ap; char path[FN_REFLEN]; diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h index 7e371d36ab1..5df77b01af8 100644 --- a/mysql-test/my_manage.h +++ b/mysql-test/my_manage.h @@ -52,6 +52,8 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...); #define TRY_MAX 5 #ifdef __WIN__ +#define PATH_MAX _MAX_PATH +#define NAME_MAX _MAX_FNAME #define kill(A,B) TerminateProcess((HANDLE)A,0) #define NOT_NEED_PID 0 #define MASTER_PID 1 @@ -130,4 +132,6 @@ int removef(const char *, ...); void get_basedir(char *, char *); void remove_empty_file(const char *file_name); +bool create_system_files(const char *mdata,const char *output_file, bool test); + #endif /* _MY_MANAGE */ diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index d8bf731b398..fe13d71c1c2 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -267,6 +267,8 @@ void install_db(char *datadir) snprintf(output, FN_REFLEN, "%s/install.out", datadir); snprintf(error, FN_REFLEN, "%s/install.err", datadir); + if (create_system_files(datadir,input, TRUE)) + die("Unable to create init_db.sql."); /* args */ init_args(&al); add_arg(&al, mysqld_file); @@ -307,9 +309,6 @@ void mysql_install_db() /* var directory */ snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir); - /* clean up old direcotry */ - del_tree(temp); - /* create var directory */ #ifndef __WIN__ mkdir(temp, S_IRWXU); @@ -1435,6 +1434,17 @@ void setup(char *file __attribute__((unused))) } +/* + Compare names of testes for right order +*/ +#ifdef __WIN__ +int compare( const void *arg1, const void *arg2 ) +{ + return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); +} +#endif + + /****************************************************************************** main() diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..a635f266165 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -189,7 +189,10 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE + README INSTALL* LICENSE *.inc *.test *.result \ + *.pem Moscow_leap des_key_file *.dat *.000001 \ + *.require *.opt + do if [ -f $i ] then @@ -247,7 +250,7 @@ done # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase mysql-test do copy_dir_dirs $i done -- cgit v1.2.1 From e938cfcea6e12babc71d5c28789d4e876ae0021a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 18:47:34 +0400 Subject: Clean-up. TYPE=MyISAM replaced with ENGINE=MyISAM. --- mysql-test/r/subselect.result | 4 +--- mysql-test/t/subselect.test | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index fc23331ad7b..0735f133e6f 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2115,9 +2115,7 @@ GovernmentForm char(45) NOT NULL default '', HeadOfState char(60) default NULL, Capital int(11) default NULL, Code2 char(2) NOT NULL default '' -) TYPE=MyISAM; -Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index b5b5de069bf..f59851fa722 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1378,7 +1378,7 @@ CREATE TABLE t1 ( HeadOfState char(60) default NULL, Capital int(11) default NULL, Code2 char(2) NOT NULL default '' -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); -- cgit v1.2.1 From 83fce55a3ae79c0033e372cb7ec48a3248307d6e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Dec 2004 01:37:22 +0300 Subject: A fix of return value of mysql_stmt_bind_result() and cleanup. include/errmsg.h: New libmysql error status code CR_NO_STMT_METADATA libmysql/errmsg.c: Error message for CR_STMT_NO_METADATA. Adding an empty line to shorten further diffs when new error messages are added (as suggested by Monty). libmysql/libmysql.c: Return error from mysql_stmt_bind_result() if the statement contains no metadata. A few comments fixed. tests/client_test.c: Tests fixed: mysql_stmt_bind_result now returns error if there is no metadata. --- include/errmsg.h | 1 + libmysql/errmsg.c | 12 +++++++++--- libmysql/libmysql.c | 15 +++++++-------- tests/client_test.c | 5 +---- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/errmsg.h b/include/errmsg.h index 6115b24a3d8..96977227666 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SECURE_AUTH 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 +#define CR_NO_STMT_METADATA 2052 diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 710bf4ccd8d..5fa94e5ff0d 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -78,7 +78,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ @@ -137,7 +139,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #else /* ENGLISH */ @@ -194,7 +198,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #endif diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 8989dc18fd7..a71e99a5642 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2139,12 +2139,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt) DESCRIPTION This function should be used after mysql_stmt_execute(). You can safely check that prepared statement has a result set by calling - mysql_stmt_num_fields(): if number of fields is not zero, you can call + mysql_stmt_field_count(): if number of fields is not zero, you can call this function to get fields metadata. Next steps you may want to make: - find out number of columns in result set by calling mysql_num_fields(res) (the same value is returned by - mysql_stmt_num_fields) + mysql_stmt_field_count()) - fetch metadata for any column with mysql_fetch_field, mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek. - free returned MYSQL_RES structure with mysql_free_result. @@ -3882,11 +3882,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) if (!bind_count) { - if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) - { - set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); - } - DBUG_RETURN(0); + int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ? + CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA; + set_stmt_error(stmt, errorcode, unknown_sqlstate); + DBUG_RETURN(1); } /* @@ -4278,7 +4277,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) row+= (stmt->field_count+9)/8; /* skip null bits */ bit= 4; /* first 2 bits are reserved */ - /* Go throw all fields and calculate metadata */ + /* Go through all fields and calculate metadata */ for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; bind < end ; bind++, field++) diff --git a/tests/client_test.c b/tests/client_test.c index b78339cc9bb..fb130a17361 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -5636,9 +5636,6 @@ static void test_subselect() rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); - check_execute(stmt, rc); - id= 2; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -5982,7 +5979,7 @@ static void test_pure_coverage() check_execute(stmt, rc); rc= mysql_stmt_bind_result(stmt, (MYSQL_BIND*)0); - check_execute(stmt, rc); + DIE_UNLESS(rc == 1); mysql_stmt_close(stmt); -- cgit v1.2.1 From 33959dc1a4fa638e67bb98892a466692b9ba402e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Dec 2004 12:36:01 +0100 Subject: fix for bug #7285: Disable start of embedded server when need to connect to an external server with mysqld. libmysql/libmysql.c: fix for bug #7285: Disable start of embedded server when need to connect to an external server with libmysqld. Calling mysql_server_init with a negative value for argc will not start the embedded server. --- libmysql/libmysql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index a71e99a5642..b180e86392d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -158,7 +158,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), (void) signal(SIGPIPE, SIG_IGN); #endif #ifdef EMBEDDED_LIBRARY - result= init_embedded_server(argc, argv, groups); + if (argc > -1) + result= init_embedded_server(argc, argv, groups); #endif } #ifdef THREAD -- cgit v1.2.1 From b857b6e763d8cd2329c48911a0e82d5506d3d184 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 02:43:35 +0300 Subject: myisam/sort.c:my_var_write and mysys/hash.c:hash_key made static inline, not simply inline, to fix the linking failure on Sun Solaris 9 (sparc) with Sun Studio 9, reported by Peter Harvey. myisam/sort.c: my_var_write made static inline (fix for a link failure) mysys/hash.c: hash_key made static inline (fix a link failure) --- myisam/sort.c | 7 +++++-- mysys/hash.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index 3dc066e877c..39bde41e4c9 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, IO_CACHE *to_file, char* key, uint sort_length, uint count); -inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs); +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs); + /* Creates a index of sorted keys @@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, } /* write_keys */ -inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) { int err; uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs); diff --git a/mysys/hash.c b/mysys/hash.c index d068299d44e..451bc1eb7f5 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -146,7 +146,7 @@ void hash_reset(HASH *hash) handle inline functions that are not defined as native types */ -inline char* +static inline char* hash_key(HASH *hash,const byte *record,uint *length,my_bool first) { if (hash->get_key) -- cgit v1.2.1 From 1fa33736d3d0d21d53284460b1cfd94ca258e527 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 13:34:25 +0100 Subject: - bumped up version number in configure.in from 4.1.8 to 4.1.9 - tagged ChangeSet 1.2173 as "mysql-4.1.8" configure.in: - bumped up version number from 4.1.8 to 4.1.9 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4131db9c66d..760e7ee20fb 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.8) +AM_INIT_AUTOMAKE(mysql, 4.1.9) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 -- cgit v1.2.1 From bfa45f2fa2aa9dfd7bb8cdea974ade3af7867b08 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 16:16:28 +0300 Subject: Making 4.1 tree compile with -ansi -pedantic include/raid.h: Fixing compile-time warning: pragma interface is not supported in C, let's move it to C++ part of the header. ndb/include/kernel/signaldata/CreateEvnt.hpp: - remove extra erroneous ; from ends of function definitions ndb/include/kernel/signaldata/PackedSignal.hpp: - remove extra erroneous ; from ends of function definitions ndb/include/kernel/signaldata/SumaImpl.hpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/debugger/signaldata/DictTabInfo.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/debugger/signaldata/NFCompleteRep.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/logger/FileLogHandler.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/backup/BackupInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbdict/Dbdict.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtux/Dbtux.hpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbutil/DbUtil.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/grep/GrepInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbfs/VoidFs.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/suma/Suma.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/suma/SumaInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/trix/Trix.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/mgmsrv/MgmtSrvr.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/ndbapi/NdbEventOperation.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/ndbapi/NdbScanFilter.cpp: - remove extra erroneous ; from ends of function definitions ndb/tools/restore/Restore.cpp: - remove extra erroneous ; from ends of function definitions sql/item_create.h: - remove extra erroneous ; sql/sql_cache.cc: - remove extra erroneous ; tests/client_test.c: - fix -pedantic warning --- include/raid.h | 7 ++++--- ndb/include/kernel/signaldata/CreateEvnt.hpp | 8 ++++---- ndb/include/kernel/signaldata/PackedSignal.hpp | 2 +- ndb/include/kernel/signaldata/SumaImpl.hpp | 18 +++++++++--------- ndb/src/common/debugger/signaldata/DictTabInfo.cpp | 2 +- ndb/src/common/debugger/signaldata/NFCompleteRep.cpp | 2 +- ndb/src/common/logger/FileLogHandler.cpp | 6 +++--- ndb/src/kernel/blocks/backup/BackupInit.cpp | 2 +- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 2 +- ndb/src/kernel/blocks/dbacc/DbaccInit.cpp | 2 +- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 +- ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 2 +- ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 2 +- ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 2 +- ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 2 +- ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 4 ++-- ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp | 2 +- ndb/src/kernel/blocks/dbutil/DbUtil.cpp | 2 +- ndb/src/kernel/blocks/grep/GrepInit.cpp | 2 +- ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp | 2 +- ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 2 +- ndb/src/kernel/blocks/ndbfs/VoidFs.cpp | 2 +- ndb/src/kernel/blocks/qmgr/QmgrInit.cpp | 2 +- ndb/src/kernel/blocks/suma/Suma.cpp | 2 +- ndb/src/kernel/blocks/suma/SumaInit.cpp | 4 ++-- ndb/src/kernel/blocks/trix/Trix.cpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 2 +- ndb/src/ndbapi/NdbEventOperation.cpp | 2 +- ndb/src/ndbapi/NdbScanFilter.cpp | 4 ++-- ndb/tools/restore/Restore.cpp | 8 ++++---- sql/item_create.h | 2 +- sql/sql_cache.cc | 2 +- tests/client_test.c | 6 +++--- 33 files changed, 57 insertions(+), 56 deletions(-) diff --git a/include/raid.h b/include/raid.h index b5a5e665824..04c54393e54 100644 --- a/include/raid.h +++ b/include/raid.h @@ -32,9 +32,6 @@ C_MODE_END #endif #if defined(USE_RAID) -#ifdef __GNUC__ -#pragma interface /* gcc class implementation */ -#endif #include "my_dir.h" /* Trap all occurences of my_...() in source and use our wrapper around this function */ @@ -92,6 +89,10 @@ extern "C" { #ifdef __cplusplus } +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + class RaidName { public: RaidName(const char *FileName); diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp index 65a07c122a2..e911fa36ce6 100644 --- a/ndb/include/kernel/signaldata/CreateEvnt.hpp +++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -475,14 +475,14 @@ struct CreateEvntRef { } }; inline bool CreateEvntRef::isTemporary() const -{ return (errorCode & CreateEvntRef::Temporary) > 0; }; +{ return (errorCode & CreateEvntRef::Temporary) > 0; } inline void CreateEvntRef::setTemporary() -{ errorCode |= CreateEvntRef::Temporary; }; +{ errorCode |= CreateEvntRef::Temporary; } inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); } inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }; + ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); } #endif diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp index 057bb39b25a..ea0ff6db526 100644 --- a/ndb/include/kernel/signaldata/PackedSignal.hpp +++ b/ndb/include/kernel/signaldata/PackedSignal.hpp @@ -38,6 +38,6 @@ class PackedSignal { }; inline -Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }; +Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; } #endif diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp index 089132cd9aa..89ade067dcd 100644 --- a/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -159,12 +159,12 @@ public: Uint32 subscriberRef; }; inline bool SubStartRef::isTemporary() const -{ return (errorCode & SubStartRef::Temporary) > 0; }; +{ return (errorCode & SubStartRef::Temporary) > 0; } inline void SubStartRef::setTemporary() -{ errorCode |= SubStartRef::Temporary; }; +{ errorCode |= SubStartRef::Temporary; } inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec) { return (SubStartRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); } class SubStartConf { /** @@ -239,12 +239,12 @@ public: }; }; inline bool SubStopRef::isTemporary() const -{ return (errorCode & SubStopRef::Temporary) > 0; }; +{ return (errorCode & SubStopRef::Temporary) > 0; } inline void SubStopRef::setTemporary() -{ errorCode |= SubStopRef::Temporary; }; +{ errorCode |= SubStopRef::Temporary; } inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec) { return (SubStopRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); } class SubStopConf { /** @@ -515,12 +515,12 @@ public: }; }; inline bool SubRemoveRef::isTemporary() const -{ return (err & SubRemoveRef::Temporary) > 0; }; +{ return (err & SubRemoveRef::Temporary) > 0; } inline void SubRemoveRef::setTemporary() -{ err |= SubRemoveRef::Temporary; }; +{ err |= SubRemoveRef::Temporary; } inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec) { return (SubRemoveRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); } class SubRemoveConf { /** diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp index 7e7bf87e2db..c6165532ddb 100644 --- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp +++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp @@ -152,4 +152,4 @@ DictTabInfo::Attribute::init(){ AttributeExtLength = 0, AttributeAutoIncrement = false; memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0; -}; +} diff --git a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp index 20f7ea99871..f2d6f2f104a 100644 --- a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp +++ b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp @@ -41,4 +41,4 @@ printNF_COMPLETE_REP(FILE * output, sig->from); return true; -}; +} diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 29172ff93ad..cdc33eb349c 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -198,7 +198,7 @@ FileLogHandler::setFilename(const BaseString &filename) { m_pLogFile = new File_class(filename.c_str(), "a+"); open(); return true; -}; +} bool FileLogHandler::setMaxSize(const BaseString &size) { @@ -214,7 +214,7 @@ FileLogHandler::setMaxSize(const BaseString &size) { m_maxFileSize = val; return true; -}; +} bool FileLogHandler::setMaxFiles(const BaseString &files) { @@ -225,7 +225,7 @@ FileLogHandler::setMaxFiles(const BaseString &files) { m_maxNoFiles = val; return true; -}; +} bool FileLogHandler::checkParams() { diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 37c579bfe84..e0171c61eca 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -205,7 +205,7 @@ Backup::~Backup() { } -BLOCK_FUNCTIONS(Backup); +BLOCK_FUNCTIONS(Backup) template class ArrayPool; template class ArrayPool; diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index af8668180f9..923277f7c8b 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -1110,7 +1110,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) }//Cmvmi::execDUMP_STATE_ORD() -BLOCK_FUNCTIONS(Cmvmi); +BLOCK_FUNCTIONS(Cmvmi) static Uint32 g_print; static LinearSectionPtr g_test[3]; diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index 2705f95f6dd..95b336a0a65 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -264,4 +264,4 @@ Dbacc::~Dbacc() }//Dbacc::~Dbacc() -BLOCK_FUNCTIONS(Dbacc); +BLOCK_FUNCTIONS(Dbacc) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 2b9072ab042..5e15917f720 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -1192,7 +1192,7 @@ Dbdict::~Dbdict() { }//Dbdict::~Dbdict() -BLOCK_FUNCTIONS(Dbdict); +BLOCK_FUNCTIONS(Dbdict) void Dbdict::initCommonData() { diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 7ca45ef4b43..b823dbcd952 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -314,7 +314,7 @@ Dbdih::~Dbdih() }//Dbdih::~Dbdih() -BLOCK_FUNCTIONS(Dbdih); +BLOCK_FUNCTIONS(Dbdih) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index d0fef8753cb..0577aa4d344 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -454,5 +454,5 @@ Dblqh::~Dblqh() ctcNodeFailrecFileSize); }//Dblqh::~Dblqh() -BLOCK_FUNCTIONS(Dblqh); +BLOCK_FUNCTIONS(Dblqh) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index e38089242c3..5c66ba776b0 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -365,5 +365,5 @@ Dbtc::~Dbtc() capiConnectFilesize); }//Dbtc::~Dbtc() -BLOCK_FUNCTIONS(Dbtc); +BLOCK_FUNCTIONS(Dbtc) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index d33adcd08e1..8e1cba24359 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -215,7 +215,7 @@ Dbtup::~Dbtup() }//Dbtup::~Dbtup() -BLOCK_FUNCTIONS(Dbtup); +BLOCK_FUNCTIONS(Dbtup) /* **************************************************************** */ /* ---------------------------------------------------------------- */ diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 8f49b7fa6d6..8af83e3c056 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -1066,7 +1066,7 @@ Dbtux::Index::Index() : m_fragId[i] = ZNIL; m_fragPtrI[i] = RNIL; }; -}; +} // Dbtux::Frag @@ -1103,7 +1103,7 @@ Dbtux::FragOp::FragOp() : m_fragNo(ZNIL), m_numAttrsRecvd(ZNIL) { -}; +} // Dbtux::NodeHandle diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index 18aa914de05..8990d6c86b6 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -293,4 +293,4 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 #endif } -BLOCK_FUNCTIONS(Dbtux); +BLOCK_FUNCTIONS(Dbtux) diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index f7e8981e122..b94bb8e6d7e 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -158,7 +158,7 @@ DbUtil::~DbUtil() { } -BLOCK_FUNCTIONS(DbUtil); +BLOCK_FUNCTIONS(DbUtil) void DbUtil::releasePrepare(PreparePtr prepPtr) { diff --git a/ndb/src/kernel/blocks/grep/GrepInit.cpp b/ndb/src/kernel/blocks/grep/GrepInit.cpp index cfb454a1f9b..36855f86568 100644 --- a/ndb/src/kernel/blocks/grep/GrepInit.cpp +++ b/ndb/src/kernel/blocks/grep/GrepInit.cpp @@ -132,7 +132,7 @@ Grep::~Grep() { } -BLOCK_FUNCTIONS(Grep); +BLOCK_FUNCTIONS(Grep) Grep::PSPart::PSPart(Grep * sb) : BlockComponent(sb), diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 43044eeebcd..c7b472fc91a 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -114,4 +114,4 @@ Ndbcntr::~Ndbcntr() }//Ndbcntr::~Ndbcntr() -BLOCK_FUNCTIONS(Ndbcntr); +BLOCK_FUNCTIONS(Ndbcntr) diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 56e3d3abbed..d30b956e74a 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -1010,7 +1010,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(Ndbfs); +BLOCK_FUNCTIONS(Ndbfs) template class Vector; template class Vector; diff --git a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp index d3407e8d4e7..d093089acfc 100644 --- a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp @@ -196,5 +196,5 @@ VoidFs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(VoidFs); +BLOCK_FUNCTIONS(VoidFs) diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index b0f1088779c..d6960ce154e 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -100,4 +100,4 @@ Qmgr::~Qmgr() }//Qmgr::~Qmgr() -BLOCK_FUNCTIONS(Qmgr); +BLOCK_FUNCTIONS(Qmgr) diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index f6d9a0ac35a..836fa28d9ad 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -3553,7 +3553,7 @@ Suma::Restart::Restart(Suma& s) : suma(s) { c_okToStart[i] = false; c_waitingToStart[i] = false; } -}; +} void Suma::Restart::resetNode(Uint32 sumaRef) diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index 255abd47c94..36217c313af 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -188,6 +188,6 @@ Suma::~Suma() { } -BLOCK_FUNCTIONS(Suma); -BLOCK_FUNCTIONS(SumaParticipant); +BLOCK_FUNCTIONS(Suma) +BLOCK_FUNCTIONS(SumaParticipant) diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp index 80cf9f88c0d..75bc19b6a20 100644 --- a/ndb/src/kernel/blocks/trix/Trix.cpp +++ b/ndb/src/kernel/blocks/trix/Trix.cpp @@ -962,6 +962,6 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec) } } -BLOCK_FUNCTIONS(Trix); +BLOCK_FUNCTIONS(Trix) template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index d0e1207cef0..c6c30a0f520 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -130,7 +130,7 @@ MgmtSrvr::signalRecvThreadRun() (this->*handler->function)(signal); } } -}; +} EventLogger g_EventLogger; diff --git a/ndb/src/ndbapi/NdbEventOperation.cpp b/ndb/src/ndbapi/NdbEventOperation.cpp index 506a6c8d86d..d209293f8b0 100644 --- a/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/ndb/src/ndbapi/NdbEventOperation.cpp @@ -121,5 +121,5 @@ NdbEventOperation::wait(void *p, int aMillisecondNumber) } NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl) - : m_impl(impl) {}; + : m_impl(impl) {} diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 38b1c70c047..0c851427ba5 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -397,7 +397,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, (m_operation->* branch)(4, 5, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::eq(int AttrId, Uint32 value){ @@ -478,7 +478,7 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ Branch1 branch = table2[op].m_branches[m_current.m_group]; (m_operation->* branch)(AttrId, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::isnull(int AttrId){ diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 277cdc72532..fa616ee8fee 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -260,16 +260,16 @@ TupleS & TupleS::operator=(const TupleS& tuple) memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData)); return *this; -}; +} int TupleS::getNoOfAttributes() const { if (m_currentTable == 0) return 0; return m_currentTable->getNoOfAttributes(); -}; +} TableS * TupleS::getTable() const { return m_currentTable; -}; +} const AttributeDesc * TupleS::getDesc(int i) const { return m_currentTable->allAttributesDesc[i]; @@ -277,7 +277,7 @@ const AttributeDesc * TupleS::getDesc(int i) const { AttributeData * TupleS::getData(int i) const{ return &(allAttrData[i]); -}; +} bool TupleS::prepareRecord(TableS & tab){ diff --git a/sql/item_create.h b/sql/item_create.h index 7577627ef04..faff6f45220 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -87,7 +87,7 @@ Item *create_func_soundex(Item* a); Item *create_func_space(Item *); Item *create_func_sqrt(Item* a); Item *create_func_strcmp(Item* a, Item *b); -Item *create_func_tan(Item* a);; +Item *create_func_tan(Item* a); Item *create_func_time_format(Item *a, Item *b); Item *create_func_time_to_sec(Item* a); Item *create_func_to_days(Item* a); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 0e2058d73e9..bd42a2c1720 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -374,7 +374,7 @@ inline Query_cache_block * Query_cache_block_table::block() return (Query_cache_block *)(((byte*)this) - ALIGN_SIZE(sizeof(Query_cache_block_table)*n) - ALIGN_SIZE(sizeof(Query_cache_block))); -}; +} /***************************************************************************** Query_cache_block method(s) diff --git a/tests/client_test.c b/tests/client_test.c index fb130a17361..0575b355b05 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11320,7 +11320,7 @@ static void test_bug4172() MYSQL_ROW row; int rc; char f[100], d[100], e[100]; - long f_len, d_len, e_len; + ulong f_len, d_len, e_len; myheader("test_bug4172"); @@ -11411,8 +11411,8 @@ static void test_conversion() mysql_stmt_bind_param(stmt, bind); - buff[0]= 0xC3; - buff[1]= 0xA0; + buff[0]= (uchar) 0xC3; + buff[1]= (uchar) 0xA0; length= 2; rc= mysql_stmt_execute(stmt); -- cgit v1.2.1 From da2c55b3abf214af17624e82d9963ddf8f3851c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:04:51 +0200 Subject: Test for BUG#6054. The bug itsel is fixed by the fix for #5837. mysql-test/r/update.result: test results mysql-test/t/update.test: bug test --- mysql-test/r/update.result | 6 ++++++ mysql-test/t/update.test | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index c9405d71237..08b7f942ccc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -203,3 +203,9 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; +drop table if exists t1, t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 1850564418c..fdf6a57cc11 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -155,3 +155,12 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; +# +# Bug #6054 +# +drop table if exists t1, t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; -- cgit v1.2.1 From 8722bb9a09a1b1c84f909fc6079601127237028a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:44:39 +0200 Subject: Moved drop table statement to the end. mysql-test/r/update.result: moved drop statement mysql-test/t/update.test: moved drop statement --- mysql-test/r/update.result | 1 + mysql-test/t/update.test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 08b7f942ccc..2d0903a4dae 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -209,3 +209,4 @@ create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index fdf6a57cc11..62439dcc51b 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -158,9 +158,9 @@ DROP TABLE t2; # # Bug #6054 # -drop table if exists t1, t2; create table t1 (c1 int, c2 char(6), c3 int); create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; -- cgit v1.2.1 From ae6f147a4f65b0392e61c6d447523fa9b6db186f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:46:38 +0200 Subject: Test for BUG#6054. The bug itsel is fixed by the fix for #5837. mysql-test/r/update.result: test result mysql-test/t/update.test: test queries --- mysql-test/r/update.result | 6 ++++++ mysql-test/t/update.test | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 6d2e623a6fb..beab6105f79 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -206,3 +206,9 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index aeefa3c33f5..704263b1216 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -161,3 +161,12 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; +# +# Bug #6054 +# +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; -- cgit v1.2.1 From 4869f022fd4761445843135102790691e8d48861 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:12:22 +0100 Subject: A change of behaviour of Seconds_Behind_Master from SHOW SLAVE STATUS. It's going into 4.1 because old behaviour was somewhat nonsensical (kind of bug). Changes are that if repl threads are down or disconnected the column will be NULL, and if master is idle the column will not grow indefinitely anymore. sql/slave.cc: mi->slave_running and rli->slave_running now uints (was needed only for mi but because of start_slave_thread() usage, had to change both). So mi->slave_running can now take 3 values: not running, running & not connected, running and connected. The last value serves for calculation of Seconds_Behind_Master in SHOW SLAVE STATUS. Changing this column's behaviour: if SQL or I/O thread is not running, or if I/O thread is not connected (for example if it is reconnecting), it's NULL (to mean "unknown"). And if master is idle, the column will not grow indefinitely like it used to (that was meaningless); this is fixed by forcing a value of 0 when the slave SQL thread has hit EOF of relay log (which has only a limited number of caveats explained in comments in code). sql/slave.h: slave_running used to be bool but we need to distinguish, for the I/O slave thread, between "running & connected" and "running & not connected" ("running" means the thread exists). sql/sql_repl.cc: we don't need anymore to set rli->last_master_timestamp to 0 (we used that to make Seconds_Behind_Master be NULL) in RESET SLAVE and CHANGE MASTER, as these commands imply that slave threads are not running and so Seconds_Behind_Master is already NULL because of that. --- sql/slave.cc | 61 +++++++++++++++++++++++++++++++++++++++++++++------------ sql/slave.h | 27 ++++++++++++++++++++----- sql/sql_repl.cc | 8 ++++---- 3 files changed, 74 insertions(+), 22 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index bd9650ed369..90c75243f3d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -545,7 +545,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, pthread_mutex_t *cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running) + volatile uint *slave_running) { if (term_lock) { @@ -583,7 +583,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, pthread_mutex_t *cond_lock, pthread_cond_t *start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority) @@ -963,7 +963,7 @@ void end_slave() static bool io_slave_killed(THD* thd, MASTER_INFO* mi) { DBUG_ASSERT(mi->io_thd == thd); - DBUG_ASSERT(mi->slave_running == 1); // tracking buffer overrun + DBUG_ASSERT(mi->slave_running); // tracking buffer overrun return mi->abort_slave || abort_loop || thd->killed; } @@ -1767,19 +1767,13 @@ void init_master_info_with_options(MASTER_INFO* mi) strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1); } -static void clear_slave_error(RELAY_LOG_INFO* rli) +void clear_slave_error(RELAY_LOG_INFO* rli) { /* Clear the errors displayed by SHOW SLAVE STATUS */ rli->last_slave_error[0]= 0; rli->last_slave_errno= 0; } -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli) -{ - rli->last_master_timestamp= 0; - clear_slave_error(rli); -} - /* Reset UNTIL condition for RELAY_LOG_INFO SYNOPSYS @@ -2166,6 +2160,11 @@ int show_master_info(THD* thd, MASTER_INFO* mi) String *packet= &thd->packet; protocol->prepare_for_resend(); + /* + TODO: we read slave_running without run_lock, whereas these variables + are updated under run_lock and not data_lock. In 5.0 we should lock + run_lock on top of data_lock (with good order). + */ pthread_mutex_lock(&mi->data_lock); pthread_mutex_lock(&mi->rli.data_lock); @@ -2226,7 +2225,12 @@ int show_master_info(THD* thd, MASTER_INFO* mi) protocol->store(mi->ssl_cipher, &my_charset_bin); protocol->store(mi->ssl_key, &my_charset_bin); - if (mi->rli.last_master_timestamp) + /* + Seconds_Behind_Master: if SQL thread is running and I/O thread is + connected, we can compute it otherwise show NULL (i.e. unknown). + */ + if ((mi->slave_running == MYSQL_SLAVE_RUN_CONNECT) && + mi->rli.slave_running) { long tmp= (long)((time_t)time((time_t*) 0) - mi->rli.last_master_timestamp) @@ -2246,9 +2250,13 @@ int show_master_info(THD* thd, MASTER_INFO* mi) slave is 2. At SHOW SLAVE STATUS time, assume that the difference between timestamp of slave and rli->last_master_timestamp is 0 (i.e. they are in the same second), then we get 0-(2-1)=-1 as a result. - This confuses users, so we don't go below 0. + This confuses users, so we don't go below 0: hence the max(). + + last_master_timestamp == 0 (an "impossible" timestamp 1970) is a + special marker to say "consider we have caught up". */ - protocol->store((longlong)(max(0, tmp))); + protocol->store((longlong)(mi->rli.last_master_timestamp ? max(0, tmp) + : 0)); } else protocol->store_null(); @@ -3041,6 +3049,8 @@ slave_begin: connected: + // TODO: the assignment below should be under mutex (5.0) + mi->slave_running= MYSQL_SLAVE_RUN_CONNECT; thd->slave_net = &mysql->net; thd->proc_info = "Checking master version"; if (get_master_version_and_clock(mysql, mi)) @@ -3072,6 +3082,7 @@ dump"); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3148,6 +3159,7 @@ max_allowed_packet", mysql_error(mysql)); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info = "Waiting to reconnect after a failed master event read"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3323,6 +3335,14 @@ slave_begin: pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); + /* + We are going to set slave_running to 1. Assuming slave I/O thread is + alive and connected, this is going to make Seconds_Behind_Master be 0 + i.e. "caught up". Even if we're just at start of thread. Well it's ok, at + the moment we start we can think we are caught up, and the next second we + start receiving data so we realize we are not caught up and + Seconds_Behind_Master grows. No big deal. + */ rli->slave_running = 1; rli->abort_slave = 0; pthread_mutex_unlock(&rli->run_lock); @@ -4211,10 +4231,25 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); + /* + We say in Seconds_Behind_Master that we have "caught up". Note that + for example if network link is broken but I/O slave thread hasn't + noticed it (slave_net_timeout not elapsed), then we'll say "caught + up" whereas we're not really caught up. Fixing that would require + internally cutting timeout in smaller pieces in network read, no + thanks. Another example: SQL has caught up on I/O, now I/O has read + a new event and is queuing it; the false "0" will exist until SQL + finishes executing the new event; it will be look abnormal only if + the events have old timestamps (then you get "many", 0, "many"). + Transient phases like this can't really be fixed. + */ + time_t save_timestamp= rli->last_master_timestamp; + rli->last_master_timestamp= 0; // Note that wait_for_update unlocks lock_log ! rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier pthread_mutex_lock(&rli->data_lock); + rli->last_master_timestamp= save_timestamp; continue; } /* diff --git a/sql/slave.h b/sql/slave.h index 08cf0806717..bcd79dd4a39 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -98,6 +98,21 @@ enum enum_binlog_formats { BINLOG_FORMAT_323_LESS_57, BINLOG_FORMAT_323_GEQ_57 }; +/* + 3 possible values for MASTER_INFO::slave_running and + RELAY_LOG_INFO::slave_running. + The values 0,1,2 are very important: to keep the diff small, I didn't + substitute places where we use 0/1 with the newly defined symbols. So don't change + these values. + The same way, code is assuming that in RELAY_LOG_INFO we use only values + 0/1. + I started with using an enum, but + enum_variable=1; is not legal so would have required many line changes. +*/ +#define MYSQL_SLAVE_NOT_RUN 0 +#define MYSQL_SLAVE_RUN_NOT_CONNECT 1 +#define MYSQL_SLAVE_RUN_CONNECT 2 + /**************************************************************************** Replication SQL Thread @@ -251,7 +266,8 @@ typedef struct st_relay_log_info /* if not set, the value of other members of the structure are undefined */ bool inited; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; /* Condition and its parameters from START SLAVE UNTIL clause. @@ -385,7 +401,8 @@ typedef struct st_master_info #endif bool inited; enum enum_binlog_formats old_format; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; volatile ulong slave_run_id; /* The difference in seconds between the clock of the master and the clock of @@ -464,7 +481,7 @@ int terminate_slave_threads(MASTER_INFO* mi, int thread_mask, int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex, pthread_mutex_t* cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running); + volatile uint* slave_running); int start_slave_threads(bool need_slave_mutex, bool wait_for_start, MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, int thread_mask); @@ -477,7 +494,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, pthread_mutex_t *cond_lock, pthread_cond_t* start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority); @@ -519,7 +536,7 @@ void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); void end_slave(); /* clean up */ void init_master_info_with_options(MASTER_INFO* mi); void clear_until_condition(RELAY_LOG_INFO* rli); -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli); +void clear_slave_error(RELAY_LOG_INFO* rli); int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, bool abort_if_no_master_info_file, diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 6854cb24ee9..2f0d8d3aa0d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -880,10 +880,10 @@ int reset_slave(THD *thd, MASTER_INFO* mi) */ init_master_info_with_options(mi); /* - Reset errors, and master timestamp (the idea is that we forget about the + Reset errors (the idea is that we forget about the old master). */ - clear_slave_error_timestamp(&mi->rli); + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); // close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0 @@ -1143,8 +1143,8 @@ int change_master(THD* thd, MASTER_INFO* mi) pthread_mutex_lock(&mi->rli.data_lock); mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */ - /* Clear the errors, for a clean start, and master timestamp */ - clear_slave_error_timestamp(&mi->rli); + /* Clear the errors, for a clean start */ + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); /* If we don't write new coordinates to disk now, then old will remain in -- cgit v1.2.1 From 1b17ba5244d654cdcc5171fbd6e777e5a1a2f34a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 20:26:24 +0100 Subject: Have 'mysql-test-run' write a list of all failed tests at the end, if run with '--force'. mysql-test/mysql-test-run.sh: Backport an improvement from 4.1: If the tool is run with '--force', give a list of all test cases that failed at the end. This is essential for automated analysis of the build logs file. --- mysql-test/mysql-test-run.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index d47560fe7a6..b760309bb5b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -4,6 +4,7 @@ # Sligtly updated by Monty # Cleaned up again by Matt # Fixed by Sergei +# List of failed cases (--force) backported from 4.1 by Joerg # :-) #++ @@ -202,6 +203,7 @@ MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log MYSQL_MANAGER_USER=root NO_SLAVE=0 USER_TEST= +FAILED_CASES= EXTRA_MASTER_OPT="" EXTRA_MYSQL_TEST_OPT="" @@ -1333,7 +1335,7 @@ run_testcase () show_failed_diff $result_file $ECHO if [ x$FORCE != x1 ] ; then - $ECHO "Aborting. To continue, re-run with '--force'." + $ECHO "Aborting: $tname failed. To continue, re-run with '--force'." $ECHO if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then @@ -1342,7 +1344,7 @@ run_testcase () fi exit 1 fi - + FAILED_CASES="$FAILED_CASES $tname" if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then mysql_restart @@ -1485,4 +1487,10 @@ $ECHO [ "$DO_GCOV" ] && gcov_collect # collect coverage information [ "$DO_GPROF" ] && gprof_collect # collect coverage information -exit 0 +if [ $TOT_FAIL -ne 0 ]; then + $ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES" + $ECHO + exit 1 +else + exit 0 +fi -- cgit v1.2.1 From 4935b27c47eaa581878ebfbb817485aef4a57704 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 22:19:59 +0100 Subject: merge --- ndb/src/kernel/vm/SimulatedBlock.hpp | 4 ++-- ndb/src/mgmsrv/ConfigInfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index fd59fef49db..cff19734368 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -76,7 +76,6 @@ typedef struct NewVar } NewVARIABLE; /* 128 bits */ class SimulatedBlock { - friend class MutexManager; friend class SafeCounter; friend class SafeCounterManager; friend struct UpgradeStartup; @@ -468,7 +467,8 @@ public: BlockReference reference() const; void progError(int line, int err_code, const char* extra = 0); }; - + + friend class MutexManager; MutexManager c_mutexMgr; void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal); diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 577e4311932..ab2e34f6d3a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -1730,9 +1730,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, -- cgit v1.2.1 From 082bf702a575ddfef7e7688275d920b7a6c12e21 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 22:38:42 +0100 Subject: Very minor fixes for Seconds_Behind_Master column of SHOW SLAVE STATUS. sql/log_event.cc: comment sql/slave.cc: putting setting of rli->last_master_timestamp a few lines above, so that it is done under rli->data_lock. --- sql/log_event.cc | 3 +++ sql/slave.cc | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 087e58a7bad..c027c3a8ee4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -373,6 +373,9 @@ int Log_event::exec_event(struct st_relay_log_info* rli) Note that Rotate_log_event::exec_event() does not call this function, so there is no chance that a fake rotate event resets last_master_timestamp. + Note that we update without mutex (probably ok - except in some very + rare cases, only consequence is that value may take some time to + display in Seconds_Behind_Master - not critical). */ rli->last_master_timestamp= when; } diff --git a/sql/slave.cc b/sql/slave.cc index 90c75243f3d..ef9caa5f5b5 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4189,6 +4189,21 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ if (hot_log) { + /* + We say in Seconds_Behind_Master that we have "caught up". Note that + for example if network link is broken but I/O slave thread hasn't + noticed it (slave_net_timeout not elapsed), then we'll say "caught + up" whereas we're not really caught up. Fixing that would require + internally cutting timeout in smaller pieces in network read, no + thanks. Another example: SQL has caught up on I/O, now I/O has read + a new event and is queuing it; the false "0" will exist until SQL + finishes executing the new event; it will be look abnormal only if + the events have old timestamps (then you get "many", 0, "many"). + Transient phases like this can't really be fixed. + */ + time_t save_timestamp= rli->last_master_timestamp; + rli->last_master_timestamp= 0; + DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count); /* We can, and should release data_lock while we are waiting for @@ -4231,20 +4246,6 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); - /* - We say in Seconds_Behind_Master that we have "caught up". Note that - for example if network link is broken but I/O slave thread hasn't - noticed it (slave_net_timeout not elapsed), then we'll say "caught - up" whereas we're not really caught up. Fixing that would require - internally cutting timeout in smaller pieces in network read, no - thanks. Another example: SQL has caught up on I/O, now I/O has read - a new event and is queuing it; the false "0" will exist until SQL - finishes executing the new event; it will be look abnormal only if - the events have old timestamps (then you get "many", 0, "many"). - Transient phases like this can't really be fixed. - */ - time_t save_timestamp= rli->last_master_timestamp; - rli->last_master_timestamp= 0; // Note that wait_for_update unlocks lock_log ! rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier -- cgit v1.2.1 From 8d9badb36e2bccd7f5e249235e05a1c653259391 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 23:14:41 +0100 Subject: A .test for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB" which Heikki fixed in 4.1.8 and 4.0.23. I verified that without Heikki's patch the test fails (7 gets inserted). Test added to 4.1 because in testsuite of 4.0 it's impossible to start slave with InnoDB. --- mysql-test/r/rpl_insert_ignore.result | 70 +++++++++++++++++++++++++++++++ mysql-test/t/rpl_insert_ignore-slave.opt | 1 + mysql-test/t/rpl_insert_ignore.test | 71 ++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 mysql-test/r/rpl_insert_ignore.result create mode 100644 mysql-test/t/rpl_insert_ignore-slave.opt create mode 100644 mysql-test/t/rpl_insert_ignore.test diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/r/rpl_insert_ignore.result new file mode 100644 index 00000000000..da24c86627c --- /dev/null +++ b/mysql-test/r/rpl_insert_ignore.result @@ -0,0 +1,70 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=innodb; +CREATE TABLE t2 ( +a int unsigned, # to force INSERT SELECT to have a certain order +b int unsigned +) ENGINE=innodb; +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=myisam; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1, t2; diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/t/rpl_insert_ignore-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test new file mode 100644 index 00000000000..58eaa287817 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore.test @@ -0,0 +1,71 @@ +# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB" +# The bug was that if on master, INSERT IGNORE ignored some +# rows, and the table was InnoDB with auto_inc column, then on slave +# some rows received an auto_inc bigger than on master. +# Slave needs to be started with --innodb to store table in InnoDB. +# Same test for MyISAM (which had no bug). + +-- source include/have_innodb.inc + +-- source include/master-slave.inc + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=innodb; + +CREATE TABLE t2 ( + a int unsigned, # to force INSERT SELECT to have a certain order + b int unsigned +) ENGINE=innodb; + + +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); + +# An alternation of values which will conflict in t1 and will not. + +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +# Compare results + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +# Now do the same for MyISAM + +connection master; +drop table t1; +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=myisam; + +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +connection master; +drop table t1, t2; +sync_slave_with_master; -- cgit v1.2.1 From 2e4fda1c531bfd355d7c7296ca39083c41ff763c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 06:55:21 +0100 Subject: Bumb up ndb version --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 760e7ee20fb..7f7e6438e66 100644 --- a/configure.in +++ b/configure.in @@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 -NDB_VERSION_BUILD=8 +NDB_VERSION_BUILD=9 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? -- cgit v1.2.1 From cd2e3aca3491b204e702b47713598513ab945e50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 09:55:23 +0100 Subject: moved some Ndb member variables to NdbImpl class removed theCurrentConnectCounter optimized the_release_ind by using pos[0] to indicate that there is something there smaller storage of theDBNodes array by using Uint8 set the_relase_ind array to Uint32 to avoid possible parallell thread usage errors --- ndb/include/ndbapi/Ndb.hpp | 11 +---------- ndb/src/ndbapi/Ndb.cpp | 37 +++++++++++++------------------------ ndb/src/ndbapi/NdbConnection.cpp | 4 ++-- ndb/src/ndbapi/NdbImpl.hpp | 33 +++++++++++++++++++++------------ ndb/src/ndbapi/NdbReceiver.cpp | 4 ++-- ndb/src/ndbapi/Ndbif.cpp | 21 ++++++++++++--------- ndb/src/ndbapi/Ndbinit.cpp | 30 ++++++++++++++---------------- ndb/src/ndbapi/Ndblist.cpp | 39 +++++++++++---------------------------- 8 files changed, 76 insertions(+), 103 deletions(-) diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 5ec09269695..1c9c2db5d6b 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -1586,7 +1586,6 @@ private: /****************************************************************************** * These are the private variables in this class. *****************************************************************************/ - NdbObjectIdMap* theNdbObjectIdMap; Ndb_cluster_connection *m_ndb_cluster_connection; NdbConnection** thePreparedTransactionsArray; @@ -1637,10 +1636,6 @@ private: Uint32 theMyRef; // My block reference Uint32 theNode; // The node number of our node - Uint32 theNoOfDBnodes; // The number of DB nodes - Uint32 * theDBnodes; // The node number of the DB nodes - Uint8 *the_release_ind;// 1 indicates to release all connections to node - Uint64 the_last_check_time; Uint64 theFirstTransId; @@ -1663,10 +1658,6 @@ private: InitConfigError } theInitState; - // Ensure good distribution of connects - Uint32 theCurrentConnectIndex; - Uint32 theCurrentConnectCounter; - /** * Computes fragement id for primary key * @@ -1692,7 +1683,7 @@ private: Uint32 noOfFragments; Uint32 * fragment2PrimaryNodeMap; - void init(Uint32 noOfNodes, Uint32 nodeIds[]); + void init(Uint32 noOfNodes, Uint8 nodeIds[]); void release(); } startTransactionNodeSelectionData; diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 75ae539fc8b..ddfe94c1421 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -65,37 +65,25 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode) // We will connect to any node. Make sure that we have connections to all // nodes. //**************************************************************************** - Uint32 tNoOfDbNodes = theNoOfDBnodes; - i = theCurrentConnectIndex; + Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; + Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; UintR Tcount = 0; do { - if (i >= tNoOfDbNodes) { - i = 0; + theCurrentConnectIndex++; + if (theCurrentConnectIndex >= tNoOfDbNodes) { + theCurrentConnectIndex = 0; }//if Tcount++; - tNode = theDBnodes[i]; + tNode = theImpl->theDBnodes[theCurrentConnectIndex]; TretCode = NDB_connect(tNode); if ((TretCode == 1) || (TretCode == 2)) { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - if (theCurrentConnectIndex == i) { - theCurrentConnectCounter++; - if (theCurrentConnectCounter == 8) { - theCurrentConnectCounter = 1; - theCurrentConnectIndex++; - }//if - } else { - // Set to 2 because we have already connected to a node - // when we get here. - theCurrentConnectCounter = 2; - theCurrentConnectIndex = i; - }//if return getConnectedNdbConnection(tNode); } else if (TretCode != 0) { tAnyAlive = 1; }//if - i++; } while (Tcount < tNoOfDbNodes); //**************************************************************************** // We were unable to find a free connection. If no node alive we will report @@ -211,8 +199,9 @@ Ndb::doDisconnect() NdbConnection* tNdbCon; CHECK_STATUS_MACRO_VOID; - DBUG_PRINT("info", ("theNoOfDBnodes=%d", theNoOfDBnodes)); - Uint32 tNoOfDbNodes = theNoOfDBnodes; + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; + DBUG_PRINT("info", ("theNoOfDBnodes=%d", tNoOfDbNodes)); UintR i; for (i = 0; i < tNoOfDbNodes; i++) { Uint32 tNode = theDBnodes[i]; @@ -259,8 +248,8 @@ Ndb::waitUntilReady(int timeout) unsigned int foundAliveNode = 0; TransporterFacade *tp = TransporterFacade::instance(); tp->lock_mutex(); - for (unsigned int i = 0; i < theNoOfDBnodes; i++) { - const NodeId nodeId = theDBnodes[i]; + for (unsigned int i = 0; i < theImpl->theNoOfDBnodes; i++) { + const NodeId nodeId = theImpl->theDBnodes[i]; //************************************************ // If any node is answering, ndb is answering //************************************************ @@ -270,7 +259,7 @@ Ndb::waitUntilReady(int timeout) }//for tp->unlock_mutex(); - if (foundAliveNode == theNoOfDBnodes) { + if (foundAliveNode == theImpl->theNoOfDBnodes) { DBUG_RETURN(0); }//if if (foundAliveNode > 0) { @@ -1077,7 +1066,7 @@ Ndb::guessPrimaryNode(Uint32 fragmentId){ void Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, - Uint32 nodeIds[]) { + Uint8 nodeIds[]) { kValue = 6; noOfFragments = 2 * noOfNodes; diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index f4bb000300a..01012bfda01 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -83,7 +83,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : { theListState = NotInList; theError.code = 0; - theId = theNdb->theNdbObjectIdMap->map(this); + theId = theNdb->theImpl->theNdbObjectIdMap.map(this); #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) @@ -99,7 +99,7 @@ Remark: Deletes the connection object. NdbConnection::~NdbConnection() { DBUG_ENTER("NdbConnection::~NdbConnection"); - theNdb->theNdbObjectIdMap->unmap(theId, this); + theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this); DBUG_VOID_RETURN; }//NdbConnection::~NdbConnection() diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 1fb1969b589..cd1364e15fb 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -17,7 +17,15 @@ #ifndef NDB_IMPL_HPP #define NDB_IMPL_HPP -#include +#include +#include +#include +#include +#include +#include + +#include + #include "ObjectMap.hpp" /** @@ -25,19 +33,20 @@ */ class NdbImpl { public: - Vector m_invalidTables; + NdbImpl(); + ~NdbImpl(); - void checkErrorCode(Uint32 i); - void checkInvalidTable(class NdbDictionaryImpl * dict); -}; + // Ensure good distribution of connects + Uint32 theCurrentConnectIndex; -#include -#include -#include -#include -#include + NdbObjectIdMap theNdbObjectIdMap; -#include + Uint32 theNoOfDBnodes; // The number of DB nodes + Uint8 theDBnodes[MAX_NDB_NODES]; // The node number of the DB nodes + + // 1 indicates to release all connections to node + Uint32 the_release_ind[MAX_NDB_NODES]; +}; #ifdef VM_TRACE #define TRACE_DEBUG(x) ndbout << x << endl; @@ -57,7 +66,7 @@ public: inline void * Ndb::int2void(Uint32 val){ - return theNdbObjectIdMap->getObject(val); + return theImpl->theNdbObjectIdMap.getObject(val); } inline diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 14f8d4b8440..cad247512b2 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -40,7 +40,7 @@ NdbReceiver::~NdbReceiver() { DBUG_ENTER("NdbReceiver::~NdbReceiver"); if (m_id != NdbObjectIdMap::InvalidId) { - m_ndb->theNdbObjectIdMap->unmap(m_id, this); + m_ndb->theImpl->theNdbObjectIdMap.unmap(m_id, this); } delete[] m_rows; DBUG_VOID_RETURN; @@ -54,7 +54,7 @@ NdbReceiver::init(ReceiverType type, void* owner) m_owner = owner; if (m_id == NdbObjectIdMap::InvalidId) { if (m_ndb) - m_id = m_ndb->theNdbObjectIdMap->map(this); + m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); } theFirstRecAttr = NULL; diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index c011c1a6a26..232e55662f0 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -92,8 +92,8 @@ Ndb::init(int aMaxNoOfTransactions) theDictionary->setTransporter(this, theFacade); - aNrOfCon = theNoOfDBnodes; - aNrOfOp = 2*theNoOfDBnodes; + aNrOfCon = theImpl->theNoOfDBnodes; + aNrOfOp = 2*theImpl->theNoOfDBnodes; // Create connection object in a linked list if((createConIdleList(aNrOfCon)) == -1){ @@ -192,14 +192,14 @@ void Ndb::connected(Uint32 ref) } TransporterFacade * theFacade = TransporterFacade::instance(); - int i; - theNoOfDBnodes= 0; + int i, n= 0; for (i = 1; i < MAX_NDB_NODES; i++){ if (theFacade->getIsDbNode(i)){ - theDBnodes[theNoOfDBnodes] = i; - theNoOfDBnodes++; + theImpl->theDBnodes[n] = i; + n++; } } + theImpl->theNoOfDBnodes= n; theFirstTransId = ((Uint64)tBlockNo << 52)+ ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; @@ -207,9 +207,10 @@ void Ndb::connected(Uint32 ref) DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", theMyRef, tmpTheNode, - theNoOfDBnodes, + theImpl->theNoOfDBnodes, theFirstTransId)); - startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes); + startTransactionNodeSelectionData.init(theImpl->theNoOfDBnodes, + theImpl->theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -247,7 +248,9 @@ Ndb::report_node_failure(Uint32 node_id) * * This method is only called by ClusterMgr (via lots of methods) */ - the_release_ind[node_id] = 1; + theImpl->the_release_ind[node_id] = 1; + // must come after + theImpl->the_release_ind[0] = 1; theWaiter.nodeFail(node_id); return; }//Ndb::report_node_failure() diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 48e62c36a5f..9754c25ab15 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -82,7 +82,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - theNdbObjectIdMap= 0; m_ndb_cluster_connection= ndb_cluster_connection; thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; @@ -110,9 +109,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theCallList= NULL; theScanList= NULL; theNdbBlobIdleList= NULL; - theNoOfDBnodes= 0; - theDBnodes= NULL; - the_release_ind= NULL; the_last_check_time= 0; theFirstTransId= 0; theRestartGCI= 0; @@ -134,19 +130,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theError.code = 0; - theNdbObjectIdMap = new NdbObjectIdMap(1024,1024); theConnectionArray = new NdbConnection * [MAX_NDB_NODES]; - theDBnodes = new Uint32[MAX_NDB_NODES]; - the_release_ind = new Uint8[MAX_NDB_NODES]; theCommitAckSignal = NULL; - theCurrentConnectCounter = 1; - theCurrentConnectIndex = 0; int i; for (i = 0; i < MAX_NDB_NODES ; i++) { theConnectionArray[i] = NULL; - the_release_ind[i] = 0; - theDBnodes[i] = 0; }//forg for (i = 0; i < 2048 ; i++) { theFirstTupleId[i] = 0; @@ -213,7 +202,6 @@ Ndb::~Ndb() doDisconnect(); delete theDictionary; - delete theImpl; NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); @@ -260,15 +248,12 @@ Ndb::~Ndb() startTransactionNodeSelectionData.release(); delete []theConnectionArray; - delete []theDBnodes; - delete []the_release_ind; if(theCommitAckSignal != NULL){ delete theCommitAckSignal; theCommitAckSignal = NULL; } - if(theNdbObjectIdMap != 0) - delete theNdbObjectIdMap; + delete theImpl; /** * This sleep is to make sure that the transporter @@ -307,4 +292,17 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } +NdbImpl::NdbImpl() : theNdbObjectIdMap(1024,1024), + theCurrentConnectIndex(0), + theNoOfDBnodes(0) +{ + int i; + for (i = 0; i < MAX_NDB_NODES; i++) { + the_release_ind[i] = 0; + } +} + +NdbImpl::~NdbImpl() +{ +} diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index a5f2a4801d5..5902aa413dc 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -30,10 +30,18 @@ void Ndb::checkFailedNode() { DBUG_ENTER("Ndb::checkFailedNode"); - DBUG_PRINT("enter", ("theNoOfDBnodes: %d", theNoOfDBnodes)); + Uint32 *the_release_ind= theImpl->the_release_ind; + if (the_release_ind[0] == 0) + { + DBUG_VOID_RETURN; + } + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; + + DBUG_PRINT("enter", ("theNoOfDBnodes: %d", tNoOfDbNodes)); - DBUG_ASSERT(theNoOfDBnodes < MAX_NDB_NODES); - for (Uint32 i = 0; i < theNoOfDBnodes; i++){ + DBUG_ASSERT(tNoOfDbNodes < MAX_NDB_NODES); + for (Uint32 i = 0; i < tNoOfDbNodes; i++){ const NodeId node_id = theDBnodes[i]; DBUG_PRINT("info", ("i: %d, node_id: %d", i, node_id)); @@ -56,31 +64,6 @@ Ndb::checkFailedNode() DBUG_VOID_RETURN; } -#if 0 -void -NdbImpl::checkInvalidTable(NdbDictionaryImpl * dict){ - Uint32 sz = m_invalidTables.size(); - for(Int32 i = sz - 1; i >= 0; i--){ - NdbTableImpl * tab = m_invalidTables[i]; - m_invalidTables.erase(i); - dict->tableDropped(* tab); - } -} - -void -NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){ - switch(i){ - case 241: - case 283: - case 284: - case 285: - case 1225: - case 1226: - - } -} -#endif - /*************************************************************************** * int createConIdleList(int aNrOfCon); * -- cgit v1.2.1 From f7193b925455ede2b97ccde36c96732446d1db7e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:14:45 +0300 Subject: Fix for BUG#6825: When calculating Item_func_neg::max_length, add 1 for '-'. For numeric constants we only need to add, since the parser doesn't produce negative numbers. For strings we only add (we actually could substract 1 if given string is a constant and it has '-number' form but we're not doing that because * we set max_length bigger then necessary in other cases as well. * the current solution is simpler and safer (bigger max_length is better then cutting out) mysql-test/r/func_concat.result: Test for BUG#6825 mysql-test/r/metadata.result: Ajusted results according to fix of bug BUG#6825:length(-1) = 2 , not 1 mysql-test/t/func_concat.test: Test for BUG#6825 --- mysql-test/r/func_concat.result | 36 ++++++++++++++++++++++++++++++++++++ mysql-test/r/metadata.result | 2 +- mysql-test/t/func_concat.test | 16 ++++++++++++++++ sql/item_func.cc | 16 ++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index ec53d6d87b0..419413e4156 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -32,3 +32,39 @@ 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; +select 'a' union select concat('a', -4); +a +a +a-4 +select 'a' union select concat('a', -4.5); +a +a +a-4.5 +select 'a' union select concat('a', -(4 + 1)); +a +a +a-5 +select 'a' union select concat('a', 4 - 5); +a +a +a-1 +select 'a' union select concat('a', -'3'); +a +a +a-3 +select 'a' union select concat('a', -concat('3',4)); +a +a +a-34 +select 'a' union select concat('a', -0); +a +a +a0 +select 'a' union select concat('a', -0.0); +a +a +a-0.0 +select 'a' union select concat('a', -0.0000); +a +a +a-0.0000 diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 2321a8998ac..3c7cf60db7a 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -3,7 +3,7 @@ select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32769 0 8 def 1.0 5 3 3 N 32769 1 8 -def -1 8 1 2 N 32769 0 8 +def -1 8 2 2 N 32769 0 8 def hello 254 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 0cf1502b10e..78818cdda4e 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -34,3 +34,19 @@ 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; + +# BUG#6825 +select 'a' union select concat('a', -4); +select 'a' union select concat('a', -4.5); + +select 'a' union select concat('a', -(4 + 1)); +select 'a' union select concat('a', 4 - 5); + +select 'a' union select concat('a', -'3'); +select 'a' union select concat('a', -concat('3',4)); + +select 'a' union select concat('a', -0); +select 'a' union select concat('a', -0.0); + +select 'a' union select concat('a', -0.0000); + diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d939f47716..413000f9d1b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -775,9 +775,25 @@ longlong Item_func_neg::val_int() void Item_func_neg::fix_length_and_dec() { + enum Item_result arg_result= args[0]->result_type(); + enum Item::Type arg_type= args[0]->type(); decimals=args[0]->decimals; max_length=args[0]->max_length; hybrid_type= REAL_RESULT; + + /* + We need to account for added '-' in the following cases: + A) argument is a real or integer positive constant - in this case + argument's max_length is set to actual number of bytes occupied, and not + maximum number of bytes real or integer may require. Note that all + constants are non negative so we don't need to account for removed '-'. + B) argument returns a string. + */ + if (arg_result == STRING_RESULT || + (arg_type == REAL_ITEM && ((Item_real*)args[0])->value >= 0) || + (arg_type == INT_ITEM && ((Item_int*)args[0])->value > 0)) + max_length++; + if (args[0]->result_type() == INT_RESULT) { /* -- cgit v1.2.1 From 113fe5065281e752703b1be503aaa551087bc2f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:24:57 +0100 Subject: version.c: 4.1.9 compatible with 4.1.8 ndb/src/common/util/version.c: 4.1.9 compatible with 4.1.8 --- ndb/src/common/util/version.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index f2b3d5bd522..8e4f6efe745 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -69,6 +69,7 @@ struct NdbUpGradeCompatible { #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { + { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, { 0, 0, UG_Null } }; -- cgit v1.2.1 From b181f610e1c5bd29a21a4b73bb2fa58b37a18d6b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:27:58 +0100 Subject: bug#7379 & bug#7346 - ndb_restore ndb/tools/restore/consumer_restore.cpp: 1) Fix bug when blobs and multiple databases bug#7379 2) Fix bug #7346 ndb/tools/restore/consumer_restore.hpp: Moved tuple handle into callback object instead of having separate array Declared m_transactions volatile --- ndb/tools/restore/consumer_restore.cpp | 93 +++++++++++++++------------------- ndb/tools/restore/consumer_restore.hpp | 7 ++- 2 files changed, 44 insertions(+), 56 deletions(-) diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index e2c55e5a0b1..fbe96cb2a71 100644 --- a/ndb/tools/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -52,19 +52,10 @@ BackupRestore::init() return false; } - m_tuples = new TupleS[m_parallelism]; - - if (m_tuples == 0) - { - err << "Failed to allocate tuples" << endl; - return false; - } - m_free_callback= m_callback; for (Uint32 i= 0; i < m_parallelism; i++) { m_callback[i].restore= this; m_callback[i].connection= 0; - m_callback[i].tup= &m_tuples[i]; if (i > 0) m_callback[i-1].next= &(m_callback[i]); } @@ -86,12 +77,6 @@ void BackupRestore::release() delete [] m_callback; m_callback= 0; } - - if (m_tuples) - { - delete [] m_tuples; - m_tuples= 0; - } } BackupRestore::~BackupRestore() @@ -118,14 +103,21 @@ BackupRestore::get_table(const NdbDictionary::Table* tab){ m_cache.m_old_table = tab; int cnt, id1, id2; - char buf[256]; - if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", buf, buf, &id1, &id2)) == 4){ - BaseString::snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2); - m_cache.m_new_table = m_ndb->getDictionary()->getTable(buf); + char db[256], schema[256]; + if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", + db, schema, &id1, &id2)) == 4){ + m_ndb->setDatabaseName(db); + m_ndb->setSchemaName(schema); + + BaseString::snprintf(db, sizeof(db), "NDB$BLOB_%d_%d", + m_new_tables[id1]->getTableId(), id2); + + m_cache.m_new_table = m_ndb->getDictionary()->getTable(db); + } else { m_cache.m_new_table = m_new_tables[tab->getTableId()]; } - + assert(m_cache.m_new_table); return m_cache.m_new_table; } @@ -266,22 +258,24 @@ void BackupRestore::tuple(const TupleS & tup) if (!m_restore) return; + while (m_free_callback == 0) + { + assert(m_transactions == m_parallelism); + // send-poll all transactions + // close transaction is done in callback + m_ndb->sendPollNdb(3000, 1); + } + restore_callback_t * cb = m_free_callback; - + if (cb == 0) assert(false); - + m_free_callback = cb->next; cb->retries = 0; - *(cb->tup) = tup; // must do copy! + cb->tup = tup; // must do copy! tuple_a(cb); - if (m_free_callback == 0) - { - // send-poll all transactions - // close transaction is done in callback - m_ndb->sendPollNdb(3000, 1); - } } void BackupRestore::tuple_a(restore_callback_t *cb) @@ -303,7 +297,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb) exitHandler(); } // if - const TupleS &tup = *(cb->tup); + const TupleS &tup = cb->tup; const NdbDictionary::Table * table = get_table(tup.getTable()->m_dictTable); NdbOperation * op = cb->connection->getNdbOperation(table); @@ -372,7 +366,9 @@ void BackupRestore::tuple_a(restore_callback_t *cb) m_transactions++; return; } - err << "Unable to recover from errors. Exiting..." << endl; + err << "Retried transaction " << cb->retries << " times.\nLast error" + << m_ndb->getNdbError(cb->error_code) << endl + << "...Unable to recover from errors. Exiting..." << endl; exitHandler(); } @@ -416,16 +412,21 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) NdbError error= cb->connection->getNdbError(); m_ndb->closeTransaction(cb->connection); cb->connection= 0; + + Uint32 sleepTime = 100 + cb->retries * 300; + cb->retries++; + cb->error_code = error.code; + switch(error.status) { case NdbError::Success: - return false; - // ERROR! - break; - + return false; + // ERROR! + break; + case NdbError::TemporaryError: - NdbSleep_MilliSleep(10); + NdbSleep_MilliSleep(sleepTime); return true; // RETRY break; @@ -438,15 +439,6 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) default: case NdbError::PermanentError: - switch (error.code) - { - case 499: - case 250: - NdbSleep_MilliSleep(10); - return true; //temp errors? - default: - break; - } //ERROR err << error << endl; return false; @@ -468,13 +460,10 @@ BackupRestore::tuple_free() if (!m_restore) return; - if (m_transactions > 0) { - // Send all transactions to NDB - m_ndb->sendPreparedTransactions(0); - - // Poll all transactions - while (m_transactions > 0) - m_ndb->pollNdb(3000, m_transactions); + // Poll all transactions + while (m_transactions) + { + m_ndb->sendPollNdb(3000); } } diff --git a/ndb/tools/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp index 59e2734ea1f..df219cd4412 100644 --- a/ndb/tools/restore/consumer_restore.hpp +++ b/ndb/tools/restore/consumer_restore.hpp @@ -21,9 +21,10 @@ struct restore_callback_t { class BackupRestore *restore; - class TupleS *tup; + class TupleS tup; class NdbConnection *connection; int retries; + int error_code; restore_callback_t *next; }; @@ -39,7 +40,6 @@ public: m_restore_meta = false; m_parallelism = parallelism; m_callback = 0; - m_tuples = 0; m_free_callback = 0; m_transactions = 0; m_cache.m_old_table = 0; @@ -68,9 +68,8 @@ public: Uint32 m_dataCount; Uint32 m_parallelism; - Uint32 m_transactions; + volatile Uint32 m_transactions; - TupleS *m_tuples; restore_callback_t *m_callback; restore_callback_t *m_free_callback; -- cgit v1.2.1 From 21162110fd89c1f63cf1d8c34fd9ca7a86a556b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:40:56 +0100 Subject: CommandInterpreter.hpp, CommandInterpreter.cpp: removed methods that are duplicated in management client ndb/src/mgmsrv/CommandInterpreter.cpp: removed methods that are duplicated in management client ndb/src/mgmsrv/CommandInterpreter.hpp: removed methods that are duplicated in management client --- ndb/src/mgmsrv/CommandInterpreter.cpp | 537 +--------------------------------- ndb/src/mgmsrv/CommandInterpreter.hpp | 8 - 2 files changed, 1 insertion(+), 544 deletions(-) diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 1b882cd2e71..7e64b2fec19 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -30,64 +30,10 @@ #include -static const char* helpTexts[] = { - "HELP Print help text", - "HELP SHOW Help for the SHOW command", -#ifdef VM_TRACE // DEBUG ONLY - "HELP DEBUG Help for debug compiled version", -#endif - "SHOW Print information about cluster", - "SHOW CONFIG Print configuration", - "SHOW PARAMETERS Print configuration parameters", - "START BACKUP Start backup\n" - "ABORT BACKUP Aborts backup\n" - "CLUSTERLOG ON Enable Cluster logging", - "CLUSTERLOG OFF Disable Cluster logging", - "CLUSTERLOG FILTER Toggle severity filter on/off", - "CLUSTERLOG INFO Print cluster log information", - "{|ALL} START Start DB node (started with -n)", - "{|ALL} RESTART [-n] [-i] Restart DB node", - "{|ALL} STOP Stop DB node", - "{|ALL} STATUS Print status", - "{|ALL} CLUSTERLOG {=}+ Set log level for cluster log", - "QUIT Quit management server", -}; -static const unsigned noOfHelpTexts = sizeof(helpTexts)/sizeof(const char*); - -static const char* helpTextShow = -"SHOW prints NDB Cluster information\n\n" -"SHOW Print information about cluster\n" -"SHOW CONFIG Print configuration (in initial config file format)\n" -"SHOW PARAMETERS Print information about configuration parameters\n\n" -; - -#ifdef VM_TRACE // DEBUG ONLY -static const char* helpTextDebug = -"SHOW PROPERTIES Print config properties object\n" -"{|ALL} LOGLEVEL {=}+ Set log level\n" -"{|ALL} ERROR Inject error into NDB node\n" -"{|ALL} TRACE Set trace number\n" -"{|ALL} LOG [BLOCK = {ALL|+}] Set logging on in & out signals\n" -"{|ALL} LOGIN [BLOCK = {ALL|+}] Set logging on in signals\n" -"{|ALL} LOGOUT [BLOCK = {ALL|+}] Set logging on out signals\n" -"{|ALL} LOGOFF [BLOCK = {ALL|+}] Unset signal logging\n" -"{|ALL} TESTON Start signal logging\n" -"{|ALL} TESTOFF Stop signal logging\n" -"{|ALL} SET Update configuration variable\n" -"{|ALL} DUMP Dump system state to cluster.log\n" -"{|ALL} GETSTAT Print statistics\n" -"\n" -; -#endif - - - //****************************************************************************** //****************************************************************************** CommandInterpreter::CommandInterpreter(MgmtSrvr& mgmtSrvr) : _mgmtSrvr(mgmtSrvr) { - - // _mgmtSrvr.setCallback(CmdBackupCallback); } @@ -145,48 +91,7 @@ int CommandInterpreter::readAndExecute() { char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, "\0"); - if (strcmp(firstToken, "HELP") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "?") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "SHOW") == 0) { - executeShow(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "START") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeStartBackup(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "ABORT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeAbortBackup(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "ENTER") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeEnterSingleUser(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "EXIT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeExitSingleUser(allAfterFirstToken); - return true; - } - - else if (strcmp(firstToken, "ALL") == 0) { + if (strcmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); } else if(strcmp(firstToken, "QUIT") == 0 || @@ -218,8 +123,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { { "START", &CommandInterpreter::executeStart } ,{ "RESTART", &CommandInterpreter::executeRestart } ,{ "STOP", &CommandInterpreter::executeStop } - ,{ "STATUS", &CommandInterpreter::executeStatus } - ,{ "LOGLEVEL", &CommandInterpreter::executeLogLevel } #ifdef ERROR_INSERT ,{ "ERROR", &CommandInterpreter::executeError } #endif @@ -230,9 +133,7 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { ,{ "LOGOFF", &CommandInterpreter::executeLogOff } ,{ "TESTON", &CommandInterpreter::executeTestOn } ,{ "TESTOFF", &CommandInterpreter::executeTestOff } - ,{ "CLUSTERLOG", &CommandInterpreter::executeEventReporting } ,{ "DUMP", &CommandInterpreter::executeDumpState } - ,{ "JONAS", &CommandInterpreter::jonas } }; @@ -370,104 +271,9 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog, return true; } - - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeHelp(char* parameters) { - - (void)parameters; // Don't want compiler warning - - if (emptyString(parameters)) { - unsigned i; - for (i = 0; i = " - << "ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG" - << endl; - - ndbout << " = "; - for(i = 0; i = " << "0 - 15" - << endl; - - ndbout << endl; - } else if (strcmp(parameters, "SHOW") == 0) { - ndbout << helpTextShow; -#ifdef VM_TRACE // DEBUG ONLY - } else if (strcmp(parameters, "DEBUG") == 0) { - ndbout << helpTextDebug; -#endif - } else { - ndbout << "Invalid argument." << endl; - } -} - //***************************************************************************** //***************************************************************************** -void CommandInterpreter::executeShow(char* parameters) { - - if (emptyString(parameters)) { - ndbout << "Cluster Configuration" << endl - << "---------------------" << endl; - - NodeId nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_NDB) - << " NDB Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_API) - << " API Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_API)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_MGM) - << " MGM Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - ndbout << helpTextShow; - - return; - } else if (strcmp(parameters, "PROPERTIES") == 0 || - strcmp(parameters, "PROP") == 0) { - ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */ - } else if (strcmp(parameters, "CONFIGURATION") == 0 || - strcmp(parameters, "CONFIG") == 0){ - ndbout << "_mgmtSrvr.getConfigFile()->print();" << endl; /* XXX */ - _mgmtSrvr.getConfig()->printConfigFile(); - } else if (strcmp(parameters, "PARAMETERS") == 0 || - strcmp(parameters, "PARAMS") == 0 || - strcmp(parameters, "PARAM") == 0) { - ndbout << "_mgmtSrvr.getConfigInfo()->print();" << endl; /* XXX */ - } else { - ndbout << "Invalid argument." << endl; - } -} - void stopCallback(int nodeId, void * anyData, int errCode){ if(errCode == 0){ @@ -483,59 +289,6 @@ stopCallback(int nodeId, void * anyData, int errCode){ } } -void -versionCallback(int nodeId, int version, void * anyData, int errCode){ - if(errCode == 0){ - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - switch(mgm->getNodeType(nodeId)){ - case NDB_MGM_NODE_TYPE_MGM: - { - ndbout << "MGMT node:\t" << nodeId << " "; - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - break; - case NDB_MGM_NODE_TYPE_NDB: - { - ndbout << "DB node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - } - break; - case NDB_MGM_NODE_TYPE_API: - { - ndbout << "API node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - - } - break; - case NDB_MGM_NODE_TYPE_UNKNOWN: - case NDB_MGM_NODE_TYPE_REP: - abort(); - }; - - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - char err_str[1024]; - ndbout << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; - } -} - //***************************************************************************** //***************************************************************************** void CommandInterpreter::executeStop(int processId, @@ -643,124 +396,6 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, } } -void CommandInterpreter::executeStatus(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - ndb_mgm_node_status status; - Uint32 startPhase, version, dynamicId, nodeGroup, connectCount; - bool system; - int result = _mgmtSrvr.status(processId, - &status, &version, &startPhase, &system, - &dynamicId, &nodeGroup, &connectCount); - if(result != 0){ - ndbout << get_error_text(result) << endl; - return; - } - - ndbout << "Node " << processId << ": "; - switch(status){ - case NDB_MGM_NODE_STATUS_NO_CONTACT: - ndbout << "No contact" << endl; - break; - case NDB_MGM_NODE_STATUS_NOT_STARTED: - ndbout << "Not started" ; - break; - case NDB_MGM_NODE_STATUS_STARTING: - ndbout << "Starting (Start phase " << startPhase << ")" ; - break; - case NDB_MGM_NODE_STATUS_STARTED: - ndbout << "Started" ; - break; - case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: - ndbout << "Shutting down " << (system == false ? "node" : "system") - << " (Phase " << startPhase << ")" - ; - break; - case NDB_MGM_NODE_STATUS_RESTARTING: - ndbout << "Restarting" ; - break; - case NDB_MGM_NODE_STATUS_SINGLEUSER: - ndbout << "Single user mode" ; - break; - default: - ndbout << "Unknown state" ; - break; - } - if(status != NDB_MGM_NODE_STATUS_NO_CONTACT){ - - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - - // NOTE It's possible to print dynamicId and nodeGroup here ... - // ndbout << ", " < 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - - int result = _mgmtSrvr.setNodeLogLevel(processId, logLevel); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - - - //***************************************************************************** //***************************************************************************** void CommandInterpreter::executeError(int processId, @@ -956,173 +591,3 @@ void CommandInterpreter::executeTestOff(int processId, } } - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeEventReporting(int processId, - const char* parameters, - bool all) { -#if 0 - (void)all; // Don't want compiler warning - SetLogLevelOrd logLevel; logLevel.clear(); - - if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) { - for(Uint32 i = 0; i 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - ndbout_c("processId %d", processId); - int result = _mgmtSrvr.setEventReportingLevel(processId, logLevel); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - -void -CommandInterpreter::executeStartBackup(char* parameters) { - Uint32 backupId; - int result = _mgmtSrvr.startBackup(backupId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - // ndbout << "Start of backup ordered" << endl; - } -} - -void -CommandInterpreter::executeAbortBackup(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, "\0"); - int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; - } - int result = _mgmtSrvr.abortBackup(bid); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; - } -} - - - -void -CommandInterpreter::executeEnterSingleUser(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, " "); - id = strtok(NULL, " "); - id = strtok(NULL, "\0"); - int nodeId = -1; - if(id == 0 || sscanf(id, "%d", &nodeId) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; - } - int result = _mgmtSrvr.enterSingleUser(0, nodeId,0,0); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - ndbout << "Entering single user mode, granting access for node " - << nodeId << " OK." << endl; - } -} - -void CommandInterpreter::executeExitSingleUser(char* parameters) { - _mgmtSrvr.exitSingleUser(0,0,0,0); -} - - -#include - -void -CommandInterpreter::jonas(int processId, const char* parameters, bool all) { - - MgmtSrvr::Area51 tmp = _mgmtSrvr.getStuff(); - - NdbApiSignal signal(0); - Uint32 * theData = signal.getDataPtrSend(); - Uint32 data[25]; - Uint32 sec0[70]; - Uint32 sec1[123]; - - data[0] = 12; - data[1] = 13; - - unsigned i; - for(i = 0; i<70; i++) - sec0[i] = i; - - for(i = 0; i<123; i++) - sec1[i] = 70+i; - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 1; - - LinearSectionPtr ptr[3]; - - theData[0] = 3; - theData[1] = 0; - theData[2] = 7; // FragmentId - - ptr[0].sz = 2; - ptr[0].p = &data[0]; - - ptr[1].sz = 60; - ptr[1].p = &sec0[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 3; - - theData[0] = 0; - theData[1] = 1; - theData[2] = 7; // FragmentId - - ptr[0].sz = 10; - ptr[0].p = &sec0[60]; - - ptr[1].sz = 123; - ptr[1].p = &sec1[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); -} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 74e5c2e95be..1cd80c5d3ae 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -130,7 +130,6 @@ public: void executeStop(int processId, const char* parameters, bool all); void executeStart(int processId, const char* parameters, bool all); void executeRestart(int processId, const char* parameters, bool all); - void executeLogLevel(int processId, const char* parameters, bool all); void executeError(int processId, const char* parameters, bool all); void executeTrace(int processId, const char* parameters, bool all); void executeLog(int processId, const char* parameters, bool all); @@ -140,14 +139,7 @@ public: void executeTestOn(int processId, const char* parameters, bool all); void executeTestOff(int processId, const char* parameters, bool all); void executeStatus(int processId, const char* parameters, bool all); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeEventReporting(int processId, const char* parameters, bool all); void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * pars); - void executeAbortBackup(char * pars); - - void jonas(int processId, const char* parameters, bool all); /** * A execute function definition -- cgit v1.2.1 From b3dd00299928ecf27d830359ac6ece8901ed016f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:55:00 +0100 Subject: enabled setting version for ndb --- ndb/src/common/util/version.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 8e4f6efe745..75537c6ed3a 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include Uint32 getMajor(Uint32 version) { return (version >> 16) & 0xFF; @@ -67,6 +69,24 @@ struct NdbUpGradeCompatible { /*#define TEST_VERSION*/ +#define HAVE_NDB_SETVERSION +#ifdef HAVE_NDB_SETVERSION +Uint32 ndbOwnVersionTesting = 0; +void +ndbSetOwnVersion() { + char buf[256]; + if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { + Uint32 _v1,_v2,_v3; + if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { + ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); + ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); + } + } +} +#else +void ndbSetOwnVersion() {} +#endif + #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, @@ -79,8 +99,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { { 0, 0, UG_Null } }; -void ndbSetOwnVersion() {} - #else /* testing purposes */ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { @@ -101,19 +119,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { }; -Uint32 ndbOwnVersionTesting = 0; -void -ndbSetOwnVersion() { - char buf[256]; - if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { - Uint32 _v1,_v2,_v3; - if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { - ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); - ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); - } - } -} - #endif void ndbPrintVersion() @@ -127,13 +132,13 @@ void ndbPrintVersion() Uint32 ndbGetOwnVersion() { -#ifndef TEST_VERSION - return NDB_VERSION_D; -#else /* testing purposes */ +#ifdef HAVE_NDB_SETVERSION if (ndbOwnVersionTesting == 0) return NDB_VERSION_D; else return ndbOwnVersionTesting; +#else + return NDB_VERSION_D; #endif } -- cgit v1.2.1 From 1780c9b349452c9a06a572800a299495e733ed20 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:03:08 +0100 Subject: removed more duplicated commands for management server --- ndb/src/mgmclient/CommandInterpreter.cpp | 38 ---- ndb/src/mgmsrv/CommandInterpreter.cpp | 300 +------------------------------ ndb/src/mgmsrv/CommandInterpreter.hpp | 77 -------- 3 files changed, 7 insertions(+), 408 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 0c7fe642e54..550830da56f 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -110,7 +110,6 @@ public: void executeRestart(int processId, const char* parameters, bool all); void executeLogLevel(int processId, const char* parameters, bool all); void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); void executeLog(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); @@ -729,7 +728,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { #ifdef ERROR_INSERT ,{ "ERROR", &CommandInterpreter::executeError } #endif - ,{ "TRACE", &CommandInterpreter::executeTrace } ,{ "LOG", &CommandInterpreter::executeLog } ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } @@ -1676,42 +1674,6 @@ void CommandInterpreter::executeError(int processId, ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL); } -//***************************************************************************** -//***************************************************************************** -void -CommandInterpreter::executeTrace(int /*processId*/, - const char* /*parameters*/, bool /*all*/) -{ -#if 0 - if (emptyString(parameters)) { - ndbout << "Missing trace number." << endl; - return; - } - - char* newpar = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr ap1(newpar); - char* firstParameter = strtok(newpar, " "); - - - int traceNo; - if (! convert(firstParameter, traceNo)) { - ndbout << "Expected an integer." << endl; - return; - } - char* allAfterFirstParameter = strtok(NULL, "\0"); - - if (! emptyString(allAfterFirstParameter)) { - ndbout << "Nothing expected after trace number." << endl; - return; - } - - int result = _mgmtSrvr.setTraceNo(processId, traceNo); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - //***************************************************************************** //***************************************************************************** diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 24b64457649..0b28defa196 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -104,7 +104,6 @@ int CommandInterpreter::readAndExecute() { int processId; if (! convert(firstToken, processId)) { ndbout << "Invalid command: " << _line << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return true; } if (processId < 0) { @@ -120,20 +119,9 @@ int CommandInterpreter::readAndExecute() { static const CommandInterpreter::CommandFunctionPair commands[] = { - { "START", &CommandInterpreter::executeStart } - ,{ "RESTART", &CommandInterpreter::executeRestart } - ,{ "STOP", &CommandInterpreter::executeStop } -#ifdef ERROR_INSERT - ,{ "ERROR", &CommandInterpreter::executeError } -#endif - ,{ "TRACE", &CommandInterpreter::executeTrace } - ,{ "LOG", &CommandInterpreter::executeLog } - ,{ "LOGIN", &CommandInterpreter::executeLogIn } + { "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } ,{ "LOGOFF", &CommandInterpreter::executeLogOff } - ,{ "TESTON", &CommandInterpreter::executeTestOn } - ,{ "TESTOFF", &CommandInterpreter::executeTestOff } - ,{ "DUMP", &CommandInterpreter::executeDumpState } }; @@ -170,16 +158,14 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(fun == 0){ ndbout << "Invalid command: " << secondToken << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return; } if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcmp(command, "STATUS") != 0) - ndbout << "Executing " << command << " on node: " - << processId << endl << endl; + ndbout << "Executing " << command << " on node: " + << processId << endl << endl; (this->*fun)(processId, allAfterSecondToken, false); ndbout << endl; } @@ -190,18 +176,11 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken){ NodeId nodeId = 0; - if(strcmp(cmd, "STOP") == 0 || - strcmp(cmd, "RESTART") == 0){ - ndbout << "Executing " << cmd << " on all nodes" << endl << "\n"; + while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ + ndbout << "Executing " << cmd << " on node: " + << nodeId << endl << endl; (this->*fun)(nodeId, allAfterSecondToken, true); - } else { - while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(strcmp(cmd, "STATUS") != 0) - ndbout << "Executing " << cmd << " on node: " - << nodeId << endl << endl; - (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // for + ndbout << endl; } } @@ -271,233 +250,6 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog, return true; } -//***************************************************************************** -//***************************************************************************** - -void -stopCallback(int nodeId, void * anyData, int errCode){ - if(errCode == 0){ - if(nodeId == 0) - ndbout << "\nCluster has shutdown" << endl; - else - ndbout << "\nNode " << nodeId << " has shutdown" << endl; - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - char err_str[1024]; - ndbout << "Node " << nodeId << " has not shutdown: " - << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; - } -} - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeStop(int processId, - const char* parameters, bool all) { - - (void)parameters; // Don't want compiler warning - - int result = 0; - if(all) - result = _mgmtSrvr.stop((int *)0, false, stopCallback, this); - else - result = _mgmtSrvr.stopNode(processId, false, stopCallback, this); - - if(result != 0) - ndbout << get_error_text(result) << endl; -} - - -void CommandInterpreter::executeStart(int processId, const char* parameters, - bool all) { - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.start(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -} - -void -CommandInterpreter::executeRestart(int processId, const char* parameters, - bool all) { - - bool nostart = false; - bool initialstart = false; - - if(parameters != 0 && strlen(parameters) != 0){ - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - while(item != NULL){ - if(strcmp(item, "-N") == 0) - nostart = true; - if(strcmp(item, "-I") == 0) - initialstart = true; - item = strtok_r(NULL, " ", &tmpPtr); - } - free(tmpString); - } - int result; - if(all) - result = _mgmtSrvr.restart(nostart, initialstart, false, - 0, stopCallback, this); - else - result = _mgmtSrvr.restartNode(processId, nostart, initialstart, false, - stopCallback, - this); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -} - -void -CommandInterpreter::executeDumpState(int processId, const char* parameters, - bool all) { - - (void)all; // Don't want compiler warning - - if(parameters == 0 || strlen(parameters) == 0){ - ndbout << "Expected argument" << endl; - return; - } - - Uint32 no = 0; - Uint32 pars[25]; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - int error; - while(item != NULL){ - if (0x0 <= my_strtoll10(item, NULL, &error) && my_strtoll10(item, NULL, &error) <= 0xffffffff) { - pars[no] = my_strtoll10(item, NULL, &error); - } else { - ndbout << "Illegal value in argument to signal." << endl - << "(Value must be between 0 and 0xffffffff.)" - << endl; - return; - } - no++; - item = strtok_r(NULL, " ", &tmpPtr); - } - ndbout << "Sending dump signal with data:" << endl; - for (Uint32 i=0; i blocks; - if (! parseBlockSpecification(parameters, blocks)) { - return; - } - - int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} - - - -//****************************************************************************** -//****************************************************************************** void CommandInterpreter::executeLogIn(int processId, const char* parameters, bool all) { @@ -554,41 +306,3 @@ void CommandInterpreter::executeLogOff(int processId, } } - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOn(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.startSignalTracing(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOff(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.stopSignalTracing(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 1cd80c5d3ae..0eb39758969 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -17,52 +17,21 @@ #ifndef CommandInterpreter_H #define CommandInterpreter_H -//***************************************************************************** -// Author: Peter Lind -//***************************************************************************** - #include #include #include class MgmtSrvr; -/** - * @class CommandInterpreter - * @brief Reads command line in management client - * - * This class has one public method which reads a command line - * from a stream. It then interpret that commmand line and calls a suitable - * method in the MgmtSrvr class which executes the command. - * - * For command syntax, see the HELP command. - */ class CommandInterpreter { public: - /** - * Constructor - * @param mgmtSrvr: Management server to use when executing commands - */ CommandInterpreter(MgmtSrvr& mgmtSrvr); - - /** - * Reads one line from the stream, parse the line to find - * a command and then calls a suitable method which executes - * the command. - * - * @return true until quit/bye/exit has been typed - */ int readAndExecute(); private: char m_err_str[1024]; const char *get_error_text(int err_no); - /** - * Read a string, and return a pointer to it. - * - * @return NULL on EOF. - */ char *readline_gets () { static char linebuffer[254]; @@ -89,61 +58,15 @@ private: return (line_read); } - /** - * Analyse the command line, after the first token. - * - * @param processId: DB process id to send command to or -1 if - * command will be sent to all DB processes. - * @param allAfterFirstToken: What the client gave after the - * first token on the command line - */ void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - - /** - * Parse the block specification part of the LOG* commands, - * things after LOG*: [BLOCK = {ALL|+}] - * - * @param allAfterLog: What the client gave after the second token - * (LOG*) on the command line - * @param blocks, OUT: ALL or name of all the blocks - * @return: true if correct syntax, otherwise false - */ bool parseBlockSpecification(const char* allAfterLog, Vector& blocks); - - /** - * A bunch of execute functions: Executes one of the commands - * - * @param processId: DB process id to send command to - * @param parameters: What the client gave after the command name - * on the command line. - * For example if complete input from user is: "1 LOGLEVEL 22" then the - * parameters argument is the string with everything after LOGLEVEL, in this - * case "22". Each function is responsible to check the parameters argument. - */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeRun(char* parameters); - void executeInfo(char* parameters); public: - void executeStop(int processId, const char* parameters, bool all); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - /** - * A execute function definition - */ public: typedef void (CommandInterpreter::* ExecuteFunction)(int processId, const char * param, -- cgit v1.2.1 From 7b592c9e2416792fd17997a8f44eadb939c2629a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:27:08 +0100 Subject: added TRACE to managemnt server removed TRACE from management client ndb/src/mgmclient/CommandInterpreter.cpp: removed TRACE from management client ndb/src/mgmsrv/CommandInterpreter.cpp: added TRACE to managemnt server ndb/src/mgmsrv/CommandInterpreter.hpp: added TRACE to managemnt server --- ndb/src/mgmclient/CommandInterpreter.cpp | 1 - ndb/src/mgmsrv/CommandInterpreter.cpp | 39 +++++++++++++++++++++++++++++++- ndb/src/mgmsrv/CommandInterpreter.hpp | 1 + 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 550830da56f..cbf7776fe06 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -340,7 +340,6 @@ static const char* helpTextDebug = #ifdef ERROR_INSERT " ERROR Inject error into NDB node\n" #endif -" TRACE Set trace number\n" " LOG [BLOCK = {ALL|+}] Set logging on in & out signals\n" " LOGIN [BLOCK = {ALL|+}] Set logging on in signals\n" " LOGOUT [BLOCK = {ALL|+}] Set logging on out signals\n" diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 0b28defa196..686155415d5 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -119,7 +119,8 @@ int CommandInterpreter::readAndExecute() { static const CommandInterpreter::CommandFunctionPair commands[] = { - { "LOGIN", &CommandInterpreter::executeLogIn } + { "TRACE", &CommandInterpreter::executeTrace } + ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } ,{ "LOGOFF", &CommandInterpreter::executeLogOff } }; @@ -306,3 +307,39 @@ void CommandInterpreter::executeLogOff(int processId, } } + +void CommandInterpreter::executeTrace(int processId, + const char* parameters, bool all) { + + (void)all; // Don't want compiler warning + + if (emptyString(parameters)) { + ndbout << "Missing trace number." << endl; + return; + } + + char* newpar = strdup(parameters); + char* firstParameter = strtok(newpar, " "); + + + int traceNo; + if (! convert(firstParameter, traceNo)) { + ndbout << "Expected an integer." << endl; + free(newpar); + return; + } + + char* allAfterFirstParameter = strtok(NULL, "\0"); + + if (! emptyString(allAfterFirstParameter)) { + ndbout << "Nothing expected after trace number." << endl; + free(newpar); + return; + } + + int result = _mgmtSrvr.setTraceNo(processId, traceNo); + if (result != 0) { + ndbout << get_error_text(result) << endl; + } + free(newpar); +} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 0eb39758969..6b67d1a5a5f 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -63,6 +63,7 @@ private: Vector& blocks); public: + void executeTrace(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); void executeLogOff(int processId, const char* parameters, bool all); -- cgit v1.2.1 From 71981ad774c92552ce300389f519fc9a410b3686 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 17:03:15 +0100 Subject: Delete files which were accidently created within the last push BitKeeper/deleted/.del-tool_test.test~7a0c705c995ee523: Delete: mysql-test/t/tool_test.test BitKeeper/deleted/.del-tool_test.result~ec1f972349e9e18: Delete: mysql-test/r/tool_test.result BitKeeper/deleted/.del-ps_12func.test~78bc82c8a4a1ccae: Delete: mysql-test/t/ps_12func.test BitKeeper/deleted/.del-ps_12func.result~d8cce403c6cb460e: Delete: mysql-test/r/ps_12func.result BitKeeper/deleted/.del-patchwork-check.inc~45d0d076850f5c5b: Delete: mysql-test/include/patchwork-check.inc --- mysql-test/include/patchwork-check.inc | 330 --- mysql-test/r/ps_12func.result | 4748 -------------------------------- mysql-test/r/tool_test.result | 223 -- mysql-test/t/ps_12func.test | 867 ------ mysql-test/t/tool_test.test | 105 - 5 files changed, 6273 deletions(-) delete mode 100644 mysql-test/include/patchwork-check.inc delete mode 100644 mysql-test/r/ps_12func.result delete mode 100644 mysql-test/r/tool_test.result delete mode 100644 mysql-test/t/ps_12func.test delete mode 100644 mysql-test/t/tool_test.test diff --git a/mysql-test/include/patchwork-check.inc b/mysql-test/include/patchwork-check.inc deleted file mode 100644 index b11db7fa50d..00000000000 --- a/mysql-test/include/patchwork-check.inc +++ /dev/null @@ -1,330 +0,0 @@ -###################### patchwork-check.inc ############################# -# # -# Basic routine for the generation and execution of prepared and non # -# prepared SQL statements. # -# # -# Purpose: Simplify the check of complex statements with different # -# sets of parameters (data type, value) # -# # -######################################################################## - -# -# NOTE: PLEASE BE VERY CAREFULL, WHEN CHANGING OR USING ;-) THIS ROUTINE. -# -# Please be aware, that this routine -# - will be sourced by several test case files stored within the -# directory 'mysql-test/t'. So every change here will affect -# several test cases. -# - does not check its own prequisites -# - modifies the content and the data type of the -# uservariables @var_1 ... @var_ -# -# Please preserve the '___' naming of the the auxiliary variables. -# These names should avoid that a test case writer accidently creates a -# variable with the same name. -# - -# naming conventions: -# stmt_c_ --> statement with constants like "select 1 " -# stmt_uv_ --> statement with uservariables like "select @var_1 " -# stmt_ph_ --> prepared statement with placeholders like "select ? " - - -# -# Explanation how to use this routine by an example: -# -# Content of the caller script: -# .... -# set @stmt_part1= 'SELECT f1 + ' -# set @stmt_part2= ' from t1 where f2= ' ; -# set @stmt_part3= '' ; -# set @string_1= "1"; set @type_1= "BIGINT"; -# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; -# set @max_var_number= 2; -# --source include/patchwork-check.inc -# -# # The next testing rounds could start with -# set @string_1= "NULL"; set @type_1= "BIGINT"; -# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; -# --source include/patchwork-check.inc -# -# set @string_1= "1"; set @type_1= "BIGINT"; -# set @string_2= "NULL"; set @type_2= "LONGTEXT"; -# --source include/patchwork-check.inc -# -# Statements and uservariables to be produced and executed by this routine -# 1. Statements with constants -# 1.1 stmt1= SELECT f1 + 1 from t1 where f2= -2.3E-4 ; -# 1.2 stmt1 as prepared statement -# 2. Statements with uservariables -# @var_n should be of data type @type_n (if possible) and have the -# content @string_n . -# 2.1 stmt2= SELECT f1 + @var_1 from t1 where f2= @var_2 -# 2.2 stmt2 as prepared statement -# 3. prepared statement with placeholders -# prepare stmt1 from 'SELECT f1 + ? from t1 where f2= ?' -# execute stmt1 using @var_1, @var_2 -# -# Every prepared statement variant of the "patchwork" is 3 times executed. -# -# -# Please have also also a look into -# - t/tooltest.test , which checks or -# - t/ps_12func.test , which contains test cases using -# this routine. -# - - -############## -# -# Prerequisites: -# -# The caller script must set the following uservariables: -# -# The statement pieces: @stmt_part1, @stmt_part2, ... , @stmt_part -# -# The parameter values: @string_1, ... , @string_ -# The parameter value should fit to the data type ! -# UPPER(@stmt_part1) = 'NULL' will cause (SQL) NULL as content. -# -# The parameter data types: @type_1, ... , @type_ -# valid types are: BIGINT, DOUBLE, LONGTEXT, LONGBLOB -# -# Attention: All other type assignments will lead to a -# uservariable of type LONGTEXT !! -# -# The number of parameter values must be published via -# set @max_var_number= ; -# -# Attention: This routine does not perform any check of the content -# of these variables. -# - -############## -# -# How is intended uservariable generated: -# -# Step 1: generate a uservariable of the intended type -# -# UPPER(@type_) statement -# BIGINT set @var_= 0 -# DOUBLE' set @var_idx_= 0.0 -# LONGTEXT' set @var_= "INIT" -# LONGBLOB' set @var_= CAST("INIT" AS BINARY) -# set @var_= "INIT" -# -# Step 2: assign the value to the uservariable -# -# IF ( UPPER(@string_) != 'NULL') -# UPPER(@type_) -# BIGINT set @var_= CEIL(@string_) -# DOUBLE set @var_= @string_ + 0.0 -# LONGTEXT set @var_= @string_ -# LONGBLOB set @var_= CAST(@string_ AS BINARY) -# set @var_= @string_ -# ELSE -# set @var_= NULL -# - - -# -# How to debug this routine if something goes wrong: -# -# 1. Put the line '--disable_abort_on_error' into the caller script -# --> There will be no abort of mysqltest, if a statement fails. -# You will get a protocol (in most cases). -# 2. Put the line 'set $__debug_= 1 ;' into the caller script . -# The next call of patchwork-check.inc will print -# the type and content of generated uservariables and statements. -# 3. disable the '--disable_query_log' option some lines below -# -# and please be patient towards this routine, it is far away from being perfect. -# - - -# Suppress the majority of the huge output concerning the statement and -# uservariable generation ---disable_query_log - -let $__idx_= 1 ; -eval set @__stmt_c_= @stmt_part_$__idx_ ; -# If the number of variables is greater 0, we need also -# - the statement with uservariables (stmt_uv) and -# - the prepared statement with placeholders (stmt_ph) and -# - the execute for the prepared statement with placeholders (execute_stmt_ph) -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - eval set @__stmt_uv_= @stmt_part_$__idx_ ; - eval set @__stmt_ph_= @stmt_part_$__idx_ ; - set @__execute_stmt_ph= 'execute __stmt_ph_ using ' ; - let $__num_= `select @max_var_number`; - while ($__num_) - { - ##### Generate the Uservariables - eval set @__my_init_= CASE UPPER(@type_$__idx_) - WHEN 'BIGINT' THEN 'set @var_$__idx_= 0' - WHEN 'DOUBLE' THEN 'set @var_$__idx_= 0.0' - WHEN 'LONGTEXT' THEN 'set @var_$__idx_= "INIT"' - WHEN 'LONGBLOB' THEN 'set @var_$__idx_= CAST("INIT" AS BINARY)' - ELSE 'set @var_$__idx_= "INIT"' END; - # select @__my_init_ as "@__my_init_ is: " ; - let $__my_init_= `select @__my_init_`; - eval $__my_init_ ; - - eval set @__my_init_= CASE UPPER(@type_$__idx_) - WHEN 'BIGINT' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CEIL(@string_$__idx_),NULL)" - WHEN 'DOUBLE' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_ + 0.0,NULL)" - WHEN 'LONGTEXT' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" - WHEN 'LONGBLOB' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CAST(@string_$__idx_ AS BINARY),NULL)" - ELSE - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" END; - let $__my_init_= `select @__my_init_`; - eval $__my_init_ ; - - ##### concat the variable to the statements - ## with Constants - # 1. replace ugly NULLs like 'NuLl' with 'NULL' for better readability - # 2. Strings to be inserted into the statement must be quoted - eval set @__stmt_c_= concat( - @__stmt_c_, - IF(UPPER(@string_$__idx_)='NULL','NULL', - IF(UPPER(@type_$__idx_)='LONGTEXT' or UPPER(@type_$__idx_)='LONGBLOB', - concat('''',@string_$__idx_,''''), @string_$__idx_ - ))) ; - ## with Uservariables - eval set @__stmt_uv_= concat(@__stmt_uv_, '@var_$__idx_') ; - ## with placeholders - eval set @__stmt_ph_= concat(@__stmt_ph_, '?') ; - - ##### complete the execute for the prepared statement with placeholders - eval set @__execute_stmt_ph= concat(@__execute_stmt_ph, '@var_$__idx_,') ; - - inc $__idx_ ; - ##### concat the next part of the statement to the statements - eval set @__stmt_c_= concat(@__stmt_c_, @stmt_part_$__idx_ ); - eval set @__stmt_uv_= concat(@__stmt_uv_, @stmt_part_$__idx_ ); - eval set @__stmt_ph_= concat(@__stmt_ph_, @stmt_part_$__idx_ ); - - dec $__num_ ; - } - # @__execute_stmt_ph contains a trailing ',' which must be cut away - set @__execute_stmt_ph= substr(@__execute_stmt_ph,1,length(@__execute_stmt_ph) - 1); - dec $__with_var_ ; -} - -while ($__debug_) -{ - ### Print debug informations for patchwork with variables - let $__with_var_= `select @max_var_number > 0`; - while ($__with_var_) - { - ### Print out the content of the statement variables - eval select "--------------------------------------" - as "the content of the statement variables" - union select concat('@__stmt_c_ is: ',@__stmt_c_) - union select concat('@__stmt_uv_ is: ',@__stmt_uv_) - union select concat('@__stmt_ph_ is: ',@__stmt_ph_) - union select concat('@__execute_stmt_ph is: ',@__execute_stmt_ph); - - - ### Print out the content of the uservariables - select '--------------------------------------' - as "the content of the parameter variables"; - set @__parameter_= 'select '; - let $__num_= `select @max_var_number`; - let $__idx_= 1 ; - while ($__num_) - { - eval select @type_$__idx_ as type, - @string_$__idx_ as string, - @var_$__idx_ as uservariable ; - eval set @__parameter_= concat(@__parameter_, '@var_$__idx_ ,'); - inc $__idx_ ; - - dec $__num_ ; - } - # @__parameter_ contains a trailing ',' which must be cut away - set @__parameter_= substr(@__parameter_,1,length(@__parameter_) - 1); - let $__aux_= `select @__parameter_` ; - eval $__aux_ ; - - - ### Create a table from the uservariables and print out the column types - let $__aux_= `select concat('CREATE TABLE t9 AS ',@__parameter_)` ; - --disable_warnings - drop table if exists t9; - --enable_warnings - eval $__aux_ ; - show create table t9; - drop table t9; - - dec $__with_var_ ; - } - ### Print debug informations for patchwork without variables - ### stmt_uv, stmt_ph, execute_stmt_ph and uservariables do NOT exist - let $__with_var_= `select @max_var_number = 0`; - while ($__with_var_) - { - ### Print out the content of the statement variables - eval select "--------------------------------------" - as "the content of the statement variable" - union select concat('@__stmt_c_ is: ',@__stmt_c_) ; - - dec $__with_var_ ; - } - - - dec $__debug_ ; -} - -## copy the statements and the execute into $variables -# (__stmt_ph_ is not needed) -## + generate the prepared statements ---enable_query_log -let $__stmt_c_= `select @__stmt_c_`; -eval prepare __stmt_c_ from @__stmt_c_ ; -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - let $__stmt_uv_= `select @__stmt_uv_`; - eval prepare __stmt_uv_ from @__stmt_uv_ ; - let $__execute_ph= `select @__execute_stmt_ph`; - eval prepare __stmt_ph_ from @__stmt_ph_ ; - dec $__with_var_ ; -} - - -##### The execution of all statements -## statement with Constants -eval $__stmt_c_ ; -## prepared statement with Constants -execute __stmt_c_ ; -# Try to detect if the prior executes damaged the parse tree by -# two additional executes . -execute __stmt_c_ ; -execute __stmt_c_ ; -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - ## statement with Uservariables - eval $__stmt_uv_ ; - ## prepared statement with Uservariables - execute __stmt_uv_ ; - # Try to detect if the prior executes damaged the parse tree by - # two additional executes . - execute __stmt_uv_ ; - execute __stmt_uv_ ; - ## prepared statement with placeholders - eval $__execute_ph ; - # Try to detect if the prior executes damaged the parse tree by - # two additional executes . - eval $__execute_ph ; - eval $__execute_ph ; - - dec $__with_var_ ; -} diff --git a/mysql-test/r/ps_12func.result b/mysql-test/r/ps_12func.result deleted file mode 100644 index 881d5392edd..00000000000 --- a/mysql-test/r/ps_12func.result +++ /dev/null @@ -1,4748 +0,0 @@ -use test; - -###### Variations on ROUND(X,D) ###### - -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ') as my_col' ; -set @max_var_number= 2; -set @string_1= '11.298' ; -set @type_1= 'DOUBLE' ; -set @type_2= 'BIGINT' ; -set @string_2= '1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '3' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,3) as my_col ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -set @string_2= '4' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,4) as my_col ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -set @string_2= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,0) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -set @string_2= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-1) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-2) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '-3' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-3) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '1.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.0) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '3.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,3.0) as my_col ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -set @string_2= '4.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,4.0) as my_col ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -set @string_2= '0.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,0.0) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -set @string_2= '-1.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-1.0) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-2.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '-3.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-3.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '1.1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.1) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '1.9' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.9) as my_col ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '-11' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-11) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @string_1= '0' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '11.49' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.49) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '10.51' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(10.51) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '0.0' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(0.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '-11.49' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-11.49) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @string_1= '-10.51' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-10.51) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @stmt_part_2= 'select ROUND() as my_col' ; -set @max_var_number= 0; -prepare __stmt_c_ from @__stmt_c_ ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -select ROUND( ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE - -###### Variations on CONCAT_WS(separator,str1,str2,...) ###### - -set @stmt_part_1= 'select CONCAT_WS(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ') as my_col' ; -set @max_var_number= 3; -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My','QL') as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'LONGBLOB' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @type_2= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @type_2= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'NULL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @type_3= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @stmt_part_1= "select CONCAT_WS('S',IF(" ; -set @stmt_part_2= ' IS NULL, ' ; -set @stmt_part_3= ' , ' ; -set @stmt_part_4= "),'QL') as my_col" ; -set @max_var_number= 3; -set @string_1= 'My' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',IF('My' IS NULL, 'X' , 'My'),'QL') as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CONCAT_WS('S',IF(@var_1 IS NULL, @var_2 , @var_3),'QL') as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; - -###### Variations on CHAR(N,...) ###### - -set @stmt_part_1= 'select CHAR(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ',' ; -set @stmt_part_6= ') as my_col' ; -set @max_var_number= 5; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR(77,121,83,81,76) as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CHAR(@var_1 ,@var_2,@var_3,@var_4,@var_5) as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= 'NULL' ; -set @type_5= 'BIGINT' ; -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; - -###### Variations on CHAR_LENGTH ###### - -set @stmt_part_1= 'select CHAR_LENGTH(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -set @string_1= 'MySQL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH('MySQL') as my_col ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL - -###### Variations on FIELD(str,str1,str2,str3,...) ###### - -set @stmt_part_1= 'select FIELD(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ') as my_col' ; -set @max_var_number= 4; -set @string_1= 'Hit' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '1it' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'Hit' ; -set @type_3= 'LONGTEXT' ; -set @string_4= '3it' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD('Hit','1it','Hit','3it') as my_col ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -set @string_1= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD(NULL,'1it','Hit','3it') as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -set @string_3= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD(NULL,'1it',NULL,'3it') as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 - -###### Variations on INSERT(str,pos,len,newstr) ###### - -set @stmt_part_1= "select INSERT(" ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ") as my_col" ; -set @max_var_number= 4; -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,4,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_2= '+30.0E-1' ; -set @type_2= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',+30.0E-1,4,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '+40.0E-1' ; -set @type_3= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,+40.0E-1,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT(NULL,3,4,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',NULL,4,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,NULL,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,4,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -set @string_2= '15' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',15,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_2= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',0,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_2= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',-1,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -set @string_3= '10' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,10,'1234') as my_col ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -set @string_3= '5' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,5,'1234') as my_col ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -set @string_3= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,0,'1234') as my_col ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -set @string_3= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,-1,'1234') as my_col ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 - -###### Variations on BIN(N) ###### - -set @stmt_part_1= "select BIN(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; -set @string_1= '12' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(12) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select BIN(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '2147483648' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(2147483648) as my_col ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -select BIN(@var_1 ) as my_col ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -set @string_1= '0' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select BIN(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= '-1' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(-1) as my_col ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -select BIN(@var_1 ) as my_col ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -set @string_1= '9000000000000000000' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(9000000000000000000) as my_col ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -select BIN(@var_1 ) as my_col ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -set @string_1= '12.9E-0' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(12.9E-0) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -set @string_1= '0.129E+2' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(0.129E+2) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 - -###### Variations on BIT_LENGT(str) ###### - -set @stmt_part_1= "select BIT_LENGTH(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; -set @string_1= 'text' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIT_LENGTH('text') as my_col ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -select BIT_LENGTH(@var_1 ) as my_col ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIT_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select BIT_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL - -###### Variations on CONV(N,from_base,to_base) ###### - -set @stmt_part_1= "select CONV(" ; -set @stmt_part_2= "," ; -set @stmt_part_3= "," ; -set @stmt_part_4= ") as my_col" ; -set @max_var_number= 3; -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(-37,10,10) as my_col ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); -set @type_1= 'LONGTEXT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV('18446744073709551579',10,10) as my_col ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,-10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(-37,10,-10) as my_col ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,11) as my_col ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,11,10) as my_col ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(10,10,11) as my_col ; -my_col -A -execute __stmt_c_ ; -my_col -A -execute __stmt_c_ ; -my_col -A -execute __stmt_c_ ; -my_col -A -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -set @string_1= 'A' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV('A',11,10) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(11,10,11) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(10,11,10) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '36' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,36) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '36' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(11,36,10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(NULL,10,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '37' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,NULL,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_2= '10' ; -set @string_3= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_3= '10' ; -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '37' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,37,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,1,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,0,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '-1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,-1,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '37' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,37) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '1' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,1) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '0' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,0,0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-1' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,-1) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-37' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,-37) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL diff --git a/mysql-test/r/tool_test.result b/mysql-test/r/tool_test.result deleted file mode 100644 index 7be7645d8eb..00000000000 --- a/mysql-test/r/tool_test.result +++ /dev/null @@ -1,223 +0,0 @@ -use test ; -set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; -set @max_var_number= 0; -the content of the statement variable --------------------------------------- -@__stmt_c_ is: SELECT 1 as "my_fine_statement" -prepare __stmt_c_ from @__stmt_c_ ; -SELECT 1 as "my_fine_statement" ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -set @stmt_part_1= 'SELECT ' ; -set @stmt_part_2= ' + ' ; -set @stmt_part_3= ' + ' ; -set @stmt_part_4= ' + ' ; -set @stmt_part_5= ' + ' ; -set @stmt_part_6= ' + ' ; -set @stmt_part_7= ' + ' ; -set @stmt_part_8= ' + ' ; -set @stmt_part_9= ' as "my_fine_statement"' ; -set @max_var_number= 8; -set @string_1= '1' ; -set @type_1= 'BIGINT' ; -set @string_2= 'nULL' ; -set @type_2= 'BIGINT' ; -set @string_3= '2.0' ; -set @type_3= 'DOUBLE' ; -set @string_4= 'NuLL' ; -set @type_4= 'DOUBLE' ; -set @string_5= 'TEXT' ; -set @type_5= 'LONGTEXT' ; -set @string_6= 'NUlL' ; -set @type_6= 'LONGTEXT' ; -set @string_7= 'BLOB' ; -set @type_7= 'LONGBLOB' ; -set @string_8= 'NULl' ; -set @type_8= 'LONGBLOB' ; -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; -the content of the statement variables --------------------------------------- -@__stmt_c_ is: SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" -@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" -@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" -@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 -the content of the parameter variables --------------------------------------- -type string uservariable -BIGINT 1 1 -type string uservariable -BIGINT nULL NULL -type string uservariable -DOUBLE 2.0 2 -type string uservariable -DOUBLE NuLL NULL -type string uservariable -LONGTEXT TEXT TEXT -type string uservariable -LONGTEXT NUlL NULL -type string uservariable -LONGBLOB BLOB BLOB -type string uservariable -LONGBLOB NULl NULL -@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 -1 NULL 2 NULL TEXT NULL BLOB NULL -Table Create Table -t9 CREATE TABLE `t9` ( - `@var_1` bigint(20) default NULL, - `@var_2` bigint(20) default NULL, - `@var_3` double default NULL, - `@var_4` double default NULL, - `@var_5` longtext, - `@var_6` longtext, - `@var_7` longblob, - `@var_8` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -set @string_1= '1.0' ; -set @type_1= 'DOUBLE' ; -set @string_2= '3.0' ; -set @type_2= 'DOUBLE' ; -set @string_3= '2' ; -set @type_3= 'BIGINT' ; -set @string_4= '4' ; -set @type_4= 'BIGINT' ; -set @string_5= '5' ; -set @type_5= 'BIGINT' ; -set @string_6= '6' ; -set @type_6= 'DOUBLE' ; -set @string_7= '7' ; -set @type_7= 'DOUBLE' ; -set @string_8= '8' ; -set @type_8= 'DOUBLE' ; -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; -the content of the statement variables --------------------------------------- -@__stmt_c_ is: SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" -@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" -@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" -@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 -the content of the parameter variables --------------------------------------- -type string uservariable -DOUBLE 1.0 1 -type string uservariable -DOUBLE 3.0 3 -type string uservariable -BIGINT 2 2 -type string uservariable -BIGINT 4 4 -type string uservariable -BIGINT 5 5 -type string uservariable -DOUBLE 6 6 -type string uservariable -DOUBLE 7 7 -type string uservariable -DOUBLE 8 8 -@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 -1 3 2 4 5 6 7 8 -Table Create Table -t9 CREATE TABLE `t9` ( - `@var_1` double default NULL, - `@var_2` double default NULL, - `@var_3` bigint(20) default NULL, - `@var_4` bigint(20) default NULL, - `@var_5` bigint(20) default NULL, - `@var_6` double default NULL, - `@var_7` double default NULL, - `@var_8` double default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 diff --git a/mysql-test/t/ps_12func.test b/mysql-test/t/ps_12func.test deleted file mode 100644 index 65abffe946c..00000000000 --- a/mysql-test/t/ps_12func.test +++ /dev/null @@ -1,867 +0,0 @@ -##################### ps_12func.test ##################### -# # -# Prepared Statement tests of functions # -# # -# Non prepared variants are also checked # -# # -# Checked functions: # -# # -# ROUND(X,D) and ROUND(X) # -# CONCAT_WS(separator,str1,str2,...) # -# CHAR(N,...) # -# CHAR_LENGTH(str) # -# FIELD(str,str1,str2,str3,...) # -# INSERT(str,pos,len,newstr) # -# BIN(N) # -# BIT_LENGTH(str) # -# CONV(N,from_base,to_base) # -# # -########################################################## - -use test; - -# "--disable_abort_on_error" is definitely needed, because there are some tests -# which intentional produce statements with wrong syntax and it is not -# possible to put a "--error " just before the execution calls -# within patchwork-test.inc . ---disable_abort_on_error - -##### ROUND(X,D) ---disable_query_log -select concat('###### Variations on ROUND(X,D) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ') as my_col' ; -set @max_var_number= 2; - - -#------------------------------------------------------------------ -# first parameter 11.298 (DOUBLE) , ROUND( m.n , p ) m = 2 ; n = 3 -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= '11.298' ; -set @type_1= 'DOUBLE' ; -## data type BIGINT, if possible -set @type_2= 'BIGINT' ; -# p < n -set @string_2= '1' ; ---source include/patchwork-check.inc -# p = n -set @string_2= '3' ; ---source include/patchwork-check.inc -# p > n -set @string_2= '4' ; ---source include/patchwork-check.inc -# p = 0 -set @string_2= '0' ; ---source include/patchwork-check.inc -# -p < m -set @string_2= '-1' ; ---source include/patchwork-check.inc -# -p = m -set @string_2= '-2' ; ---source include/patchwork-check.inc -# -p > m -set @string_2= '-3' ; ---source include/patchwork-check.inc -# -p = NULL -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -## data type DOUBLE, if possible -set @type_2= 'DOUBLE' ; -# p < n -set @string_2= '1.0' ; ---source include/patchwork-check.inc -# p = n -set @string_2= '3.0' ; ---source include/patchwork-check.inc -# p > n -set @string_2= '4.0' ; ---source include/patchwork-check.inc -# p = 0 -set @string_2= '0.0' ; ---source include/patchwork-check.inc -# -p < m -set @string_2= '-1.0' ; ---source include/patchwork-check.inc -# -p = m -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -# -p > m -set @string_2= '-3.0' ; ---source include/patchwork-check.inc -# ugly values -set @string_2= '1.1' ; ---source include/patchwork-check.inc -set @string_2= '1.9' ; ---source include/patchwork-check.inc -# -p = NULL -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -## data type LONGBLOB, content NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type BIGINT, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type DOUBLE, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type LONGBLOB, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# ROUND(D) Returns the argument X, rounded to the nearest integer. -#------------------------------------------------------------------ -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -## test cases with BIGINT -set @string_1= '11' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '-11' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '0' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -## test cases with BIGINT -set @string_1= '11.49' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '10.51' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '0.0' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '-11.49' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '-10.51' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -## Incomplete statement -set @stmt_part_2= 'select ROUND() as my_col' ; -set @max_var_number= 0; ---source include/patchwork-check.inc - -##### CONCAT_WS(separator,str1,str2,...) -# Example: CONCAT_WS('S','My','QL') ---disable_query_log -select concat('###### Variations on CONCAT_WS(separator,str1,str2,...) ######') -as '' union select ''; ---enable_query_log -set @stmt_part_1= 'select CONCAT_WS(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ') as my_col' ; -set @max_var_number= 3; - -### common case -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -### The separator (first parameter) is NULL. -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - -### The first string (second parameter) is NULL. -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'LONGBLOB' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_2= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_2= 'DOUBLE' ; ---source include/patchwork-check.inc - -### The second string (third parameter) is NULL. -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'NULL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_3= 'DOUBLE' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# some complicated things -#------------------------------------------------------------------ -# select concat_ws('S',IF(parameter1=NULL,parameter2,parameter3),'QL') -set @stmt_part_1= "select CONCAT_WS('S',IF(" ; -set @stmt_part_2= ' IS NULL, ' ; -set @stmt_part_3= ' , ' ; -set @stmt_part_4= "),'QL') as my_col" ; -set @max_var_number= 3; - -# common case -set @string_1= 'My' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc - -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; -# deactivated because of -# Bug#6297 : prepared statement, wrong handling of IS NULL -# let $__debug_= 1; -# --source include/patchwork-check.inc - -##### CHAR(N,...) -# Example(Manual): SELECT CHAR(77,121,83,81,'76'); ---disable_query_log -select concat('###### Variations on CHAR(N,...) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select CHAR(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ',' ; -set @stmt_part_6= ') as my_col' ; -set @max_var_number= 5; - -### common case -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -# Only the first parameter is NULL. -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -##### ugly maybe wrong result -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Only one non first/last parameter is NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Two neighbour parameters in the middle are NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Only the last parameter is NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= 'NULL' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## The first parameter is NULL with bad type. -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - - -##### CHAR_LENGTH(str) ---disable_query_log -select concat('###### Variations on CHAR_LENGTH ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select CHAR_LENGTH(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; - -### common case -set @string_1= 'MySQL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - - -##### FIELD(str,str1,str2,str3,...) ---disable_query_log -select concat('###### Variations on FIELD(str,str1,str2,str3,...) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select FIELD(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ') as my_col' ; -set @max_var_number= 4; - -### common case -set @string_1= 'Hit' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '1it' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'Hit' ; -set @type_3= 'LONGTEXT' ; -set @string_4= '3it' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -# string to search for is NULL, all other strings not NULL -set @string_1= 'NULL' ; -# Bug#6321: strange error, string function FIELD(, .. ---source include/patchwork-check.inc -# string to search for and one of the other is NULL -set @string_3= 'NULL' ; -# Bug#6321: strange error, string function FIELD(, .. ---source include/patchwork-check.inc - - -##### INSERT(str,pos,len,newstr) -# Manual Example: SELECT INSERT('Quadratic', 3, 4, 'What') -> 'QuWhattic' ---disable_query_log -select concat('###### Variations on INSERT(str,pos,len,newstr) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select INSERT(" ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ") as my_col" ; -set @max_var_number= 4; - -### common case (modified manual example) -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Try DOUBLE instead of BIGINT for pos and len -#------------------------------------------------------------------ -set @string_2= '+30.0E-1' ; -set @type_2= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '+40.0E-1' ; -set @type_3= 'DOUBLE' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Variations on the second parameter (start position) -#------------------------------------------------------------------ -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -# start position > length of the first string (9) -set @string_2= '15' ; ---source include/patchwork-check.inc -# start position = 0 -set @string_2= '0' ; ---source include/patchwork-check.inc -# start position < 0 -set @string_2= '-1' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Variations on the third parameter (# of chars of string one to be replaced) -#------------------------------------------------------------------ -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -## chars to be replaced > length of the second string -# start pos (3) + replace length(10) > length of first string(9) -set @string_3= '10' ; ---source include/patchwork-check.inc -# start pos (3) + chars to be replaced (5) < length of first string(9) -set @string_3= '5' ; ---source include/patchwork-check.inc -# chars to be replaced = 0 -set @string_3= '0' ; ---source include/patchwork-check.inc -# chars to be replaced < 0 -set @string_3= '-1' ; ---source include/patchwork-check.inc - - -##### BIN(N) -# manual example: SELECT BIN(12); -> '1100' ---disable_query_log -select concat('###### Variations on BIN(N) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select BIN(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; - -set @string_1= '12' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -#### Variations on the parameter -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '2147483648' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '0' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '-1' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9000000000000000000' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '12.9E-0' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '0.129E+2' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - -##### BIT_LENGTH(str) -# Manual example: SELECT BIT_LENGTH('text'); -> 32 ---disable_query_log -select concat('###### Variations on BIT_LENGT(str) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select BIT_LENGTH(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; - -set @string_1= 'text' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - -# try NULL -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - - -##### CONV(N,from_base,to_base) -# Manual example: SELECT CONV(-17,10,-18); -> '-H' ---disable_query_log -select concat('###### Variations on CONV(N,from_base,to_base) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select CONV(" ; -set @stmt_part_2= "," ; -set @stmt_part_3= "," ; -set @stmt_part_4= ") as my_col" ; -set @max_var_number= 3; - -#------------------------------------------------------------------ -# Manual: If to_base is a negative number, N is regarded as a signed number. -# Otherwise, N is treated as unsigned. -# Experiments with positive/negative number/to_base -#------------------------------------------------------------------ -# number positive written, to_base positive -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number negative written, to_base positive -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# The last result (unsigned) BIGINT 18446744073709551579 might be surprising. -# The next statements could give an explanation. -set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); -set @type_1= 'LONGTEXT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number positive written, to_base negative -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number negative written, to_base negative -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# conversions to and from the exotic 11 based number system -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= 'A' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Try the maximum base value 36 -#------------------------------------------------------------------ -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '36' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '36' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '37' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc -set @string_2= '10' ; -set @string_3= 'NULL' ; ---source include/patchwork-check.inc -set @string_3= '10' ; - -#------------------------------------------------------------------ -# The rule for from_base is: 2 <= from_base <= 36 -# Try values outside of this range. -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '37' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '-1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# The rule for to_base is: 2<= ABS(to_base) <= 36 -# Try values outside of this range. -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '37' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '1' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '0' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-1' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-37' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - - diff --git a/mysql-test/t/tool_test.test b/mysql-test/t/tool_test.test deleted file mode 100644 index b28eae2c17d..00000000000 --- a/mysql-test/t/tool_test.test +++ /dev/null @@ -1,105 +0,0 @@ -########################### tool_test.test ############################# -# # -# Test sequences for the check of mysqltest based test tools # -# # -# Checked routines: # -# include/patchwork-check.inc # -# # -######################################################################## - -##### Check of include/patchwork-check.inc -# -use test ; ---disable_abort_on_error - -#----------------------------------------------------------------------- -# Simple test (special case): -# The statement is made of only one piece and does not contain variables. -#----------------------------------------------------------------------- -set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; -set @max_var_number= 0; -# switch debug output on (Attention: patchwork-check.inc will switch it off) -let $__debug_= 1; ---source include/patchwork-check.inc - -#----------------------------------------------------------------------- -# Test case with many statement pieces and variables of all in -# include/patchwork-check.inc available data types. -#----------------------------------------------------------------------- -set @stmt_part_1= 'SELECT ' ; -set @stmt_part_2= ' + ' ; -set @stmt_part_3= ' + ' ; -set @stmt_part_4= ' + ' ; -set @stmt_part_5= ' + ' ; -set @stmt_part_6= ' + ' ; -set @stmt_part_7= ' + ' ; -set @stmt_part_8= ' + ' ; -set @stmt_part_9= ' as "my_fine_statement"' ; -set @max_var_number= 8; - -set @string_1= '1' ; -set @type_1= 'BIGINT' ; -set @string_2= 'nULL' ; -set @type_2= 'BIGINT' ; -set @string_3= '2.0' ; -set @type_3= 'DOUBLE' ; -set @string_4= 'NuLL' ; -set @type_4= 'DOUBLE' ; -set @string_5= 'TEXT' ; -set @type_5= 'LONGTEXT' ; -set @string_6= 'NUlL' ; -set @type_6= 'LONGTEXT' ; -set @string_7= 'BLOB' ; -set @type_7= 'LONGBLOB' ; -set @string_8= 'NULl' ; -set @type_8= 'LONGBLOB' ; - -# Initialization of all uservariables to the data type LONGTEXT and content, -# which will not be repeated within the following tests. -# 'include/patchwork-check.inc' MUST destroy all these settings. -# That is why this initialization is NOT needed within test cases -# calling include/patchwork-check.inc . -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; - -# switch debug output on (Attention: patchwork-check.inc will switch it off) -let $__debug_= 1; ---source include/patchwork-check.inc - -### Execute the statement with more useful content of the variables. -set @string_1= '1.0' ; -set @type_1= 'DOUBLE' ; -set @string_2= '3.0' ; -set @type_2= 'DOUBLE' ; -set @string_3= '2' ; -set @type_3= 'BIGINT' ; -set @string_4= '4' ; -set @type_4= 'BIGINT' ; -set @string_5= '5' ; -set @type_5= 'BIGINT' ; -set @string_6= '6' ; -set @type_6= 'DOUBLE' ; -set @string_7= '7' ; -set @type_7= 'DOUBLE' ; -set @string_8= '8' ; -set @type_8= 'DOUBLE' ; - -# Initialization -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; - -# switch debug output on (Attention: include/patchwork-check.inc switches it off) -let $__debug_= 1; ---source include/patchwork-check.inc -- cgit v1.2.1 From 9a202517f562adc467e0b461d898bbcd6edee77a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 23:37:43 +0100 Subject: Fix for BUG#7358: removing warning reporting of mysqldump 4.1.8 when calling SHOW CREATE DATABASE, as we deal almost gracefully with it (back to behaviour of 4.1.7). Warning was not fatal: mysqldump continued. And the good thing is that it helped spot that starting from 4.1.7, SHOW CREATE DATABASE failed (if --single-transaction and first db has non-empty InnoDB table and there is a second db) and thus mysqldump produced CREATE DATABASE statements missing the CHARACTER SET clause. Removing the bug which was in the server, and the warning reporting in mysqldump (compatibility with old servers). client/mysqldump.c: don't report errors as we deal almost gracefully with them (back to code of 4.1.7) mysql-test/r/flush_block_commit.result: result update mysql-test/t/flush_block_commit.test: let's verify that SHOW CREATE DATABASE succeeds even if connection has open transaction. sql/sql_parse.cc: There is no reason to forbid SHOW CREATE DATABASE if connection has an open transaction --- client/mysqldump.c | 2 +- mysql-test/r/flush_block_commit.result | 8 ++++++++ mysql-test/t/flush_block_commit.test | 8 ++++++++ sql/sql_parse.cc | 5 ----- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 11892a3458f..c36f9d3e23e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1914,7 +1914,7 @@ static int init_dumping(char *database) sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s", qdatabase); - if (mysql_query_with_error_report(sock, &dbinfo, qbuf)) + if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) { /* Old server version, dump generic CREATE DATABASE */ fprintf(md_result_file, diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index 4a7575d8f7a..2e9f1920937 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -28,4 +28,12 @@ commit; unlock tables; flush tables with read lock; unlock tables; +begin; +select * from t1; +a +1 +10 +show create database test; +Database Create Database +test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ drop table t1; diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index ac14b7b98bc..87715452089 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -1,6 +1,7 @@ # Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing # transactions. # We verify that we did not introduce a deadlock. +# This is intended to mimick how mysqldump and innobackup work. -- source include/have_innodb.inc @@ -63,4 +64,11 @@ unlock tables; connection con2; flush tables with read lock; # bug caused hang here unlock tables; + +# BUG#7358 SHOW CREATE DATABASE fails if open transaction + +begin; +select * from t1; +show create database test; + drop table t1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8dc1339993e..55d26a68116 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3249,11 +3249,6 @@ purposes internal to the MySQL server", MYF(0)); } if (check_access(thd,SELECT_ACL,lex->name,0,1,0)) break; - if (thd->locked_tables || thd->active_transaction()) - { - send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); - goto error; - } res=mysqld_show_create_db(thd,lex->name,&lex->create_info); break; } -- cgit v1.2.1 From 4f9a0a06a8d60d68022fb813b59df8aacd5e4460 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 02:07:32 +0000 Subject: Bug#7391 - Multi-table UPDATE security regression Add in missing privilege checks. Tests for the privileges. mysql-test/r/grant.result: Bug#7391 - Multi-table UPDATE security regression Tests column, table and db level access mysql-test/t/grant.test: Bug#7391 - Multi-table UPDATE security regression Tests column, table and db level access sql/sql_update.cc: Bug#7391 - Multi-table UPDATE security regression Add in missing privilege checks. --- mysql-test/r/grant.result | 64 +++++++++++++++++++++++++++++++++++++++++ mysql-test/t/grant.test | 72 +++++++++++++++++++++++++++++++++++++++++++++++ sql/sql_update.cc | 20 +++++++++++++ 3 files changed, 156 insertions(+) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index f0e5d16e916..2a433e3d5db 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -156,3 +156,67 @@ select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; host db user select_priv insert_priv delete from mysql.user where user='test6123'; drop database db6123; +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT SELECT (b) ON `mysqltest_1`.`t2` TO 'mysqltest_3'@'localhost' +GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'q' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +select command denied to user: 'mysqltest_3@localhost' for table 't1' +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +SELECT command denied to user: 'mysqltest_3@localhost' for column 's' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +1 2 10 2 +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'a' in table 't1' +use mysqltest_2; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +500 2 600 2 +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 21173a356ce..d9b4be04de3 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -2,6 +2,8 @@ drop table if exists t1; --enable_warnings +connect (master,localhost,root,,); +connection master; # # Test that SSL options works properly # @@ -114,3 +116,73 @@ grant usage on db6123.* to test6123 identified by 'magic123'; select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; delete from mysql.user where user='test6123'; drop database db6123; + +# +# Bug#7391: Cross-database multi-table UPDATE security problem +# +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; + +#test the column privileges +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +connect (conn1,localhost,mysqltest_3,,); +connection conn1; +show grants for mysqltest_3@localhost; +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +--error 1142 +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +--error 1143 +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +--error 1143 +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +#the following two should work +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; + +#test the db/table level privileges +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +disconnect conn1; +connect (conn2,localhost,mysqltest_3,,); +connection conn2; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +# the following failed before, should fail now. +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +use mysqltest_2; +#the following used to succeed, it must fail now. +--error 1044 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +--error 1044 +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +--error 1044 +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +#lets see the result +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; + +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cdcc90e8651..f7355f2e9b6 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -465,21 +465,34 @@ int mysql_multi_update(THD *thd, */ for (tl= table_list ; tl ; tl=tl->next) { + TABLE_LIST *save= tl->next; TABLE *table= tl->table; + uint wants; + tl->next= 0; if (update_map & table->map) { DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); tl->lock_type= thd->lex.lock_option; tl->updating= 1; + wants= UPDATE_ACL; } else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); tl->lock_type= TL_READ; tl->updating= 0; + wants= SELECT_ACL; } if (!using_lock_tables) tl->table->reginfo.lock_type= tl->lock_type; + + if (check_access(thd, wants, tl->db, &tl->grant.privilege, 0, 0) || + (grant_option && check_grant(thd, wants, tl, 0, 0))) + { + tl->next= save; + DBUG_RETURN(0); + } + tl->next= save; } /* Relock the tables with the correct modes */ @@ -541,6 +554,13 @@ int mysql_multi_update(THD *thd, } } + /* + If we have no WHERE clause, make it true otherwise the Select + examines the privileges + */ + if (!conds) + conds= new Item_int("1", 1LL, 1); + if (!(result=new multi_update(thd, table_list, fields, values, handle_duplicates))) DBUG_RETURN(-1); -- cgit v1.2.1 From c6be66530a1391c88b250c6212fb8a26084778c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 02:34:11 +0000 Subject: Remove bogus lines --- sql/sql_update.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f7355f2e9b6..4f7e34ec74f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -554,13 +554,6 @@ int mysql_multi_update(THD *thd, } } - /* - If we have no WHERE clause, make it true otherwise the Select - examines the privileges - */ - if (!conds) - conds= new Item_int("1", 1LL, 1); - if (!(result=new multi_update(thd, table_list, fields, values, handle_duplicates))) DBUG_RETURN(-1); -- cgit v1.2.1 From c892bc8beabfd218ae99bcd93a23b5c02849ff7f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 22:25:35 -0500 Subject: my-innodb-heavy-4G.cnf.sh: I fixed the typos in the transaction-isolation comments. I fixed the spelling mistakes in the comment. It had tripped up a support customer as they couldn't start the server with transaction-isolation= read-commited support-files/my-innodb-heavy-4G.cnf.sh: I fixed the typos in the transaction-isolation comments. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + support-files/my-innodb-heavy-4G.cnf.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index f4e5f08ae63..c5d9551ebf1 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -104,6 +104,7 @@ magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi mats@mysql.com +matt@booty.(none) matt@mysql.com matthias@three.local.lan miguel@hegel.(none) diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 6def311f474..062d106ce6a 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -177,7 +177,7 @@ default_table_type = MYISAM thread_stack = 192K # Set the default transaction isolation level. Levels available are: -# READ-UNCOMMITED, READ-COMMITED, REPEATABLE-READ, SERIALIZABLE +# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE transaction_isolation = REPEATABLE-READ # Maximum size for internal (in-memory) temporary tables. If a table -- cgit v1.2.1 From 2ca011d4608bac018986e0509c9d74ddafca50ec Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 13:45:19 +0200 Subject: Simplify code during review --- sql/sql_select.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2df0d45f8ed..eda4ce73186 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4951,10 +4951,7 @@ join_read_system(JOIN_TAB *tab) table->file->print_error(error,MYF(0)); return 1; } - if (tab->on_expr) - mark_as_null_row(tab->table); - else - table->null_row=1; // Why do this for inner join? + mark_as_null_row(tab->table); empty_record(table); // Make empty record return -1; } @@ -4984,10 +4981,7 @@ join_read_const(JOIN_TAB *tab) } if (error) { - if (tab->on_expr) - mark_as_null_row(tab->table); - else - table->null_row=1; + mark_as_null_row(tab->table); empty_record(table); if (error != HA_ERR_KEY_NOT_FOUND) { -- cgit v1.2.1 From 63e472550347b990d26f92af1e874a57bf0a6201 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 11:57:17 +0000 Subject: Fix test --- mysql-test/r/update.result | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 2d0903a4dae..7810d52d156 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -203,7 +203,6 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; -drop table if exists t1, t2; create table t1 (c1 int, c2 char(6), c3 int); create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); -- cgit v1.2.1 From b1eb45210bc2259cec791252259f2496d70a7161 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 15:15:41 +0000 Subject: Fix test results --- mysql-test/r/grant.result | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 38f7ca13a4b..d6d5a3e99ea 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -359,13 +359,13 @@ GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'q' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; -ERROR 42000: SELECT command denied to user 'mysqltest_3@localhost' for column 'd' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2' update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'c' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; -ERROR 42000: SELECT command denied to user 'mysqltest_3@localhost' for column 's' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; @@ -384,14 +384,14 @@ flush privileges; use mysqltest_1; update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'a' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'a' in table 't1' use mysqltest_2; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; a q b r 10 2 1 2 -- cgit v1.2.1 From d8432ada2c6b4a7550e17053d3824736ee75ddea Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 14:22:20 -0600 Subject: fill_help_tables.sh: Convert @samp{c} to 'c', not c. scripts/fill_help_tables.sh: Convert @samp{c} to 'c', not c. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + scripts/fill_help_tables.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index c5d9551ebf1..782259dea02 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -159,6 +159,7 @@ nick@nick.leippe.com papa@gbichot.local patg@krsna.patg.net paul@central.snake.net +paul@frost.snake.net paul@ice.local paul@ice.snake.net paul@kite-hub.kitebird.com diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 51edfc8af78..fbe7c597b34 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -203,7 +203,7 @@ sub prepare_name $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; @@ -254,7 +254,7 @@ sub prepare_description $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; -- cgit v1.2.1 From b824756c00b235bc6825d561c833ffed2f2e0d38 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 14:30:00 -0600 Subject: mysql.cc: Fix up mysql help messages. client/mysql.cc: Fix up mysql help messages. --- client/mysql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 8e9dd84c8f0..0ea0f10f5d7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1677,7 +1677,7 @@ static int com_server_help(String *buffer __attribute__((unused)), if (num_fields == 2) { put_info("Many help items for your request exist.", INFO_INFO); - put_info("To make a more specific request, please type 'help ',\nwhere item is one of the following", INFO_INFO); + put_info("To make a more specific request, please type 'help ',\nwhere is one of the following", INFO_INFO); num_name= 0; num_cat= 1; last_char= '_'; @@ -1685,7 +1685,7 @@ static int com_server_help(String *buffer __attribute__((unused)), else if ((cur= mysql_fetch_row(result))) { tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]); - put_info("For more information, type 'help ', where item is one of the following", INFO_INFO); + put_info("For more information, type 'help ', where is one of the following", INFO_INFO); num_name= 1; num_cat= 2; print_help_item(&cur,1,2,&last_char); -- cgit v1.2.1 From 6cbcd3423afd72961d7f04c5536426ba92e24db8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Dec 2004 20:28:52 +0300 Subject: Fix assertion failure in client_test when linked with the embedded library: stmt_update_metadata (used when we update max_length in mysql_stmt_store_result) needs valid row->length. libmysqld/lib_sql.cc: row->length is asserted to be valid in stmt_update_metadata --- libmysqld/lib_sql.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8092d87b97c..917bcada564 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -710,6 +710,7 @@ bool Protocol_prep::write() } cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS)); memcpy(cur->data, packet->ptr()+1, packet->length()-1); + cur->length= packet->length(); /* To allow us to do sanity checks */ *data->prev_ptr= cur; data->prev_ptr= &cur->next; -- cgit v1.2.1 From 8c01aba776c21448f1f10be51200cd2d1ebd2ab5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 12:36:14 +0100 Subject: added config parameter Group on connection moved NdbWaiter, m_ndb_cluster_connection, to impl class moved node selection things to cluster connection moved all private things to impl class added opts for shared memory and node selection changed opts handling somewhat; introduced enum for options and common handling of option variables added checks for transporter support automatic addition of shared mem transporters moved wait_until_ready code to cluster connection added control of usage of new node selection method ndb/include/mgmapi/mgmapi_config_parameters.h: added config parameter Group on connection ndb/include/ndbapi/Ndb.hpp: moved NdbWaiter, m_ndb_cluster_connection, to impl class moved node selection things to cluster connection ndb/include/ndbapi/ndb_cluster_connection.hpp: moved all private things to impl class ndb/include/util/ndb_opts.h: added opts for shared memory and node selection ndb/src/kernel/vm/Configuration.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/mgmclient/main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/mgmsrv/ConfigInfo.cpp: added checks for transporter support automatic addition of shared mem transporters ndb/src/mgmsrv/MgmtSrvr.cpp: in alloc node id first choose connection with specified hostname ndb/src/mgmsrv/main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/ndbapi/DictCache.hpp: added include file ndb/src/ndbapi/Ndb.cpp: enabled using new node selection method moved wait_until_ready code to cluster connection moved node selection (hint) to cluster connection removed start transaction dgroup ndb/src/ndbapi/NdbDictionaryImpl.hpp: removed and added inclusde files ndb/src/ndbapi/NdbImpl.hpp: moved things from Ndb into Impl class moved waiter things to new file NdbWaiter.hpp ndb/src/ndbapi/NdbScanOperation.cpp: ndbwaiter is no in impl class ndb/src/ndbapi/Ndbif.cpp: ndbwaiter is no in impl class ndb/src/ndbapi/Ndbinit.cpp: moved some Ndb things into impl class ndb/src/ndbapi/TransporterFacade.hpp: changed friend declaration ndb/src/ndbapi/ndb_cluster_connection.cpp: moved node selection things to cluster connection moved things from cluster connection to cluster connection impl class ndb/test/ndbapi/testNdbApi.cpp: removed start transaction dgroup ndb/tools/delete_all.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/desc.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/drop_index.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/drop_tab.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/listTables.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/restore/restore_main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/select_all.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/select_count.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/waiter.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables sql/ha_ndbcluster.cc: added control of usage of new node selection method sql/mysqld.cc: added control of usage of new node selection method --- ndb/include/mgmapi/mgmapi_config_parameters.h | 1 + ndb/include/ndbapi/Ndb.hpp | 83 ---- ndb/include/ndbapi/ndb_cluster_connection.hpp | 31 +- ndb/include/util/ndb_opts.h | 59 ++- ndb/src/kernel/vm/Configuration.cpp | 12 +- ndb/src/mgmclient/main.cpp | 6 +- ndb/src/mgmsrv/ConfigInfo.cpp | 184 ++++++-- ndb/src/mgmsrv/MgmtSrvr.cpp | 15 + ndb/src/mgmsrv/main.cpp | 56 ++- ndb/src/ndbapi/DictCache.hpp | 1 + ndb/src/ndbapi/Ndb.cpp | 266 +++-------- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- ndb/src/ndbapi/NdbImpl.hpp | 75 +-- ndb/src/ndbapi/NdbScanOperation.cpp | 16 +- ndb/src/ndbapi/NdbWaiter.hpp | 102 +++++ ndb/src/ndbapi/Ndbif.cpp | 56 ++- ndb/src/ndbapi/Ndbinit.cpp | 36 +- ndb/src/ndbapi/TransporterFacade.hpp | 2 +- ndb/src/ndbapi/ndb_cluster_connection.cpp | 604 +++++++++++++++++++++---- ndb/src/ndbapi/ndb_cluster_connection_impl.hpp | 100 ++++ ndb/test/ndbapi/testNdbApi.cpp | 8 + ndb/tools/delete_all.cpp | 6 +- ndb/tools/desc.cpp | 6 +- ndb/tools/drop_index.cpp | 6 +- ndb/tools/drop_tab.cpp | 6 +- ndb/tools/listTables.cpp | 8 +- ndb/tools/restore/restore_main.cpp | 5 +- ndb/tools/select_all.cpp | 6 +- ndb/tools/select_count.cpp | 6 +- ndb/tools/waiter.cpp | 6 +- sql/ha_ndbcluster.cc | 21 +- sql/mysqld.cc | 44 +- 32 files changed, 1225 insertions(+), 610 deletions(-) create mode 100644 ndb/src/ndbapi/NdbWaiter.hpp create mode 100644 ndb/src/ndbapi/ndb_cluster_connection_impl.hpp diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 6a0cd376355..406bdb1a110 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -110,6 +110,7 @@ #define CFG_CONNECTION_SERVER_PORT 406 #define CFG_CONNECTION_HOSTNAME_1 407 #define CFG_CONNECTION_HOSTNAME_2 408 +#define CFG_CONNECTION_GROUP 409 #define CFG_TCP_SERVER 452 #define CFG_TCP_SEND_BUFFER_SIZE 454 diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 1c9c2db5d6b..766409d64e2 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -901,23 +901,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*); NDB_MAX_SCHEMA_NAME_SIZE + \ NDB_MAX_TAB_NAME_SIZE*2 -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL -class NdbWaiter { -public: - NdbWaiter(); - ~NdbWaiter(); - - void wait(int waitTime); - void nodeFail(Uint32 node); - void signal(Uint32 state); - - Uint32 m_node; - Uint32 m_state; - void * m_mutex; - struct NdbCondition * m_condition; -}; -#endif - /** * @class Ndb * @brief Represents the NDB kernel and is the main class of the NDB API. @@ -1199,39 +1182,6 @@ public: const char * keyData = 0, Uint32 keyLen = 0); -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL - /** - * This method is a modification of Ndb::startTransaction, - * in which we use only the first two chars of keyData to - * select transaction coordinator. - * This is referred to as a distribution group. - * There are two ways to use the method: - * - In the first, the two characters are used directly as - * the distribution key, and - * - in the second the distribution is calculated as: - * (10 * (char[0] - 0x30) + (char[1] - 0x30)). - * Thus, in the second way, the two ASCII digits '78' - * will provide the distribution key = 78. - * - * @note Transaction priorities are not yet supported. - * - * @param aPrio Priority of the transaction.
- * Priority 0 is the highest priority and is used for short transactions - * with requirements on low delay.
- * Priority 1 is a medium priority for short transactions.
- * Priority 2 is a medium priority for long transactions.
- * Priority 3 is a low priority for long transactions. - * @param keyData is a string of which the two first characters - * is used to compute which fragement the data is stored in. - * @param type is the type of distribution group.
- * 0 means direct usage of the two characters, and
- * 1 means the ASCII digit variant. - * @return NdbConnection, or NULL if it failed. - */ - NdbConnection* startTransactionDGroup(Uint32 aPrio, - const char * keyData, int type); -#endif - /** * When a transactions is completed, the transaction has to be closed. * @@ -1586,8 +1536,6 @@ private: /****************************************************************************** * These are the private variables in this class. *****************************************************************************/ - Ndb_cluster_connection *m_ndb_cluster_connection; - NdbConnection** thePreparedTransactionsArray; NdbConnection** theSentTransactionsArray; NdbConnection** theCompletedTransactionsArray; @@ -1601,8 +1549,6 @@ private: Uint32 theNextConnectNode; - NdbWaiter theWaiter; - bool fullyQualifiedNames; // Ndb database name. @@ -1658,35 +1604,6 @@ private: InitConfigError } theInitState; - /** - * Computes fragement id for primary key - * - * Note that keydata has to be "shaped" as it is being sent in KEYINFO - */ - Uint32 computeFragmentId(const char * keyData, Uint32 keyLen); - Uint32 getFragmentId(Uint32 hashValue); - - /** - * Make a guess to which node is the primary for the fragment - */ - Uint32 guessPrimaryNode(Uint32 fragmentId); - - /** - * Structure containing values for guessing primary node - */ - struct StartTransactionNodeSelectionData { - StartTransactionNodeSelectionData(): - fragment2PrimaryNodeMap(0) {}; - Uint32 kValue; - Uint32 hashValueMask; - Uint32 hashpointerValue; - Uint32 noOfFragments; - Uint32 * fragment2PrimaryNodeMap; - - void init(Uint32 noOfNodes, Uint8 nodeIds[]); - void release(); - } startTransactionNodeSelectionData; - NdbApiSignal* theCommitAckSignal; diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index db1cd0b119e..1b1c8575656 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -18,13 +18,7 @@ #ifndef CLUSTER_CONNECTION_HPP #define CLUSTER_CONNECTION_HPP -class TransporterFacade; -class ConfigRetriever; -struct NdbThread; - -extern "C" { - void* run_ndb_cluster_connection_connect_thread(void*); -} +struct Ndb_cluster_connection_node_iter; class Ndb_cluster_connection { public: @@ -32,16 +26,27 @@ public: ~Ndb_cluster_connection(); int connect(int no_retries, int retry_delay_in_seconds, int verbose); int start_connect_thread(int (*connect_callback)(void)= 0); + + // add check coupled to init state of cluster connection + // timeout_after_first_alive negative - ok only if all alive + // timeout_after_first_alive positive - ok if some alive + int wait_until_ready(int timeout_for_first_alive, + int timeout_after_first_alive); + const char *get_connectstring(char *buf, int buf_sz) const; int get_connected_port() const; const char *get_connected_host() const; + + void set_optimized_node_selection(int val); + + Uint32 no_db_nodes(); + private: - friend void* run_ndb_cluster_connection_connect_thread(void*); - void connect_thread(); - TransporterFacade *m_facade; - ConfigRetriever *m_config_retriever; - NdbThread *m_connect_thread; - int (*m_connect_callback)(void); + friend class Ndb; + friend class NdbImpl; + friend class Ndb_cluster_connection_impl; + class Ndb_cluster_connection_impl & m_impl; + Ndb_cluster_connection(Ndb_cluster_connection_impl&); }; #endif diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index f7ae3b5489e..4bac36f5e5e 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -17,47 +17,62 @@ #ifndef _NDB_OPTS_H #define _NDB_OPTS_H +#include #include #include #include #include -#ifndef DBUG_OFF -#define NDB_STD_OPTS(prog_name) \ - { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \ - 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "usage", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "help", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "version", 'V', "Output version information and exit.", 0, 0, 0, \ - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "ndb-connectstring", 'c', \ - "Set connect string for connecting to ndb_mgmd. " \ - "Syntax: \"[nodeid=;][host=][:]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ - { "connect-string", 'c', "same as --ndb-connectstring",\ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } +#define NDB_STD_OPTS_VARS \ +const char *opt_connect_str= 0;\ +my_bool opt_ndb_shm;\ +my_bool opt_ndb_optimized_node_selection + +#define NDB_STD_OPTS_OPTIONS \ +OPT_NDB_SHM= 256,\ +OPT_NDB_OPTIMIZED_NODE_SELECTION + +#define OPT_NDB_CONNECTSTRING 'c' + +#ifdef NDB_SHM_TRANSPORTER +#define OPT_NDB_SHM_DEFAULT 1 #else -#define NDB_STD_OPTS(prog_name) \ +#define OPT_NDB_SHM_DEFAULT 0 +#endif + +#define NDB_STD_OPTS_COMMON \ { "usage", '?', "Display this help and exit.", \ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ { "help", '?', "Display this help and exit.", \ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ { "version", 'V', "Output version information and exit.", 0, 0, 0, \ GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "ndb-connectstring", 'c', \ + { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=;][host=][:]\". " \ "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ - { "connect-string", 'c', "same as --ndb-connectstring",\ + { "ndb-shm", OPT_NDB_SHM,\ + "Allow optimizing using shared memory connections when available",\ + (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\ + GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\ + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\ + "Select nodes for transactions in a more optimal way",\ + (gptr*) &opt_ndb_optimized_node_selection,\ + (gptr*) &opt_ndb_optimized_node_selection, 0,\ + GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\ + { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } + +#ifndef DBUG_OFF +#define NDB_STD_OPTS(prog_name) \ + { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \ + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \ + NDB_STD_OPTS_COMMON +#else +#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON #endif #endif /*_NDB_OPTS_H */ diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 3de84bb0566..29255fc9837 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -46,7 +46,13 @@ extern "C" { #include extern EventLogger g_eventLogger; -static const char* opt_connect_str= 0; +enum ndbd_options { + NDB_STD_OPTS_OPTIONS, + OPT_INITIAL, + OPT_NODAEMON +}; + +NDB_STD_OPTS_VARS; static int _daemon, _no_daemon, _initial, _no_start; /** * Arguments to NDB process @@ -54,7 +60,7 @@ static int _daemon, _no_daemon, _initial, _no_start; static struct my_option my_long_options[] = { NDB_STD_OPTS("ndbd"), - { "initial", 256, + { "initial", OPT_INITIAL, "Perform initial start of ndbd, including cleaning the file system. " "Consult documentation before using this", (gptr*) &_initial, (gptr*) &_initial, 0, @@ -66,7 +72,7 @@ static struct my_option my_long_options[] = { "daemon", 'd', "Start ndbd as daemon (default)", (gptr*) &_daemon, (gptr*) &_daemon, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, - { "nodaemon", 257, + { "nodaemon", OPT_NODAEMON, "Do not start ndbd as daemon, provided for testing purposes", (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 84e27790705..9417c03805f 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -56,9 +56,13 @@ handler(int sig){ } } +enum ndb_mgm_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char default_prompt[]= "ndb_mgm> "; static unsigned _try_reconnect; -static char *opt_connect_str= 0; static const char *prompt= default_prompt; static char *opt_execute_str= 0; diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ab2e34f6d3a..800ffe2e361 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -23,6 +23,8 @@ #include "InitConfigFileParser.hpp" #include +extern my_bool opt_ndb_shm; + #define MAX_LINE_LENGTH 255 #define KEY_INTERNAL 0 #define MAX_INT_RNIL 0xfffffeff @@ -79,6 +81,7 @@ static bool transformSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformNode(InitConfigFileParser::Context & ctx, const char *); static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *); +static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *); static bool transformConnection(InitConfigFileParser::Context & ctx, const char *); static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *); @@ -108,6 +111,11 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { "TCP", checkConnectionSupport, 0 }, + { "SHM", checkConnectionSupport, 0 }, + { "SCI", checkConnectionSupport, 0 }, + { "OSE", checkConnectionSupport, 0 }, + { "TCP", transformConnection, 0 }, { "SHM", transformConnection, 0 }, { "SCI", transformConnection, 0 }, @@ -130,6 +138,8 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixHostname, "HostName1" }, { "TCP", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "SCI", fixHostname, "HostName1" }, { "SCI", fixHostname, "HostName2" }, { "SHM", fixHostname, "HostName1" }, @@ -197,6 +207,9 @@ static bool sanity_checks(Vector§ions, static bool add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); +static bool set_connection_priorities(Vector§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data); static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); @@ -208,6 +221,7 @@ const ConfigInfo::ConfigRule ConfigInfo::m_ConfigRules[] = { { sanity_checks, 0 }, { add_node_connections, 0 }, + { set_connection_priorities, 0 }, { add_server_ports, 0 }, { check_node_vs_replicas, 0 }, { 0, 0 } @@ -1582,6 +1596,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MANDATORY, 0, 0 }, + { + CFG_CONNECTION_GROUP, + "Group", + "TCP", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "55", + "0", "200" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1747,6 +1772,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MANDATORY, 0, 0 }, + { + CFG_CONNECTION_GROUP, + "Group", + "SHM", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "35", + "0", "200" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1780,7 +1816,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_USED, false, ConfigInfo::CI_INT, - MANDATORY, + "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1857,6 +1893,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "0", STR_VALUE(MAX_INT_RNIL) }, + { + CFG_CONNECTION_GROUP, + "Group", + "SCI", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "15", + "0", "200" }, + { CFG_CONNECTION_HOSTNAME_1, "HostName1", @@ -2681,11 +2728,50 @@ transformExtNode(InitConfigFileParser::Context & ctx, const char * data){ } /** - * Connection rule: Update "NoOfConnections" + * Connection rule: Check support of connection */ bool -transformConnection(InitConfigFileParser::Context & ctx, const char * data){ +checkConnectionSupport(InitConfigFileParser::Context & ctx, const char * data) +{ + int error= 0; + if (strcasecmp("TCP",ctx.fname) == 0) + { + // always enabled + } + else if (strcasecmp("SHM",ctx.fname) == 0) + { +#ifndef NDB_SHM_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("SCI",ctx.fname) == 0) + { +#ifndef NDB_SCI_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("OSE",ctx.fname) == 0) + { +#ifndef NDB_OSE_TRANSPORTER + error= 1; +#endif + } + if (error) + { + ctx.reportError("Binary not compiled with this connection support, " + "[%s] starting at line: %d", + ctx.fname, ctx.m_sectionLineno); + return false; + } + return true; +} +/** + * Connection rule: Update "NoOfConnections" + */ +bool +transformConnection(InitConfigFileParser::Context & ctx, const char * data) +{ Uint32 connections = 0; ctx.m_userProperties.get("NoOfConnections", &connections); BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Connection_%d", connections); @@ -3398,11 +3484,51 @@ sanity_checks(Vector§ions, return true; } +static void +add_a_connection(Vector§ions, + struct InitConfigFileParser::Context &ctx, + Uint32 nodeId1, Uint32 nodeId2, bool use_shm) +{ + ConfigInfo::ConfigRuleSection s; + const char *hostname1= 0, *hostname2= 0; + const Properties *tmp; + + require(ctx.m_config->get("Node", nodeId1, &tmp)); + tmp->get("HostName", &hostname1); + + require(ctx.m_config->get("Node", nodeId2, &tmp)); + tmp->get("HostName", &hostname2); + + char buf[16]; + s.m_sectionData= new Properties(true); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); + s.m_sectionData->put("NodeId1", buf); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); + s.m_sectionData->put("NodeId2", buf); + + if (use_shm && + hostname1 && hostname1[0] && + hostname2 && hostname2[0] && + strcmp(hostname1,hostname2) == 0) + { + s.m_sectionType= BaseString("SHM"); + DBUG_PRINT("info",("adding SHM connection %d %d",nodeId1,nodeId2)); + } + else + { + s.m_sectionType= BaseString("TCP"); + DBUG_PRINT("info",("adding TCP connection %d %d",nodeId1,nodeId2)); + } + + sections.push_back(s); +} + static bool add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { + DBUG_ENTER("add_node_connections"); Uint32 i; Properties * props= ctx.m_config; Properties p_connections(true); @@ -3427,9 +3553,10 @@ add_node_connections(Vector§ions, ctx.m_userProperties.get("NoOfNodes", &nNodes); Properties p_db_nodes(true); - Properties p_api_mgm_nodes(true); + Properties p_api_nodes(true); + Properties p_mgm_nodes(true); - Uint32 i_db= 0, i_api_mgm= 0, n; + Uint32 i_db= 0, i_api= 0, i_mgm= 0, n; for (i= 0, n= 0; n < nNodes; i++){ const Properties * tmp; if(!props->get("Node", i, &tmp)) continue; @@ -3440,9 +3567,10 @@ add_node_connections(Vector§ions, if (strcmp(type,DB_TOKEN) == 0) p_db_nodes.put("", i_db++, i); - else if (strcmp(type,API_TOKEN) == 0 || - strcmp(type,MGM_TOKEN) == 0) - p_api_mgm_nodes.put("", i_api_mgm++, i); + else if (strcmp(type,API_TOKEN) == 0) + p_api_nodes.put("", i_api++, i); + else if (strcmp(type,MGM_TOKEN) == 0) + p_mgm_nodes.put("", i_mgm++, i); } Uint32 nodeId1, nodeId2, dummy; @@ -3451,39 +3579,39 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){ + for (i= 0; p_api_nodes.get("", i, &nodeId1); i++){ if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - return true; + for (i= 0; p_mgm_nodes.get("", i, &nodeId1); i++){ + if(!p_connections.get("", nodeId1, &dummy)) { + for (Uint32 j= 0;; j++){ + if(!p_db_nodes.get("", j, &nodeId2)) break; + add_a_connection(sections,ctx,nodeId1,nodeId2,0); + } + } + } + + DBUG_RETURN(true); } +static bool set_connection_priorities(Vector§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data) +{ + DBUG_ENTER("set_connection_priorities"); + DBUG_RETURN(true); +} static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 713dff912bb..3fcde997cb0 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2225,9 +2225,24 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (*nodeId != 0 || type != NDB_MGM_NODE_TYPE_MGM || no_mgm == 1) { // any match is ok + + if (config_hostname == 0 && + *nodeId == 0 && + type != NDB_MGM_NODE_TYPE_MGM) + { + if (!id_found) // only set if not set earlier + id_found= tmp; + continue; /* continue looking for a nodeid with specified + * hostname + */ + } + assert(id_found == 0); id_found= tmp; break; } + assert(no_mgm > 1); + assert(*nodeId != 0); + assert(type != NDB_MGM_NODE_TYPE_MGM); if (id_found) { // mgmt server may only have one match error_string.appfmt("Ambiguous node id's %d and %d.\n" "Suggest specifying node id in connectstring,\n" diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 992e827ceaa..04c95117214 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -89,50 +89,50 @@ bool g_StopServer; extern EventLogger g_EventLogger; extern int global_mgmt_server_check; -static char *opt_connect_str= 0; + +enum ndb_mgmd_options { + NDB_STD_OPTS_OPTIONS, + OPT_INTERACTIVE, + OPT_NO_NODEID_CHECKS, + OPT_NO_DAEMON +}; +NDB_STD_OPTS_VARS; + +#if NDB_VERSION_MAJOR <= 4 +#undef OPT_NDB_CONNECTSTRING +#define OPT_NDB_CONNECTSTRING 1023 +#else + +#endif static struct my_option my_long_options[] = { -#ifndef DBUG_OFF - { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", - 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, -#endif - { "usage", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "help", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "version", 'V', "Output version information and exit.", 0, 0, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "ndb-connectstring", 1023, - "Set connect string for connecting to ndb_mgmd. " - "Syntax: \"[nodeid=;][host=][:]\". " - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - { "connect-string", 1023, - "same as --ndb-connectstring.", - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + NDB_STD_OPTS("ndb_mgmd"), { "config-file", 'f', "Specify cluster configuration file", (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", (gptr*) &glob.daemon, (gptr*) &glob.daemon, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, - { "interactive", 256, "Run interactive. Not supported but provided for testing purposes", + { "interactive", OPT_INTERACTIVE, + "Run interactive. Not supported but provided for testing purposes", (gptr*) &glob.interactive, (gptr*) &glob.interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "no-nodeid-checks", 257, "Do not provide any node id checks", + { "no-nodeid-checks", OPT_NO_NODEID_CHECKS, + "Do not provide any node id checks", (gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "nodaemon", 258, "Don't run as daemon, but don't read from stdin", + { "nodaemon", OPT_NO_DAEMON, + "Don't run as daemon, but don't read from stdin", (gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, +#if NDB_VERSION_MAJOR <= 4 { "config-file", 'c', "-c provided for backwards compatability, will be removed in 5.0." " Use -f instead", (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, +#endif { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) @@ -164,6 +164,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'c': printf("Warning: -c will be removed in 5.0, use -f instead\n"); break; + case OPT_NDB_SHM: +#ifndef NDB_SHM_TRANSPORTER + printf("Warning: binary not compiled with shared memory support,\n" + "use configure option --with-ndb-shm to enable support.\n" + "Tcp connections will now be used instead\n"); + opt_ndb_shm= 0; +#endif + break; case '?': usage(); exit(0); diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index a517acee56b..58c08a93e61 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "NdbLinHash.hpp" class Ndb_local_table_info { diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index ca4592fb5eb..e9a125922c6 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -46,7 +46,6 @@ Connect to any node which has no connection at the moment. NdbConnection* Ndb::doConnect(Uint32 tConNode) { Uint32 tNode; - Uint32 i = 0;; Uint32 tAnyAlive = 0; int TretCode; @@ -65,26 +64,51 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode) // We will connect to any node. Make sure that we have connections to all // nodes. //**************************************************************************** - Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; - Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; - UintR Tcount = 0; - do { - theCurrentConnectIndex++; - if (theCurrentConnectIndex >= tNoOfDbNodes) { - theCurrentConnectIndex = 0; - }//if - Tcount++; - tNode = theImpl->theDBnodes[theCurrentConnectIndex]; - TretCode = NDB_connect(tNode); - if ((TretCode == 1) || (TretCode == 2)) { + if (theImpl->m_optimized_node_selection) + { + Ndb_cluster_connection_node_iter &node_iter= + theImpl->m_node_iter; + theImpl->m_ndb_cluster_connection.init_get_next_node(node_iter); + while ((tNode= theImpl->m_ndb_cluster_connection.get_next_node(node_iter))) + { + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - return getConnectedNdbConnection(tNode); - } else if (TretCode != 0) { - tAnyAlive = 1; - }//if - } while (Tcount < tNoOfDbNodes); + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; + }//if + } + } + else // just do a regular round robin + { + Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; + Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; + UintR Tcount = 0; + do { + theCurrentConnectIndex++; + if (theCurrentConnectIndex >= tNoOfDbNodes) + theCurrentConnectIndex = 0; + + Tcount++; + tNode= theImpl->theDBnodes[theCurrentConnectIndex]; + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { +//**************************************************************************** +// We have connections now to the desired node. Return +//**************************************************************************** + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; + }//if + } while (Tcount < tNoOfDbNodes); + } //**************************************************************************** // We were unable to find a free connection. If no node alive we will report // error code for cluster failure otherwise connection failure. @@ -149,8 +173,8 @@ Ndb::NDB_connect(Uint32 tNode) tReturnCode = tp->sendSignal(tSignal, tNode); releaseSignal(tSignal); if (tReturnCode != -1) { - theWaiter.m_node = tNode; - theWaiter.m_state = WAIT_TC_SEIZE; + theImpl->theWaiter.m_node = tNode; + theImpl->theWaiter.m_state = WAIT_TC_SEIZE; tReturnCode = receiveResponse(); }//if } else { @@ -243,50 +267,28 @@ Ndb::waitUntilReady(int timeout) DBUG_RETURN(-1); } - do { - if ((id = theNode) != 0) { - unsigned int foundAliveNode = 0; - TransporterFacade *tp = TransporterFacade::instance(); - tp->lock_mutex(); - for (unsigned int i = 0; i < theImpl->theNoOfDBnodes; i++) { - const NodeId nodeId = theImpl->theDBnodes[i]; - //************************************************ - // If any node is answering, ndb is answering - //************************************************ - if (tp->get_node_alive(nodeId) != 0) { - foundAliveNode++; - }//if - }//for - - tp->unlock_mutex(); - if (foundAliveNode == theImpl->theNoOfDBnodes) { - DBUG_RETURN(0); - }//if - if (foundAliveNode > 0) { - noChecksSinceFirstAliveFound++; - }//if - if (noChecksSinceFirstAliveFound > 30) { - DBUG_RETURN(0); - }//if - }//if theNode != 0 + while (theNode == 0) { if (secondsCounter >= timeout) - break; + { + theError.code = 4269; + DBUG_RETURN(-1); + } NdbSleep_MilliSleep(100); milliCounter += 100; if (milliCounter >= 1000) { secondsCounter++; milliCounter = 0; }//if - } while (1); - if (id == 0) { - theError.code = 4269; + } + + if (theImpl->m_ndb_cluster_connection.wait_until_ready + (timeout-secondsCounter,30)) + { + theError.code = 4009; DBUG_RETURN(-1); } - if (noChecksSinceFirstAliveFound > 0) { - DBUG_RETURN(0); - }//if - theError.code = 4009; - DBUG_RETURN(-1); + + DBUG_RETURN(0); } /***************************************************************************** @@ -311,8 +313,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen) */ Uint32 nodeId; if(keyData != 0) { - Uint32 fragmentId = computeFragmentId(keyData, keyLen); - nodeId = guessPrimaryNode(fragmentId); + nodeId = 0; // guess not supported + // nodeId = m_ndb_cluster_connection->guess_primary_node(keyData, keyLen); } else { nodeId = 0; }//if @@ -373,44 +375,6 @@ Ndb::hupp(NdbConnection* pBuddyTrans) }//if }//Ndb::hupp() -NdbConnection* -Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type) -{ - - char DGroup[4]; - if ((keyData == NULL) || - (type > 1)) { - theError.code = 4118; - return NULL; - }//if - if (theInitState == Initialised) { - theError.code = 0; - checkFailedNode(); - /** - * If the user supplied key data - * We will make a qualified quess to which node is the primary for the - * the fragment and contact that node - */ - Uint32 fragmentId; - if (type == 0) { - DGroup[0] = keyData[0]; - DGroup[1] = keyData[1]; - DGroup[2] = 0x30; - DGroup[3] = 0x30; - fragmentId = computeFragmentId(&DGroup[0], 4); - } else { - Uint32 hashValue = ((keyData[0] - 0x30) * 10) + (keyData[1] - 0x30); - fragmentId = getFragmentId(hashValue); - }//if - Uint32 nodeId = guessPrimaryNode(fragmentId); - NdbConnection* trans= startTransactionLocal(aPriority, nodeId); - DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx", - trans, trans ? trans->getTransactionId() : 0)); - return trans; - } else { - return NULL; - }//if -}//Ndb::startTransaction() NdbConnection* Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) @@ -1010,118 +974,6 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op) return ~0; } -static const Uint32 MAX_KEY_LEN_64_WORDS = 4; -static const Uint32 MAX_KEY_LEN_32_WORDS = 8; -static const Uint32 MAX_KEY_LEN_BYTES = 32; - -Uint32 -Ndb::computeFragmentId(const char * keyData, Uint32 keyLen) -{ - Uint64 tempData[MAX_KEY_LEN_64_WORDS]; - - const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words - const char * usedKeyData = 0; - - /** - * If key data buffer is not aligned (on 64 bit boundary) - * or key len is not a multiple of 4 - * Use temp data - */ - if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { - usedKeyData = keyData; - } else { - memcpy(&tempData[0], keyData, keyLen); - const int slack = keyLen & 3; - if(slack > 0) { - memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); - }//if - usedKeyData = (char *)&tempData[0]; - }//if - - Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); - - hashValue >>= startTransactionNodeSelectionData.kValue; - return getFragmentId(hashValue); -}//Ndb::computeFragmentId() - -Uint32 -Ndb::getFragmentId(Uint32 hashValue) -{ - Uint32 fragmentId = hashValue & - startTransactionNodeSelectionData.hashValueMask; - if(fragmentId < startTransactionNodeSelectionData.hashpointerValue) { - fragmentId = hashValue & - ((startTransactionNodeSelectionData.hashValueMask << 1) + 1); - }//if - return fragmentId; -} - -Uint32 -Ndb::guessPrimaryNode(Uint32 fragmentId){ - //ASSERT(((fragmentId > 0) && fragmentId < - // startTransactionNodeSelectionData.noOfFragments), "Invalid fragementId"); - - return startTransactionNodeSelectionData.fragment2PrimaryNodeMap[fragmentId]; -} - -void -Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, - Uint8 nodeIds[]) { - kValue = 6; - noOfFragments = 2 * noOfNodes; - - /** - * Compute hashValueMask and hashpointerValue - */ - { - Uint32 topBit = (1 << 31); - for(int i = 31; i>=0; i--){ - if((noOfFragments & topBit) != 0) - break; - topBit >>= 1; - } - hashValueMask = topBit - 1; - hashpointerValue = noOfFragments - (hashValueMask + 1); - } - - /** - * This initialization depends on - * the fact that: - * primary node for fragment i = i % noOfNodes - * - * This algorithm should be implemented in Dbdih - */ - { - if (fragment2PrimaryNodeMap != 0) - abort(); - - fragment2PrimaryNodeMap = new Uint32[noOfFragments]; - Uint32 i; - for(i = 0; i fragment2PrimaryNodeMap[j]){ - Uint32 tmp = fragment2PrimaryNodeMap[i]; - fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; - fragment2PrimaryNodeMap[j] = tmp; - } - - for(i = 0; i #include #include -#include "NdbImpl.hpp" +#include "NdbWaiter.hpp" #include "DictCache.hpp" class NdbDictObjectImpl { diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 21a4706f890..00a8ef19f3a 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -17,7 +17,9 @@ #ifndef NDB_IMPL_HPP #define NDB_IMPL_HPP +#include #include +#include #include #include #include @@ -26,6 +28,8 @@ #include +#include "ndb_cluster_connection_impl.hpp" +#include "NdbDictionaryImpl.hpp" #include "ObjectMap.hpp" /** @@ -33,11 +37,16 @@ */ class NdbImpl { public: - NdbImpl(); + NdbImpl(Ndb_cluster_connection *, Ndb&); ~NdbImpl(); + Ndb_cluster_connection_impl &m_ndb_cluster_connection; + + NdbDictionaryImpl m_dictionary; + // Ensure good distribution of connects Uint32 theCurrentConnectIndex; + Ndb_cluster_connection_node_iter m_node_iter; NdbObjectIdMap theNdbObjectIdMap; @@ -46,6 +55,10 @@ public: // 1 indicates to release all connections to node Uint32 the_release_ind[MAX_NDB_NODES]; + + NdbWaiter theWaiter; + + int m_optimized_node_selection; }; #ifdef VM_TRACE @@ -113,26 +126,6 @@ Ndb::checkInitState() Uint32 convertEndian(Uint32 Data); -enum WaitSignalType { - NO_WAIT = 0, - WAIT_NODE_FAILURE = 1, // Node failure during wait - WST_WAIT_TIMEOUT = 2, // Timeout during wait - - WAIT_TC_SEIZE = 3, - WAIT_TC_RELEASE = 4, - WAIT_NDB_TAMPER = 5, - WAIT_SCAN = 6, - - // DICT stuff - WAIT_GET_TAB_INFO_REQ = 11, - WAIT_CREATE_TAB_REQ = 12, - WAIT_DROP_TAB_REQ = 13, - WAIT_ALTER_TAB_REQ = 14, - WAIT_CREATE_INDX_REQ = 15, - WAIT_DROP_INDX_REQ = 16, - WAIT_LIST_TABLES_CONF = 17 -}; - enum LockMode { Read, Update, @@ -140,44 +133,4 @@ enum LockMode { Delete }; -#include - -inline -void -NdbWaiter::wait(int waitTime) -{ - const bool forever = (waitTime == -1); - const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - while (1) { - if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) - break; - if (forever) { - NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); - } else { - if (waitTime <= 0) { - m_state = WST_WAIT_TIMEOUT; - break; - } - NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); - waitTime = maxTime - NdbTick_CurrentMillisecond(); - } - } -} - -inline -void -NdbWaiter::nodeFail(Uint32 aNodeId){ - if (m_state != NO_WAIT && m_node == aNodeId){ - m_state = WAIT_NODE_FAILURE; - NdbCondition_Signal(m_condition); - } -} - -inline -void -NdbWaiter::signal(Uint32 state){ - m_state = state; - NdbCondition_Signal(m_condition); -} - #endif diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 88208409c08..a90c9f524a2 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -528,8 +528,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed, bool forceSend) /** * No completed... */ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; @@ -1358,8 +1358,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, Uint32 tmp = m_sent_receivers_count; s_idx = m_current_api_receiver; while(m_sent_receivers_count > 0 && !theError.code){ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; @@ -1506,8 +1506,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ */ while(theError.code == 0 && m_sent_receivers_count) { - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: @@ -1576,8 +1576,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ */ while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count) { - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: diff --git a/ndb/src/ndbapi/NdbWaiter.hpp b/ndb/src/ndbapi/NdbWaiter.hpp new file mode 100644 index 00000000000..8b7b2a75879 --- /dev/null +++ b/ndb/src/ndbapi/NdbWaiter.hpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2003 MySQL AB + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_WAITER_HPP +#define NDB_WAITER_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include + +enum WaitSignalType { + NO_WAIT = 0, + WAIT_NODE_FAILURE = 1, // Node failure during wait + WST_WAIT_TIMEOUT = 2, // Timeout during wait + + WAIT_TC_SEIZE = 3, + WAIT_TC_RELEASE = 4, + WAIT_NDB_TAMPER = 5, + WAIT_SCAN = 6, + + // DICT stuff + WAIT_GET_TAB_INFO_REQ = 11, + WAIT_CREATE_TAB_REQ = 12, + WAIT_DROP_TAB_REQ = 13, + WAIT_ALTER_TAB_REQ = 14, + WAIT_CREATE_INDX_REQ = 15, + WAIT_DROP_INDX_REQ = 16, + WAIT_LIST_TABLES_CONF = 17 +}; + +class NdbWaiter { +public: + NdbWaiter(); + ~NdbWaiter(); + + void wait(int waitTime); + void nodeFail(Uint32 node); + void signal(Uint32 state); + + Uint32 m_node; + Uint32 m_state; + void * m_mutex; + struct NdbCondition * m_condition; +}; + +inline +void +NdbWaiter::wait(int waitTime) +{ + const bool forever = (waitTime == -1); + const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; + while (1) { + if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) + break; + if (forever) { + NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); + } else { + if (waitTime <= 0) { + m_state = WST_WAIT_TIMEOUT; + break; + } + NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); + waitTime = maxTime - NdbTick_CurrentMillisecond(); + } + } +} + +inline +void +NdbWaiter::nodeFail(Uint32 aNodeId){ + if (m_state != NO_WAIT && m_node == aNodeId){ + m_state = WAIT_NODE_FAILURE; + NdbCondition_Signal(m_condition); + } +} + +inline +void +NdbWaiter::signal(Uint32 state){ + m_state = state; + NdbCondition_Signal(m_condition); +} + +#endif diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 232e55662f0..a4f233709c4 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -209,8 +209,6 @@ void Ndb::connected(Uint32 ref) tmpTheNode, theImpl->theNoOfDBnodes, theFirstTransId)); - startTransactionNodeSelectionData.init(theImpl->theNoOfDBnodes, - theImpl->theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -251,7 +249,7 @@ Ndb::report_node_failure(Uint32 node_id) theImpl->the_release_ind[node_id] = 1; // must come after theImpl->the_release_ind[0] = 1; - theWaiter.nodeFail(node_id); + theImpl->theWaiter.nodeFail(node_id); return; }//Ndb::report_node_failure() @@ -330,7 +328,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) NdbConnection* tCon; int tReturnCode = -1; const Uint32* tDataPtr = aSignal->getDataPtr(); - const Uint32 tWaitState = theWaiter.m_state; + const Uint32 tWaitState = theImpl->theWaiter.m_state; const Uint32 tSignalNumber = aSignal->readSignalNumber(); const Uint32 tFirstData = *tDataPtr; const Uint32 tLen = aSignal->getLength(); @@ -401,7 +399,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) break; case NdbReceiver::NDB_SCANRECEIVER: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; default: @@ -598,7 +596,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { goto InvalidSignal; }//if @@ -618,7 +616,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { return; }//if @@ -638,7 +636,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -656,7 +654,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -708,7 +706,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) return; tReturnCode = tCon->receiveDIHNDBTAMPER(aSignal); if (tReturnCode != -1) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } case GSN_SCAN_TABCONF: @@ -730,7 +728,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) tLen - ScanTabConf::SignalLength); } if (tReturnCode != -1 && tWaitState == WAIT_SCAN) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } else { goto InvalidSignal; @@ -749,7 +747,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) if (tCon->checkMagicNumber() == 0){ tReturnCode = tCon->receiveSCAN_TABREF(aSignal); if (tReturnCode != -1 && tWaitState == WAIT_SCAN){ - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } break; } @@ -774,7 +772,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) switch(com){ case 1: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; case 0: @@ -838,16 +836,16 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) goto InvalidSignal; }//switch - if (theWaiter.m_state == NO_WAIT) { + if (theImpl->theWaiter.m_state == NO_WAIT) { // Wake up the thread waiting for response - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); }//if return; InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(GSN=%d, theWaiter.m_state=%d)" + "(GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", tSignalNumber, tWaitState, @@ -895,7 +893,7 @@ Ndb::completedTransaction(NdbConnection* aCon) if ((theMinNoOfEventsToWakeUp != 0) && (theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) { theMinNoOfEventsToWakeUp = 0; - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); return; }//if } else { @@ -1155,9 +1153,9 @@ void Ndb::waitCompletedTransactions(int aMilliSecondsToWait, int noOfEventsToWaitFor) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; /** - * theWaiter.m_state = NO_WAIT; + * theImpl->theWaiter.m_state = NO_WAIT; * To ensure no messup with synchronous node fail handling * (see ReportFailure) */ @@ -1166,8 +1164,8 @@ Ndb::waitCompletedTransactions(int aMilliSecondsToWait, theMinNoOfEventsToWakeUp = noOfEventsToWaitFor; do { if (waitTime < 1000) waitTime = 1000; - NdbCondition_WaitTimeout(theWaiter.m_condition, - (NdbMutex*)theWaiter.m_mutex, + NdbCondition_WaitTimeout(theImpl->theWaiter.m_condition, + (NdbMutex*)theImpl->theWaiter.m_mutex, waitTime); if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) { break; @@ -1273,23 +1271,23 @@ Ndb::receiveResponse(int waitTime){ int tResultCode; TransporterFacade::instance()->checkForceSend(theNdbBlockNumber); - theWaiter.wait(waitTime); + theImpl->theWaiter.wait(waitTime); - if(theWaiter.m_state == NO_WAIT) { + if(theImpl->theWaiter.m_state == NO_WAIT) { tResultCode = 0; } else { #ifdef VM_TRACE - ndbout << "ERR: receiveResponse - theWaiter.m_state = "; - ndbout << theWaiter.m_state << endl; + ndbout << "ERR: receiveResponse - theImpl->theWaiter.m_state = "; + ndbout << theImpl->theWaiter.m_state << endl; #endif - if (theWaiter.m_state == WAIT_NODE_FAILURE){ + if (theImpl->theWaiter.m_state == WAIT_NODE_FAILURE){ tResultCode = -2; } else { tResultCode = -1; } - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } return tResultCode; }//Ndb::receiveResponse() @@ -1321,8 +1319,8 @@ Ndb::sendRecSignal(Uint16 node_id, if (tp->check_send_size(node_id, send_size)) { return_code = tp->sendSignal(aSignal, node_id); if (return_code != -1) { - theWaiter.m_node = node_id; - theWaiter.m_state = aWaitState; + theImpl->theWaiter.m_node = node_id; + theImpl->theWaiter.m_state = aWaitState; return_code = receiveResponse(); } else { return_code = -3; diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 9754c25ab15..e1af7bd4cc5 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -50,7 +50,9 @@ Ndb(const char* aDataBase); Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ -Ndb::Ndb( const char* aDataBase , const char* aSchema) { +Ndb::Ndb( const char* aDataBase , const char* aSchema) + : theImpl(NULL) +{ DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("(old)Ndb::Ndb this=0x%x", this)); if (theNoOfNdbObjects < 0) @@ -66,6 +68,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) { Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection, const char* aDataBase , const char* aSchema) + : theImpl(NULL) { DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this)); @@ -82,7 +85,10 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - m_ndb_cluster_connection= ndb_cluster_connection; + assert(theImpl == NULL); + theImpl= new NdbImpl(ndb_cluster_connection,*this); + theDictionary= &(theImpl->m_dictionary); + thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; theCompletedTransactionsArray= NULL; @@ -93,8 +99,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theMaxNoOfTransactions= 0; theMinNoOfEventsToWakeUp= 0; prefixEnd= NULL; - theImpl= NULL; - theDictionary= NULL; theConIdleList= NULL; theOpIdleList= NULL; theScanOpIdleList= NULL; @@ -153,14 +157,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, prefixEnd = prefixName + (len < (int) sizeof(prefixName) ? len : sizeof(prefixName) - 1); - theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; + theImpl->theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; // Signal that the constructor has finished OK if (theInitState == NotConstructed) theInitState = NotInitialised; - theImpl = new NdbImpl(); - { NdbGlobalEventBufferHandle *h= NdbGlobalEventBuffer_init(NDB_MAX_ACTIVE_EVENTS); @@ -171,11 +173,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theGlobalEventBufferHandle = h; } - theDictionary = new NdbDictionaryImpl(*this); - if (theDictionary == NULL) { - ndbout_c("Ndb cailed to allocate dictionary"); - exit(-1); - } DBUG_VOID_RETURN; } @@ -201,8 +198,6 @@ Ndb::~Ndb() DBUG_PRINT("enter",("Ndb::~Ndb this=0x%x",this)); doDisconnect(); - delete theDictionary; - NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){ @@ -245,7 +240,6 @@ Ndb::~Ndb() freeSignal(); releaseTransactionArrays(); - startTransactionNodeSelectionData.release(); delete []theConnectionArray; if(theCommitAckSignal != NULL){ @@ -292,14 +286,20 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } -NdbImpl::NdbImpl() : theNdbObjectIdMap(1024,1024), - theCurrentConnectIndex(0), - theNoOfDBnodes(0) +NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection, + Ndb& ndb) + : m_ndb_cluster_connection(ndb_cluster_connection->m_impl), + m_dictionary(ndb), + theCurrentConnectIndex(0), + theNdbObjectIdMap(1024,1024), + theNoOfDBnodes(0) { int i; for (i = 0; i < MAX_NDB_NODES; i++) { the_release_ind[i] = 0; } + m_optimized_node_selection= + m_ndb_cluster_connection.m_optimized_node_selection; } NdbImpl::~NdbImpl() diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 5680e3a6f03..99edea846c1 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -127,7 +127,7 @@ private: friend class ExtSender; ///< @todo Hack to be able to sendSignalUnCond friend class GrepSS; friend class Ndb; - friend class Ndb_cluster_connection; + friend class Ndb_cluster_connection_impl; int sendSignalUnCond(NdbApiSignal *, NodeId nodeId); diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index f436ee56ede..98a52786aab 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -18,7 +18,9 @@ #include #include -#include +#include "ndb_cluster_connection_impl.hpp" +#include +#include #include #include #include @@ -26,6 +28,8 @@ #include #include #include +#include +#include static int g_run_connect_thread= 0; @@ -35,56 +39,46 @@ NdbMutex *ndb_global_event_buffer_mutex= NULL; NdbMutex *ndb_print_state_mutex= NULL; #endif +/* + * Ndb_cluster_connection + */ + Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) + : m_impl(* new Ndb_cluster_connection_impl(connect_string)) { - DBUG_ENTER("Ndb_cluster_connection"); - DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); - m_facade= TransporterFacade::theFacadeInstance= new TransporterFacade(); +} - m_config_retriever= 0; - m_connect_thread= 0; - m_connect_callback= 0; +Ndb_cluster_connection::Ndb_cluster_connection +(Ndb_cluster_connection_impl& impl) : m_impl(impl) +{ +} - if (ndb_global_event_buffer_mutex == NULL) - { - ndb_global_event_buffer_mutex= NdbMutex_Create(); - } -#ifdef VM_TRACE - if (ndb_print_state_mutex == NULL) - { - ndb_print_state_mutex= NdbMutex_Create(); - } -#endif - m_config_retriever= - new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API); - if (m_config_retriever->hasError()) - { - printf("Could not connect initialize handle to management server: %s", - m_config_retriever->getErrorString()); - delete m_config_retriever; - m_config_retriever= 0; - } - DBUG_VOID_RETURN; +Ndb_cluster_connection::~Ndb_cluster_connection() +{ + Ndb_cluster_connection_impl *tmp = &m_impl; + if (this != tmp) + delete tmp; } int Ndb_cluster_connection::get_connected_port() const { - if (m_config_retriever) - return m_config_retriever->get_mgmd_port(); + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_port(); return -1; } const char *Ndb_cluster_connection::get_connected_host() const { - if (m_config_retriever) - return m_config_retriever->get_mgmd_host(); + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_host(); return 0; } -const char *Ndb_cluster_connection::get_connectstring(char *buf, int buf_sz) const +const char *Ndb_cluster_connection::get_connectstring(char *buf, + int buf_sz) const { - if (m_config_retriever) - return m_config_retriever->get_connectstring(buf,buf_sz); + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_connectstring(buf,buf_sz); return 0; } @@ -92,82 +86,415 @@ extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) { my_thread_init(); g_run_connect_thread= 1; - ((Ndb_cluster_connection*) me)->connect_thread(); + ((Ndb_cluster_connection_impl*) me)->connect_thread(); my_thread_end(); NdbThread_Exit(0); return me; } -void Ndb_cluster_connection::connect_thread() -{ - DBUG_ENTER("Ndb_cluster_connection::connect_thread"); - int r; - do { - NdbSleep_SecSleep(1); - if ((r = connect(0,0,0)) == 0) - break; - if (r == -1) { - printf("Ndb_cluster_connection::connect_thread error\n"); - DBUG_ASSERT(false); - g_run_connect_thread= 0; - } else { - // Wait before making a new connect attempt - NdbSleep_SecSleep(1); - } - } while (g_run_connect_thread); - if (m_connect_callback) - (*m_connect_callback)(); - DBUG_VOID_RETURN; -} - int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) { int r; DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); - m_connect_callback= connect_callback; + m_impl.m_connect_callback= connect_callback; if ((r = connect(0,0,0)) == 1) { DBUG_PRINT("info",("starting thread")); - m_connect_thread= + m_impl.m_connect_thread= NdbThread_Create(run_ndb_cluster_connection_connect_thread, - (void**)this, 32768, "ndb_cluster_connection", + (void**)&m_impl, 32768, "ndb_cluster_connection", NDB_THREAD_PRIO_LOW); } else if (r < 0) { DBUG_RETURN(-1); } - else if (m_connect_callback) + else if (m_impl.m_connect_callback) { - (*m_connect_callback)(); + (*m_impl.m_connect_callback)(); } DBUG_RETURN(0); } -int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int verbose) +void Ndb_cluster_connection::set_optimized_node_selection(int val) +{ + m_impl.m_optimized_node_selection= val; +} + +void +Ndb_cluster_connection_impl::init_get_next_node +(Ndb_cluster_connection_node_iter &iter) +{ + if (iter.scan_state != (Uint8)~0) + iter.cur_pos= iter.scan_state; + if (iter.cur_pos >= no_db_nodes()) + iter.cur_pos= 0; + iter.init_pos= iter.cur_pos; + iter.scan_state= 0; + // fprintf(stderr,"[init %d]",iter.init_pos); + return; +} + +Uint32 +Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &iter) +{ + Uint32 cur_pos= iter.cur_pos; + if (cur_pos >= no_db_nodes()) + return 0; + + Ndb_cluster_connection_impl::Node *nodes= m_impl.m_all_nodes.getBase(); + Ndb_cluster_connection_impl::Node &node= nodes[cur_pos]; + + if (iter.scan_state != (Uint8)~0) + { + assert(iter.scan_state < no_db_nodes()); + if (nodes[iter.scan_state].group == node.group) + iter.scan_state= ~0; + else + return nodes[iter.scan_state++].id; + } + + // fprintf(stderr,"[%d]",node.id); + + cur_pos++; + Uint32 init_pos= iter.init_pos; + if (cur_pos == node.next_group) + { + cur_pos= nodes[init_pos].this_group; + } + + // fprintf(stderr,"[cur_pos %d]",cur_pos); + if (cur_pos != init_pos) + iter.cur_pos= cur_pos; + else + { + iter.cur_pos= node.next_group; + iter.init_pos= node.next_group; + } + return node.id; +} + +Uint32 +Ndb_cluster_connection::no_db_nodes() +{ + return m_impl.m_all_nodes.size(); +} + + +int +Ndb_cluster_connection::wait_until_ready(int timeout, + int timeout_after_first_alive) +{ + DBUG_ENTER("Ndb_cluster_connection::wait_until_ready"); + TransporterFacade *tp = TransporterFacade::instance(); + if (tp == 0) + { + DBUG_RETURN(-1); + } + if (tp->ownId() == 0) + { + DBUG_RETURN(-1); + } + int secondsCounter = 0; + int milliCounter = 0; + int noChecksSinceFirstAliveFound = 0; + do { + unsigned int foundAliveNode = 0; + tp->lock_mutex(); + for(unsigned i= 0; i < no_db_nodes(); i++) + { + //************************************************ + // If any node is answering, ndb is answering + //************************************************ + if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) { + foundAliveNode++; + } + } + tp->unlock_mutex(); + + if (foundAliveNode == no_db_nodes()) + { + DBUG_RETURN(0); + } + else if (foundAliveNode > 0) + { + noChecksSinceFirstAliveFound++; + if (timeout_after_first_alive >= 0) + { + if (noChecksSinceFirstAliveFound > timeout_after_first_alive) + DBUG_RETURN(0); + } + else // timeout_after_first_alive < 0 + { + if (noChecksSinceFirstAliveFound > -timeout_after_first_alive) + DBUG_RETURN(-1); + } + } + else if (secondsCounter >= timeout) + { // no alive nodes and timed out + DBUG_RETURN(-1); + } + NdbSleep_MilliSleep(100); + milliCounter += 100; + if (milliCounter >= 1000) { + secondsCounter++; + milliCounter = 0; + }//if + } while (1); +} + + + +/* + * Ndb_cluster_connection_impl + */ + +Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * + connect_string) + : Ndb_cluster_connection(*this), + m_optimized_node_selection(1) +{ + DBUG_ENTER("Ndb_cluster_connection"); + DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); + m_transporter_facade= + TransporterFacade::theFacadeInstance= new TransporterFacade(); + + m_connect_thread= 0; + m_connect_callback= 0; + + if (ndb_global_event_buffer_mutex == NULL) + { + ndb_global_event_buffer_mutex= NdbMutex_Create(); + } +#ifdef VM_TRACE + if (ndb_print_state_mutex == NULL) + { + ndb_print_state_mutex= NdbMutex_Create(); + } +#endif + m_config_retriever= + new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API); + if (m_config_retriever->hasError()) + { + printf("Could not connect initialize handle to management server: %s", + m_config_retriever->getErrorString()); + delete m_config_retriever; + m_config_retriever= 0; + } + + DBUG_VOID_RETURN; +} + +Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() +{ + DBUG_ENTER("~Ndb_cluster_connection"); + DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); + TransporterFacade::stop_instance(); + if (m_connect_thread) + { + void *status; + g_run_connect_thread= 0; + NdbThread_WaitFor(m_connect_thread, &status); + NdbThread_Destroy(&m_connect_thread); + m_connect_thread= 0; + } + if (m_transporter_facade != 0) + { + delete m_transporter_facade; + if (m_transporter_facade != TransporterFacade::theFacadeInstance) + abort(); + TransporterFacade::theFacadeInstance= 0; + } + if (m_config_retriever) + delete m_config_retriever; + + // fragmentToNodeMap.release(); + + DBUG_VOID_RETURN; +} + +void +Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, + const ndb_mgm_configuration + &config) +{ + DBUG_ENTER("Ndb_cluster_connection_impl::init_nodes_vector"); + ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION); + + for(iter.first(); iter.valid(); iter.next()) + { + Uint32 nodeid1, nodeid2, remoteNodeId, group= 5; + const char * remoteHostName= 0, * localHostName= 0; + if(iter.get(CFG_CONNECTION_NODE_1, &nodeid1)) continue; + if(iter.get(CFG_CONNECTION_NODE_2, &nodeid2)) continue; + + if(nodeid1 != nodeid && nodeid2 != nodeid) continue; + remoteNodeId = (nodeid == nodeid1 ? nodeid2 : nodeid1); + + iter.get(CFG_CONNECTION_GROUP, &group); + + { + const char * host1= 0, * host2= 0; + iter.get(CFG_CONNECTION_HOSTNAME_1, &host1); + iter.get(CFG_CONNECTION_HOSTNAME_2, &host2); + localHostName = (nodeid == nodeid1 ? host1 : host2); + remoteHostName = (nodeid == nodeid1 ? host2 : host1); + } + + Uint32 type = ~0; + if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue; + + switch(type){ + case CONNECTION_TYPE_SHM:{ + break; + } + case CONNECTION_TYPE_SCI:{ + break; + } + case CONNECTION_TYPE_TCP:{ + // connecting through localhost + // check if config_hostname is local + if (SocketServer::tryBind(0,remoteHostName)) + group--; // upgrade group value + break; + } + case CONNECTION_TYPE_OSE:{ + break; + } + } + m_impl.m_all_nodes.push_back(Node(group,remoteNodeId)); + DBUG_PRINT("info",("saved %d %d", group,remoteNodeId)); + for (int i= m_impl.m_all_nodes.size()-2; + i >= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group; + i--) + { + Node tmp= m_impl.m_all_nodes[i]; + m_impl.m_all_nodes[i]= m_impl.m_all_nodes[i+1]; + m_impl.m_all_nodes[i+1]= tmp; + } + } + + int i; + Uint32 cur_group, i_group= 0; + cur_group= ~0; + for (i= (int)m_impl.m_all_nodes.size()-1; i >= 0; i--) + { + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i+1; + } + m_impl.m_all_nodes[i].next_group= i_group; + } + cur_group= ~0; + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) + { + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i; + } + m_impl.m_all_nodes[i].this_group= i_group; + } +#if 0 + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) + { + fprintf(stderr, "[%d] %d %d %d %d\n", + i, + m_impl.m_all_nodes[i].id, + m_impl.m_all_nodes[i].group, + m_impl.m_all_nodes[i].this_group, + m_impl.m_all_nodes[i].next_group); + } + + do_test(); +#endif + DBUG_VOID_RETURN; +} + +void +Ndb_cluster_connection_impl::do_test() +{ + Ndb_cluster_connection_node_iter iter; + int n= no_db_nodes()+5; + Uint32 *nodes= new Uint32[n+1]; + + for (int g= 0; g < n; g++) + { + for (int h= 0; h < n; h++) + { + Uint32 id; + Ndb_cluster_connection_node_iter iter2; + { + for (int j= 0; j < g; j++) + { + nodes[j]= get_next_node(iter2); + } + } + + for (int i= 0; i < n; i++) + { + init_get_next_node(iter); + fprintf(stderr, "%d dead:(", g); + id= 0; + while (id == 0) + { + if ((id= get_next_node(iter)) == 0) + break; + for (int j= 0; j < g; j++) + { + if (nodes[j] == id) + { + fprintf(stderr, " %d", id); + id= 0; + break; + } + } + } + fprintf(stderr, ")"); + if (id == 0) + { + break; + } + fprintf(stderr, " %d\n", id); + } + fprintf(stderr, "\n"); + } + } + delete [] nodes; +} + +int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, + int verbose) { DBUG_ENTER("Ndb_cluster_connection::connect"); const char* error = 0; do { - if (m_config_retriever == 0) + if (m_impl.m_config_retriever == 0) DBUG_RETURN(-1); - if (m_config_retriever->do_connect(no_retries,retry_delay_in_seconds,verbose)) + if (m_impl.m_config_retriever->do_connect(no_retries, + retry_delay_in_seconds, + verbose)) DBUG_RETURN(1); // mgmt server not up yet - Uint32 nodeId = m_config_retriever->allocNodeId(4/*retries*/,3/*delay*/); + Uint32 nodeId = m_impl.m_config_retriever->allocNodeId(4/*retries*/, + 3/*delay*/); if(nodeId == 0) break; - ndb_mgm_configuration * props = m_config_retriever->getConfig(); + ndb_mgm_configuration * props = m_impl.m_config_retriever->getConfig(); if(props == 0) break; - m_facade->start_instance(nodeId, props); + m_impl.m_transporter_facade->start_instance(nodeId, props); + + m_impl.init_nodes_vector(nodeId, *props); + ndb_mgm_destroy_configuration(props); - m_facade->connected(); + m_impl.m_transporter_facade->connected(); DBUG_RETURN(0); } while(0); ndbout << "Configuration error: "; - const char* erString = m_config_retriever->getErrorString(); + const char* erString = m_impl.m_config_retriever->getErrorString(); if (erString == 0) { erString = "No error specified!"; } @@ -175,29 +502,132 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, DBUG_RETURN(-1); } -Ndb_cluster_connection::~Ndb_cluster_connection() +void Ndb_cluster_connection_impl::connect_thread() { - DBUG_ENTER("~Ndb_cluster_connection"); - DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); - TransporterFacade::stop_instance(); - if (m_connect_thread) + DBUG_ENTER("Ndb_cluster_connection_impl::connect_thread"); + int r; + do { + NdbSleep_SecSleep(1); + if ((r = connect(0,0,0)) == 0) + break; + if (r == -1) { + printf("Ndb_cluster_connection::connect_thread error\n"); + DBUG_ASSERT(false); + g_run_connect_thread= 0; + } else { + // Wait before making a new connect attempt + NdbSleep_SecSleep(1); + } + } while (g_run_connect_thread); + if (m_connect_callback) + (*m_connect_callback)(); + DBUG_VOID_RETURN; +} + +/* + * Hint handling to select node + * ToDo: fix this + */ + +void +Ndb_cluster_connection_impl::FragmentToNodeMap::init(Uint32 noOfNodes, + Uint8 nodeIds[]) +{ + kValue = 6; + noOfFragments = 2 * noOfNodes; + + /** + * Compute hashValueMask and hashpointerValue + */ { - void *status; - g_run_connect_thread= 0; - NdbThread_WaitFor(m_connect_thread, &status); - NdbThread_Destroy(&m_connect_thread); - m_connect_thread= 0; + Uint32 topBit = (1 << 31); + for(int i = 31; i>=0; i--){ + if((noOfFragments & topBit) != 0) + break; + topBit >>= 1; + } + hashValueMask = topBit - 1; + hashpointerValue = noOfFragments - (hashValueMask + 1); } - if (m_facade != 0) + + /** + * This initialization depends on + * the fact that: + * primary node for fragment i = i % noOfNodes + * + * This algorithm should be implemented in Dbdih + */ { - delete m_facade; - if (m_facade != TransporterFacade::theFacadeInstance) + if (fragment2PrimaryNodeMap != 0) abort(); - TransporterFacade::theFacadeInstance= 0; + + fragment2PrimaryNodeMap = new Uint32[noOfFragments]; + Uint32 i; + for(i = 0; i fragment2PrimaryNodeMap[j]){ + Uint32 tmp = fragment2PrimaryNodeMap[i]; + fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; + fragment2PrimaryNodeMap[j] = tmp; + } + + for(i = 0; i> 2; // In words + const char * usedKeyData = 0; + + /** + * If key data buffer is not aligned (on 64 bit boundary) + * or key len is not a multiple of 4 + * Use temp data + */ + if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { + usedKeyData = keyData; + } else { + memcpy(&tempData[0], keyData, keyLen); + const int slack = keyLen & 3; + if(slack > 0) { + memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); + }//if + usedKeyData = (char *)&tempData[0]; + }//if + + Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); + + hashValue >>= fragmentToNodeMap.kValue; + + Uint32 fragmentId = hashValue & + fragmentToNodeMap.hashValueMask; + + if(fragmentId < fragmentToNodeMap.hashpointerValue) { + fragmentId = hashValue & + ((fragmentToNodeMap.hashValueMask << 1) + 1); + }//if + return fragmentId; +} + + +template class Vector; diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp new file mode 100644 index 00000000000..620eac296a3 --- /dev/null +++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifndef CLUSTER_CONNECTION_IMPL_HPP +#define CLUSTER_CONNECTION_IMPL_HPP + +#include +#include + +class TransporterFacade; +class ConfigRetriever; +class NdbThread; +class ndb_mgm_configuration; + +struct Ndb_cluster_connection_node_iter { + Ndb_cluster_connection_node_iter() : scan_state(~0), + init_pos(0), + cur_pos(0) {}; + Uint8 scan_state; + Uint8 init_pos; + Uint8 cur_pos; +}; + +extern "C" { + void* run_ndb_cluster_connection_connect_thread(void*); +} + +class Ndb_cluster_connection_impl : public Ndb_cluster_connection +{ + Ndb_cluster_connection_impl(const char *connectstring); + ~Ndb_cluster_connection_impl(); + + void do_test(); + + void init_get_next_node(Ndb_cluster_connection_node_iter &iter); + Uint32 get_next_node(Ndb_cluster_connection_node_iter &iter); + +private: + friend class Ndb; + friend class NdbImpl; + friend void* run_ndb_cluster_connection_connect_thread(void*); + friend class Ndb_cluster_connection; + + /** + * Structure containing values for guessing primary node + */ + struct FragmentToNodeMap { + FragmentToNodeMap(): + fragment2PrimaryNodeMap(0) {}; + Uint32 kValue; + Uint32 hashValueMask; + Uint32 hashpointerValue; + Uint32 noOfFragments; + Uint32 *fragment2PrimaryNodeMap; + + void init(Uint32 noOfNodes, Uint8 nodeIds[]); + void release(); + } fragmentToNodeMap; + + struct Node + { + Node(Uint32 _g= 0, Uint32 _id= 0) : this_group(0), + next_group(0), + group(_g), + id(_id) {}; + Uint32 this_group; + Uint32 next_group; + Uint32 group; + Uint32 id; + }; + + Vector m_all_nodes; + void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); + Uint32 guess_primary_node(const char * keyData, Uint32 keyLen); + + void connect_thread(); + + TransporterFacade *m_transporter_facade; + ConfigRetriever *m_config_retriever; + NdbThread *m_connect_thread; + int (*m_connect_callback)(void); + + int m_optimized_node_selection; +}; + +#endif diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index a1ebac609b6..69e534e6860 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -142,14 +142,22 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ 4); break; case 2: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(1, "TEST", 0); + */ break; case 3: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(2, "TEST", 1); + */ break; default: diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index 046ac8005d2..cdfaf2134ff 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -24,7 +24,11 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); -static const char* opt_connect_str= 0; +enum ndb_delete_all { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index c5e9efdfa8a..4bca51ee903 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -19,7 +19,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_desc_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _unqualified = 0; static struct my_option my_long_options[] = diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 6600811e0c4..2b7f8c1bce9 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -21,7 +21,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_drop_index_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 0661a8c599b..2b0b6908449 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -21,7 +21,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_drop_table_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index ccb6967e2dc..710af66f4de 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -161,13 +161,17 @@ list(const char * tabname, } } -static const char* opt_connect_str= 0; +enum ndb_show_tables_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _loops; static int _type; static struct my_option my_long_options[] = { - NDB_STD_OPTS("ndb_desc"), + NDB_STD_OPTS("ndb_show_tables"), { "database", 'd', "Name of database table is in", (gptr*) &_dbname, (gptr*) &_dbname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index ece2b2605b4..c24ed620b71 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -36,7 +36,10 @@ static Vector g_consumers; static const char* ga_backupPath = "." DIR_SEPARATOR; -static const char* opt_connect_str= NULL; +enum ndb_restore_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; /** * print and restore flags diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 5efeed485a4..9c65750094b 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -36,7 +36,11 @@ int scanReadRecords(Ndb*, char delim, bool orderby); -static const char* opt_connect_str= 0; +enum ndb_select_all_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static const char* _delimiter = "\t"; static int _unqualified, _header, _parallelism, _useHexFormat, _lock, diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index c3491f842d8..516eebda91d 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -32,7 +32,11 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int* count_rows, UtilTransactions::ScanLock lock); -static const char* opt_connect_str= 0; +enum ndb_select_count_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _parallelism = 240; static int _lock = 0; diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 5973b046f8f..4b86de36514 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -30,7 +30,11 @@ int waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); -static const char* opt_connect_str= 0; +enum ndb_waiter_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static int _no_contact = 0; static int _timeout = 120; static struct my_option my_long_options[] = diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 029fe31ecf7..eb201ee6ef5 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -32,6 +32,10 @@ #include #include +// options from from mysqld.cc +extern my_bool opt_ndb_optimized_node_selection; +extern const char *opt_ndbcluster_connectstring; + // Default value for parallelism static const int parallelism= 240; @@ -39,9 +43,6 @@ static const int parallelism= 240; // createable against NDB from this handler static const int max_transactions= 256; -// connectstring to cluster if given by mysqld -const char *ndbcluster_connectstring= 0; - static const char *ha_ndb_ext=".ndb"; #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 @@ -4233,15 +4234,19 @@ bool ndbcluster_init() int res; DBUG_ENTER("ndbcluster_init"); // Set connectstring if specified - if (ndbcluster_connectstring != 0) - DBUG_PRINT("connectstring", ("%s", ndbcluster_connectstring)); + if (opt_ndbcluster_connectstring != 0) + DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring)); if ((g_ndb_cluster_connection= - new Ndb_cluster_connection(ndbcluster_connectstring)) == 0) + new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0) { - DBUG_PRINT("error",("Ndb_cluster_connection(%s)",ndbcluster_connectstring)); + DBUG_PRINT("error",("Ndb_cluster_connection(%s)", + opt_ndbcluster_connectstring)); goto ndbcluster_init_error; } + g_ndb_cluster_connection->set_optimized_node_selection + (opt_ndb_optimized_node_selection); + // Create a Ndb object to open the connection to NDB g_ndb= new Ndb(g_ndb_cluster_connection, "sys"); g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_table_local_info)); @@ -4256,7 +4261,7 @@ bool ndbcluster_init() DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d", g_ndb_cluster_connection->get_connected_host(), g_ndb_cluster_connection->get_connected_port())); - g_ndb->waitUntilReady(10); + g_ndb_cluster_connection->wait_until_ready(10,0); } else if(res == 1) { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e39c902444e..5cd85113641 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -53,6 +53,11 @@ #endif #ifdef HAVE_NDBCLUSTER_DB #define OPT_NDBCLUSTER_DEFAULT 0 +#ifdef NDB_SHM_TRANSPORTER +#define OPT_NDB_SHM_DEFAULT 1 +#else +#define OPT_NDB_SHM_DEFAULT 0 +#endif #else #define OPT_NDBCLUSTER_DEFAULT 0 #endif @@ -285,6 +290,10 @@ my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_log_slave_updates= 0; my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster; +#ifdef HAVE_NDBCLUSTER_DB +const char *opt_ndbcluster_connectstring= 0; +my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; +#endif my_bool opt_readonly, use_temp_pool, relay_log_purge; my_bool opt_sync_bdb_logs, opt_sync_frm; my_bool opt_secure_auth= 0; @@ -3998,6 +4007,7 @@ enum options_mysqld OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, @@ -4439,24 +4449,46 @@ Disable with --skip-ndbcluster (will save memory).", #ifdef HAVE_NDBCLUSTER_DB {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", - (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, + (gptr*) &opt_ndbcluster_connectstring, + (gptr*) &opt_ndbcluster_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"ndb_autoincrement_prefetch_sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, - "Specify number of autoincrement values that are prefetched", + {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + "Specify number of autoincrement values that are prefetched.", (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, 0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, + {"ndb-force-send", OPT_NDB_FORCE_SEND, + "Force send of buffers to ndb immediately without waiting for " + "other threads.", + (gptr*) &global_system_variables.ndb_force_send, + (gptr*) &global_system_variables.ndb_force_send, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_force_send", OPT_NDB_FORCE_SEND, - "Force send of buffers to ndb immediately without waiting for other threads", + "same as --ndb-force-send.", (gptr*) &global_system_variables.ndb_force_send, (gptr*) &global_system_variables.ndb_force_send, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT, + "Use exact records count during query planning and for fast " + "select count(*), disable for faster queries.", + (gptr*) &global_system_variables.ndb_use_exact_count, + (gptr*) &global_system_variables.ndb_use_exact_count, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, - "Use exact records count during query planning and for " - "fast select count(*)", + "same as --ndb-use-exact-count.", (gptr*) &global_system_variables.ndb_use_exact_count, (gptr*) &global_system_variables.ndb_use_exact_count, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-shm", OPT_NDB_SHM, + "Use shared memory connections when available.", + (gptr*) &opt_ndb_shm, + (gptr*) &opt_ndb_shm, + 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0}, + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION, + "Select nodes for transactions in a more optimal way.", + (gptr*) &opt_ndb_optimized_node_selection, + (gptr*) &opt_ndb_optimized_node_selection, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif {"new", 'n', "Use very new possible 'unsafe' functions.", (gptr*) &global_system_variables.new_mode, -- cgit v1.2.1 From 05862273cb44524a70d3abda686a311ad6b553b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 16:19:22 +0100 Subject: automatically configure with shared memory transporter for ndb if functions are available --- acinclude.m4 | 18 ------------------ configure.in | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 730ee15ed20..4f2ad8daf91 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1599,11 +1599,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac - AC_ARG_WITH([ndb-shm], - [ - --with-ndb-shm Include the NDB Cluster shared memory transporter], - [ndb_shm="$withval"], - [ndb_shm=no]) AC_ARG_WITH([ndb-test], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], @@ -1633,19 +1628,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) - have_ndb_shm=no - case "$ndb_shm" in - yes ) - AC_MSG_RESULT([-- including shared memory transporter]) - AC_DEFINE([NDB_SHM_TRANSPORTER], [1], - [Including Ndb Cluster DB shared memory transporter]) - have_ndb_shm="yes" - ;; - * ) - AC_MSG_RESULT([-- not including shared memory transporter]) - ;; - esac - have_ndb_test=no case "$ndb_test" in yes ) diff --git a/configure.in b/configure.in index 9be817c51da..bc78c9c8764 100644 --- a/configure.in +++ b/configure.in @@ -1923,7 +1923,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ - realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ + realpath rename rint rwlock_init setupterm \ + shmget shmat shmdt shmctl \ + sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) @@ -3078,10 +3080,19 @@ fi AC_SUBST([ndb_port_base]) ndb_transporter_opt_objs="" -if test X"$have_ndb_shm" = Xyes -then - ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" +if test "$ac_cv_func_shmget" = "yes" && + test "$ac_cv_func_shmat" = "yes" && + test "$ac_cv_func_shmdt" = "yes" && + test "$ac_cv_func_shmctl" = "yes" +then + AC_DEFINE([NDB_SHM_TRANSPORTER], [1], + [Including Ndb Cluster DB shared memory transporter]) + AC_MSG_RESULT([Including ndb shared memory transporter]) + ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" +else + AC_MSG_RESULT([Not including ndb shared memory transporter]) fi + if test X"$have_ndb_sci" = Xyes then ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo" -- cgit v1.2.1 From fee2e57b675ba2e07bb9833ffbe18996fbf97ccb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 10:05:58 +0400 Subject: Fix to perform correctly with charsets in embedded server BitKeeper/deleted/.del-ctype_recoding.result.es~45c6fe567949af: Delete: mysql-test/r/ctype_recoding.result.es BitKeeper/deleted/.del-func_test.result.es~4de135264090aa14: Delete: mysql-test/r/func_test.result.es BitKeeper/deleted/.del-ps_2myisam.result.es~5132bde9c07c41e8: Delete: mysql-test/r/ps_2myisam.result.es BitKeeper/deleted/.del-ps_3innodb.result.es~a3613f0e86132472: Delete: mysql-test/r/ps_3innodb.result.es BitKeeper/deleted/.del-ps_4heap.result.es~956ae2c46b66b6ed: Delete: mysql-test/r/ps_4heap.result.es BitKeeper/deleted/.del-ps_5merge.result.es~6093a834fec21efe: Delete: mysql-test/r/ps_5merge.result.es BitKeeper/deleted/.del-ps_6bdb.result.es~57b94c3756e3d093: Delete: mysql-test/r/ps_6bdb.result.es libmysqld/lib_sql.cc: Charset conversion implemented mysql-test/r/query_cache.result.es: correct test result provided tests/client_test.c: now it works --- libmysqld/lib_sql.cc | 78 +- mysql-test/r/ctype_recoding.result.es | 242 -- mysql-test/r/func_test.result.es | 185 - mysql-test/r/ps_2myisam.result.es | 3130 ----------------- mysql-test/r/ps_3innodb.result.es | 3113 ----------------- mysql-test/r/ps_4heap.result.es | 3114 ----------------- mysql-test/r/ps_5merge.result.es | 6064 --------------------------------- mysql-test/r/ps_6bdb.result.es | 3113 ----------------- mysql-test/r/query_cache.result.es | 8 +- tests/client_test.c | 2 - 10 files changed, 56 insertions(+), 18993 deletions(-) delete mode 100644 mysql-test/r/ctype_recoding.result.es delete mode 100644 mysql-test/r/func_test.result.es delete mode 100644 mysql-test/r/ps_2myisam.result.es delete mode 100644 mysql-test/r/ps_3innodb.result.es delete mode 100644 mysql-test/r/ps_4heap.result.es delete mode 100644 mysql-test/r/ps_5merge.result.es delete mode 100644 mysql-test/r/ps_6bdb.result.es diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8092d87b97c..a9503c644a8 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -591,6 +591,32 @@ err: C_MODE_END +static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) +{ + uint32 dummy32; + uint dummy_err; + char *result; + + /* 'tocs' is set 0 when client issues SET character_set_results=NULL */ + if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32)) + { + uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; + result= (char *)alloc_root(root, new_len); + length= copy_and_convert(result, new_len, + tocs, from, length, fromcs, &dummy_err); + } + else + { + result= (char *)alloc_root(root, length + 1); + memcpy(result, from, length); + } + + result[length]= 0; + return result; +} + + bool Protocol::send_fields(List *list, uint flag) { List_iterator_fast it(*list); @@ -598,6 +624,8 @@ bool Protocol::send_fields(List *list, uint flag) MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; MEM_ROOT *field_alloc; + CHARSET_INFO *thd_cs= thd->variables.character_set_results; + CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("send_fields"); @@ -616,12 +644,29 @@ bool Protocol::send_fields(List *list, uint flag) Send_field server_field; item->make_field(&server_field); - client_field->db= strdup_root(field_alloc, server_field.db_name); - client_field->table= strdup_root(field_alloc, server_field.table_name); - client_field->name= strdup_root(field_alloc, server_field.col_name); - client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); - client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); - client_field->length= server_field.length; + client_field->db= dup_str_aux(field_alloc, server_field.db_name, + strlen(server_field.db_name), cs, thd_cs); + client_field->table= dup_str_aux(field_alloc, server_field.table_name, + strlen(server_field.table_name), cs, thd_cs); + client_field->name= dup_str_aux(field_alloc, server_field.col_name, + strlen(server_field.col_name), cs, thd_cs); + client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, + strlen(server_field.org_table_name), cs, thd_cs); + client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, + strlen(server_field.org_col_name), cs, thd_cs); + if (item->collation.collation == &my_charset_bin || thd_cs == NULL) + { + /* No conversion */ + client_field->charsetnr= server_field.charsetnr; + client_field->length= server_field.length; + } + else + { + /* With conversion */ + client_field->charsetnr= thd_cs->number; + uint char_len= server_field.length / item->collation.collation->mbmaxlen; + client_field->length= char_len * thd_cs->mbmaxlen; + } client_field->type= server_field.type; client_field->flags= server_field.flags; client_field->decimals= server_field.decimals; @@ -630,9 +675,8 @@ bool Protocol::send_fields(List *list, uint flag) client_field->name_length= strlen(client_field->name); client_field->org_name_length= strlen(client_field->org_name); client_field->org_table_length= strlen(client_field->org_table); - client_field->charsetnr= server_field.charsetnr; - client_field->catalog= strdup_root(field_alloc, "def"); + client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs); client_field->catalog_length= 3; if (INTERNAL_NUM_FIELD(client_field)) @@ -804,21 +848,3 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } -#if 0 -/* The same as Protocol::net_store_data but does the converstion -*/ -bool Protocol::convert_str(const char *from, uint length) -{ - if (!(*next_field=alloc_root(alloc, length + 1))) - return true; - convert->store_dest(*next_field, from, length); - (*next_field)[length]= 0; - if (next_mysql_field->max_length < length) - next_mysql_field->max_length=length; - ++next_field; - ++next_mysql_field; - - return false; -} -#endif - diff --git a/mysql-test/r/ctype_recoding.result.es b/mysql-test/r/ctype_recoding.result.es deleted file mode 100644 index 27425a69872..00000000000 --- a/mysql-test/r/ctype_recoding.result.es +++ /dev/null @@ -1,242 +0,0 @@ -SET CHARACTER SET koi8r; -DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2; -SET CHARACTER SET koi8r; -CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; -CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` char(10) character set cp1251 default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SELECT a FROM t1; -a -ÐÒÏÂÁ -SELECT HEX(a) FROM t1; -HEX(a) -EFF0EEE1E0 -INSERT t2 SELECT * FROM t1; -SELECT HEX(a) FROM t2; -HEX(a) -D0BFD180D0BED0B1D0B0 -DROP TABLE t1, t2; -CREATE TABLE t1 (description text character set cp1250 NOT NULL); -INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde'); -SELECT description FROM t1; -description -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde -DROP TABLE t1; -CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; -CREATE TABLE t2 (a TEXT CHARACTER SET utf8); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` text character set cp1251 -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SELECT HEX(a) FROM t1; -HEX(a) -EFF0EEE1E0 -INSERT t2 SELECT * FROM t1; -SELECT HEX(a) FROM t2; -HEX(a) -D0BFD180D0BED0B1D0B0 -DROP TABLE t1, t2; -CREATE TABLE `ÔÁÂÌÉÃÁ` -( -ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" -) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; -SHOW TABLES; -Tables_in_test -ÔÁÂÌÉÃÁ -SHOW CREATE TABLE ÔÁÂÌÉÃÁ; -Table Create Table -ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` ( - `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ' -SHOW FIELDS FROM ÔÁÂÌÉÃÁ; -Field Type Null Key Default Extra -ÐÏÌÅ char(32) -SET CHARACTER SET cp1251; -SHOW TABLES; -Tables_in_test -òàáëèöà -SHOW CREATE TABLE òàáëèöà; -Table Create Table -òàáëèöà CREATE TABLE `òàáëèöà` ( - `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû' -SHOW FIELDS FROM òàáëèöà; -Field Type Null Key Default Extra -ïîëå char(32) -SET CHARACTER SET utf8; -SHOW TABLES; -Tables_in_test -таблица -SHOW CREATE TABLE таблица; -Table Create Table -таблица CREATE TABLE `таблица` ( - `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы' -SHOW FIELDS FROM таблица; -Field Type Null Key Default Extra -поле char(32) -SET CHARACTER SET koi8r; -DROP TABLE ÔÁÂÌÉÃÁ; -SET CHARACTER SET default; -SET NAMES UTF8; -CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; -INSERT INTO t1 (t) VALUES ('x'); -SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; -1 -1 -DROP TABLE t1; -SET CHARACTER SET koi8r; -CREATE DATABASE ÔÅÓÔ; -USE ÔÅÓÔ; -SHOW TABLES; -Tables_in_теÑÑ‚ -SHOW TABLES IN ÔÅÓÔ; -Tables_in_теÑÑ‚ -SET CHARACTER SET cp1251; -SHOW TABLES; -Tables_in_теÑÑ‚ -SHOW TABLES IN òåñò; -Tables_in_теÑÑ‚ -SET CHARACTER SET koi8r; -DROP DATABASE ÔÅÓÔ; -SET NAMES koi8r; -SELECT hex('ÔÅÓÔ'); -hex('теÑÑ‚') -D4C5D3D4 -SET character_set_connection=cp1251; -SELECT hex('ÔÅÓÔ'); -hex('теÑÑ‚') -F2E5F1F2 -USE test; -SET NAMES binary; -CREATE TABLE `теÑÑ‚` (`теÑÑ‚` int); -SHOW CREATE TABLE `теÑÑ‚`; -Table Create Table -теÑÑ‚ CREATE TABLE `теÑÑ‚` ( - `теÑÑ‚` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SET NAMES utf8; -SHOW CREATE TABLE `теÑÑ‚`; -Table Create Table -теÑÑ‚ CREATE TABLE `теÑÑ‚` ( - `теÑÑ‚` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE `теÑÑ‚`; -SET NAMES binary; -SET character_set_connection=utf8; -SELECT 'теÑÑ‚' as s; -s -теÑÑ‚ -SET NAMES utf8; -SET character_set_connection=binary; -SELECT 'теÑÑ‚' as s; -s -теÑÑ‚ -SET NAMES latin1; -CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2'); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `ä` char(128) default 'ä', - `ä1` enum('ä1','ä2') default 'ä2' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW COLUMNS FROM t1; -Field Type Null Key Default Extra -ä char(128) YES ä -ä1 enum('ä1','ä2') YES ä2 -SET NAMES binary; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `ä` char(128) default 'ä', - `ä1` enum('ä1','ä2') default 'ä2' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW COLUMNS FROM t1; -Field Type Null Key Default Extra -ä char(128) YES ä -ä1 enum('ä1','ä2') YES ä2 -DROP TABLE t1; -SET NAMES binary; -CREATE TABLE `goodÐÌÏÈÏ` (a int); -ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ' -SET NAMES utf8; -CREATE TABLE `goodÐÌÏÈÏ` (a int); -ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' -set names latin1; -create table t1 (a char(10) character set koi8r, b text character set koi8r); -insert into t1 values ('test','test'); -insert into t1 values ('ÊÃÕË','ÊÃÕË'); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 -Warning 1265 Data truncated for column 'b' at row 1 -drop table t1; -set names koi8r; -create table t1 (a char(10) character set cp1251); -insert into t1 values (_koi8r'×ÁÓÑ'); -select * from t1 where a=_koi8r'×ÁÓÑ'; -a -×ÁÓÑ -select * from t1 where a=concat(_koi8r'×ÁÓÑ'); -ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' -select * from t1 where a=_latin1'×ÁÓÑ'; -ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' -drop table t1; -set names latin1; -set names koi8r; -create table t1 (c1 char(10) character set cp1251); -insert into t1 values ('ß'); -select c1 from t1 where c1 between 'ß' and 'ß'; -c1 -ß -select ifnull(c1,'ß'), ifnull(null,c1) from t1; -ifnull(c1,'ÑŠ') ifnull(null,c1) -ß ß -select if(1,c1,'ö'), if(0,c1,'ö') from t1; -if(1,c1,'Ж') if(0,c1,'Ж') -ß ö -select coalesce('ö',c1), coalesce(null,c1) from t1; -coalesce('Ж',c1) coalesce(null,c1) -ö ß -select least(c1,'ö'), greatest(c1,'ö') from t1; -least(c1,'Ж') greatest(c1,'Ж') -ö ß -select locate(c1,'ß'), locate('ß',c1) from t1; -locate(c1,'ÑŠ') locate('ÑŠ',c1) -1 1 -select field(c1,'ß'),field('ß',c1) from t1; -field(c1,'ÑŠ') field('ÑŠ',c1) -1 1 -select concat(c1,'ö'), concat('ö',c1) from t1; -concat(c1,'Ж') concat('Ж',c1) -ßö öß -select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; -concat_ws(c1,'Ж','ÑŠ') concat_ws('Ж',c1,'ÑŠ') -ößß ßöß -select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; -replace(c1,'ÑŠ','Ж') replace('ÑŠ',c1,'Ж') -ö ö -select substring_index(c1,'öößß',2) from t1; -substring_index(c1,'ЖЖъъ',2) -ß -select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; -elt(1,c1,'Ж') elt(1,'Ж',c1) -ß ö -select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; -make_set(3,c1,'Ж') make_set(3,'Ж',c1) -ß,ö ö,ß -select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; -insert(c1,1,2,'Ж') insert('Ж',1,2,c1) -ö ß -select trim(c1 from 'ß'),trim('ß' from c1) from t1; -trim(c1 from 'ÑŠ') trim('ÑŠ' from c1) - -select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; -lpad(c1,3,'Ж') lpad('Ж',3,c1) -ööß ßßö -select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; -rpad(c1,3,'Ж') rpad('Ж',3,c1) -ßöö ößß diff --git a/mysql-test/r/func_test.result.es b/mysql-test/r/func_test.result.es deleted file mode 100644 index 380f96835d0..00000000000 --- a/mysql-test/r/func_test.result.es +++ /dev/null @@ -1,185 +0,0 @@ -drop table if exists t1,t2; -select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ; -0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a") -1 1 1 0 0 1 -1 1 0 -select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"; -"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" -1 1 1 1 1 1 -select "a "="A", "A "="a", "a " <= "A b"; -"a "="A" "A "="a" "a " <= "A b" -1 1 1 -select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%"; -"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%" -1 1 1 1 1 1 1 1 -select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d"; -"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d" -0 0 0 0 0 0 0 -select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%'; -'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%' -0 0 0 1 1 -select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab"; -'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab" -1 1 0 0 1 -select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; -"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$" -1 1 -select "aba" regexp concat("^","a"); -"aba" regexp concat("^","a") -1 -select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; -!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0 -1 1 0 1 0 1 1 1 -select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; -2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3 -1 1 1 -select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; -'b' between 'a' and 'c' 'B' between 'a' and 'c' -1 1 -select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); -2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0) -1 1 1 -select -1.49 or -1.49,0.6 or 0.6; --1.49 or -1.49 0.6 or 0.6 -1 1 -select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; -3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1 -8 0 1 NULL NULL -explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` -select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; -1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL -0 1 1 0 NULL NULL NULL -select 1 like 2 xor 2 like 1; -1 like 2 xor 2 like 1 -0 -select 10 % 7, 10 mod 7, 10 div 3; -10 % 7 10 mod 7 10 div 3 -3 3 3 -explain extended select 10 % 7, 10 mod 7, 10 div 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` -select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; -(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 -18446744073709551615 18446744073709551615 9223372036854775807 -explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` -create table t1 (a int); -insert t1 values (1); -select * from t1 where 1 xor 1; -a -explain extended select * from t1 where 1 xor 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) -select - a from t1; -- a --1 -explain extended select - a from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 -Warnings: -Note 1003 select -(test.t1.a) AS `- a` from test.t1 -drop table t1; -select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; -5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 -0 1 -select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; -1 and 2 between 2 and 10 2 between 2 and 10 and 1 -1 1 -select 1 and 0 or 2, 2 or 1 and 0; -1 and 0 or 2 2 or 1 and 0 -1 1 -select _koi8r'a' = _koi8r'A'; -_koi8r'a' = _koi8r'A' -1 -select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; -_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci -1 -explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` -select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; -_koi8r'a' = _koi8r'A' COLLATE koi8r_bin -0 -select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; -_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A' -1 -select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; -_koi8r'a' COLLATE koi8r_bin = _koi8r'A' -0 -select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci; -ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '=' -select _koi8r'a' = _latin1'A'; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' -select strcmp(_koi8r'a', _koi8r'A'); -strcmp(_koi8r'a', _koi8r'A') -0 -select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci); -strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci) -0 -select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin); -strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin) -1 -select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A'); -strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A') -0 -select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A'); -strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A') -1 -select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin); -ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp' -select strcmp(_koi8r'a', _latin1'A'); -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp' -select _koi8r'a' LIKE _koi8r'A'; -_koi8r'a' LIKE _koi8r'A' -1 -select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci; -_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci -1 -select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin; -_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin -0 -select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'; -_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' -1 -select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; -_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A' -0 -select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like' -select _koi8r'a' LIKE _latin1'A'; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like' -CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','\r\n\r\n \r\n \r\n \r\n \r\n
 \r\n

How \r\n To: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected.

\r\n
','\r\n \r\n \r\n \r\n \r\n\r\n \r\n
  \r\n \r\n

1. Select \r\n the On/Setup button to access the DynaVox Setup Menu.
\r\n 2. Select Button Features.
\r\n 3. Below the OK button is the Usage Counts button.
\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.
\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.
\r\n c. Select the Usage Counts Option Ring once and it will toggle \r\n to the alternative option.
\r\n 4. Once the correct setting has been chosen, select OK to leave the Button \r\n Features menu.
\r\n 5. Select OK out of the Setup menu and return to the communication \r\n page.

\r\n

For \r\n further information on Usage Counts, see the Button Features \r\n Menu Entry in the DynaVox/DynaMyte Reference Manual.

\r\n
',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); -CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); -SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; -rank rank rank -2 2 NULL -DROP TABLE t1,t2; -CREATE TABLE t1 (d varchar(6), k int); -INSERT INTO t1 VALUES (NULL, 2); -SELECT GREATEST(d,d) FROM t1 WHERE k=2; -GREATEST(d,d) -NULL -DROP TABLE t1; -select 1197.90 mod 50; -1197.90 mod 50 -47.90 -select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; -5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 -2.1 2.1 -2.1 -2.1 -select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; -5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 -2 2 -2 -2 diff --git a/mysql-test/r/ps_2myisam.result.es b/mysql-test/r/ps_2myisam.result.es deleted file mode 100644 index 3f17b4cdcd0..00000000000 --- a/mysql-test/r/ps_2myisam.result.es +++ /dev/null @@ -1,3130 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -drop table if exists t2 ; -create table t2 (s varchar(25), fulltext(s)) -ENGINE = 'MYISAM' ; -insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ; -commit ; -prepare stmt1 from ' select s from t2 where match (s) against (?) ' ; -set @arg00='Dogs' ; -execute stmt1 using @arg00 ; -s -Hollow Dogs -prepare stmt1 from ' SELECT s FROM t2 -where match (s) against (concat(?,''digger'')) '; -set @arg00='Grave' ; -execute stmt1 using @arg00 ; -s -Gravedigger -drop table t2 ; -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_3innodb.result.es b/mysql-test/r/ps_3innodb.result.es deleted file mode 100644 index 9386f18a4df..00000000000 --- a/mysql-test/r/ps_3innodb.result.es +++ /dev/null @@ -1,3113 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'InnoDB' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'InnoDB' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'InnoDB' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'InnoDB' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_4heap.result.es b/mysql-test/r/ps_4heap.result.es deleted file mode 100644 index fcd9c52b4f9..00000000000 --- a/mysql-test/r/ps_4heap.result.es +++ /dev/null @@ -1,3114 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'HEAP' ; -drop table if exists t9; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), -c25 char(100), c26 char(100), c27 char(100), c28 char(100), -c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'HEAP' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 253 100 8 Y 0 0 8 -def test t9 t9 c24 c24 253 100 8 Y 0 0 8 -def test t9 t9 c25 c25 253 100 4 Y 0 0 8 -def test t9 t9 c26 c26 253 100 4 Y 0 0 8 -def test t9 t9 c27 c27 253 100 10 Y 0 0 8 -def test t9 t9 c28 c28 253 100 10 Y 0 0 8 -def test t9 t9 c29 c29 253 100 8 Y 0 0 8 -def test t9 t9 c30 c30 253 100 8 Y 0 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'HEAP' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'HEAP' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50 50 50 50 50 50 50 50 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52 52 52 52 52 52 52 52 -53 5 53 53 53 53 53 53 53 53 53 53 -54 5 54 54 54 54 54 54 54 54 54 54 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56 56 56 56 56 56 56 56 -57 6 57 57 57 57 57 57 57 57 57 57 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_5merge.result.es b/mysql-test/r/ps_5merge.result.es deleted file mode 100644 index 4f05be1b4d9..00000000000 --- a/mysql-test/r/ps_5merge.result.es +++ /dev/null @@ -1,6064 +0,0 @@ -use test; -drop table if exists t1, t1_1, t1_2, -t9, t9_1, t9_2; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -rename table t1 to t1_1, t9 to t9_1 ; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -rename table t1 to t1_2, t9 to t9_2 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) ENGINE = MERGE UNION=(t1_1,t1_2) -INSERT_METHOD=FIRST; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) ENGINE = MERGE UNION=(t9_1,t9_2) -INSERT_METHOD=FIRST; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) ENGINE = MERGE UNION=(t1_1,t1_2) -INSERT_METHOD=LAST; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) ENGINE = MERGE UNION=(t9_1,t9_2) -INSERT_METHOD=LAST; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t1_1, t1_2, -t9_1, t9_2, t9; diff --git a/mysql-test/r/ps_6bdb.result.es b/mysql-test/r/ps_6bdb.result.es deleted file mode 100644 index 7b7f7e23bbf..00000000000 --- a/mysql-test/r/ps_6bdb.result.es +++ /dev/null @@ -1,3113 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'BDB' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'BDB' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -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 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -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 = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 3 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'BDB' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'BDB' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es index 1e16354d87d..7e75a3cee4c 100644 --- a/mysql-test/r/query_cache.result.es +++ b/mysql-test/r/query_cache.result.es @@ -808,7 +808,7 @@ SET NAMES koi8r; CREATE TABLE t1 (a char(1) character set koi8r); INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  1 Á  1 show status like "Qcache_hits"; @@ -819,7 +819,7 @@ Variable_name Value Qcache_queries_in_cache 1 set collation_connection=koi8r_bin; SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  0 Á  0 show status like "Qcache_hits"; @@ -830,7 +830,7 @@ Variable_name Value Qcache_queries_in_cache 2 set character_set_client=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a ÷ '×'='÷' á ÷ 0 Á ÷ 0 show status like "Qcache_hits"; @@ -841,7 +841,7 @@ Variable_name Value Qcache_queries_in_cache 3 set character_set_results=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a  'â'='Â' À  0 à  0 show status like "Qcache_hits"; diff --git a/tests/client_test.c b/tests/client_test.c index 0575b355b05..dc18929341c 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -683,9 +683,7 @@ static void verify_prepare_field(MYSQL_RES *result, as utf8. Field length is calculated as number of characters * maximum number of bytes a character can occupy. */ -#ifndef EMBEDDED_LIBRARY DIE_UNLESS(field->length == length * cs->mbmaxlen); -#endif if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } -- cgit v1.2.1 From 2e8d13c73ec986dde580c9c840f421af4279611a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 00:44:00 +0200 Subject: After merge fixes config/ac-macros/character_sets.m4: Added latin1_spanish_ci dbug/dbug_analyze.c: Remove compiler warnings include/my_handler.h: Reorder structure arguments to be more optimal innobase/dict/dict0load.c: Fixed wrong define tag (for MySQL 5.0) innobase/fil/fil0fil.c: Fixed compiler warning innobase/os/os0file.c: Fixed compiler warning myisam/ft_boolean_search.c: Fixed compiler warning myisam/ft_static.c: Update to use new HA_KEYSEG structure myisam/mi_open.c: Simple optimization myisammrg/myrg_static.c: Removed compiler warning mysql-test/r/grant.result: Update results after merge mysql-test/r/index_merge.result: Update results after merge mysql-test/r/information_schema_inno.result: Add missing drop table mysql-test/r/lowercase_table.result: safety fix mysql-test/r/multi_update.result: safety fix mysql-test/r/ps_1general.result: safety fix mysql-test/r/ps_2myisam.result: Update results after merge (set is not anymore of binary type) mysql-test/r/ps_3innodb.result: Update results after merge mysql-test/r/ps_4heap.result: Update results after merge mysql-test/r/ps_5merge.result: Update results after merge mysql-test/r/ps_6bdb.result: Update results after merge mysql-test/r/show_check.result: Update results after merge mysql-test/r/subselect.result: Update results after merge (added missing quotes) mysql-test/r/timezone2.result: Update results after merge mysql-test/r/view.result: Update results after merge (note that INSERT IGNORE will work again after next merge from 4.1) mysql-test/t/derived.test: Removed empty line mysql-test/t/grant.test: Update results after merge mysql-test/t/information_schema_inno.test: added missing drop table mysql-test/t/lowercase_table.test: safety fix mysql-test/t/multi_update.test: safety fix mysql-test/t/ps_1general.test: safety fix mysql-test/t/view.test: update error codes after merge ndb/src/mgmsrv/main.cpp: after merge fix ndb/tools/ndb_test_platform.cpp: removed compiler warnings regex/main.c: remove compiler warnings sql/field.cc: Remove compiler warning sql/gen_lex_hash.cc: Added DBUG support sql/ha_myisam.cc: Removed warning from valgrind sql/ha_ndbcluster.cc: Remove compiler warning sql/item_cmpfunc.cc: Better to use val_int() instead of val_real() as we don't want Item_func_nop_all to return different value than the original ref element sql/mysqld.cc: Remove compiler warning sql/sql_acl.cc: More debugging sql/sql_lex.cc: Remove unnecessary 'else' sql/sql_parse.cc: After merge fixes Simplify reset of thd->server_status for SQLCOM_CALL sql/sql_prepare.cc: After merge fixes Removed possible core dump in mysql_stmt_fetch() sql/sql_update.cc: After merge fixes (together with Sanja) strings/ctype-czech.c: Remove compiler warning strings/ctype-ucs2.c: Remove compiler warning strings/ctype-win1250ch.c: Remove compiler warning strings/xml.c: Remove compiler warning tests/client_test.c: Fix test to work with 5.0 vio/test-sslserver.c: Portability fix --- config/ac-macros/character_sets.m4 | 2 +- dbug/dbug_analyze.c | 22 +++++----- include/my_handler.h | 14 +++--- innobase/dict/dict0load.c | 3 +- innobase/fil/fil0fil.c | 6 +-- innobase/os/os0file.c | 2 +- myisam/ft_boolean_search.c | 1 + myisam/ft_static.c | 36 ++++++++-------- myisam/mi_open.c | 14 +++--- myisammrg/myrg_static.c | 2 +- mysql-test/r/grant.result | 10 +++-- mysql-test/r/index_merge.result | 2 +- mysql-test/r/information_schema_inno.result | 1 + mysql-test/r/lowercase_table.result | 1 + mysql-test/r/multi_update.result | 1 + mysql-test/r/ps_1general.result | 3 ++ mysql-test/r/ps_2myisam.result | 8 ++-- mysql-test/r/ps_3innodb.result | 8 ++-- mysql-test/r/ps_4heap.result | 8 ++-- mysql-test/r/ps_5merge.result | 16 +++---- mysql-test/r/ps_6bdb.result | 8 ++-- mysql-test/r/show_check.result | 12 +++--- mysql-test/r/subselect.result | 15 ++++--- mysql-test/r/timezone2.result | 4 +- mysql-test/r/view.result | 5 +-- mysql-test/t/derived.test | 1 - mysql-test/t/grant.test | 6 ++- mysql-test/t/information_schema_inno.test | 3 ++ mysql-test/t/lowercase_table.test | 1 + mysql-test/t/multi_update.test | 1 + mysql-test/t/ps_1general.test | 4 ++ mysql-test/t/view.test | 3 +- ndb/src/mgmsrv/main.cpp | 1 - ndb/tools/ndb_test_platform.cpp | 6 +-- regex/main.c | 2 +- sql/field.cc | 7 +-- sql/gen_lex_hash.cc | 24 ++++++++--- sql/ha_myisam.cc | 5 ++- sql/ha_ndbcluster.cc | 1 + sql/item.cc | 2 +- sql/item.h | 4 +- sql/item_cmpfunc.cc | 2 +- sql/mysql_priv.h | 3 +- sql/mysqld.cc | 2 +- sql/sp.cc | 1 - sql/sp_head.cc | 1 - sql/sql_acl.cc | 16 ++++--- sql/sql_base.cc | 14 ++---- sql/sql_class.h | 2 +- sql/sql_insert.cc | 43 +++++++++++-------- sql/sql_lex.cc | 11 +++-- sql/sql_parse.cc | 40 +++++++++-------- sql/sql_prepare.cc | 20 +++++---- sql/sql_trigger.cc | 2 - sql/sql_update.cc | 66 +++++++++++++---------------- sql/sql_view.cc | 1 - sql/sql_yacc.yy | 4 +- sql/table.cc | 1 - strings/ctype-czech.c | 3 +- strings/ctype-ucs2.c | 3 +- strings/ctype-win1250ch.c | 3 +- strings/xml.c | 2 +- tests/client_test.c | 22 +++++++--- vio/test-sslserver.c | 7 +-- 64 files changed, 295 insertions(+), 249 deletions(-) diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4 index 77081639897..8f1d2f23715 100644 --- a/config/ac-macros/character_sets.m4 +++ b/config/ac-macros/character_sets.m4 @@ -287,7 +287,7 @@ case $default_charset in ;; latin1) default_charset_default_collation="latin1_swedish_ci" - default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci" + default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci" ;; latin2) default_charset_default_collation="latin2_general_ci" diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c index 0841e8e0b70..1db056d549c 100644 --- a/dbug/dbug_analyze.c +++ b/dbug/dbug_analyze.c @@ -51,6 +51,7 @@ #include #include +#include static char *my_name; static int verbose; @@ -246,7 +247,7 @@ char *m_name; modules[n_items].m_stkuse = 0; DBUG_RETURN (n_items++); } - while (cmp = strcmp (m_name,modules[ind].name)) { + while ((cmp = strcmp (m_name,modules[ind].name))) { if (cmp < 0) { /* In left subtree */ if (s_table[ind].lchild == MAXPROCS) { /* Add as left child */ @@ -392,7 +393,7 @@ FILE *inf; } break; default: - fprintf (stderr, "unknown record type '%s'\n", buf[0]); + fprintf (stderr, "unknown record type '%c'\n", buf[0]); break; } next_line:; @@ -450,10 +451,11 @@ FILE *outf; unsigned long int sum_calls, sum_time; { DBUG_ENTER ("out_trailer"); - if (verbose) { - fprintf (outf, "======\t==========\t===========\t==========\t========\n"); - fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f\t\t%-15s\n", - sum_calls, 100.0, sum_time, 100.0, "Totals"); + if (verbose) + { + fprintf(outf, "======\t==========\t===========\t==========\t========\n"); + fprintf(outf, "%6ld\t%10.2f\t%11ld\t%10.2f\t\t%-15s\n", + sum_calls, 100.0, sum_time, 100.0, "Totals"); } DBUG_VOID_RETURN; } @@ -488,16 +490,16 @@ unsigned long int *called, *timed; import = (unsigned int) (per_time * per_calls); if (verbose) { - fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f %10d\t%-15s\n", + fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n", calls, per_calls, time, per_time, import, name); } else { ms_per_call = time; ms_per_call /= calls; ftime = time; ftime /= 1000; - fprintf (outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8u %-s\n", - per_time, ftime, calls, ms_per_call, per_calls, import, - stkuse, name); + fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n", + per_time, ftime, calls, ms_per_call, per_calls, import, + stkuse, name); } *called = calls; *timed = time; diff --git a/include/my_handler.h b/include/my_handler.h index 9ddc0c61eee..cad15d5471f 100644 --- a/include/my_handler.h +++ b/include/my_handler.h @@ -25,17 +25,17 @@ typedef struct st_HA_KEYSEG /* Key-portion */ { + CHARSET_INFO *charset; + uint32 start; /* Start of key in record */ + uint32 null_pos; /* position to NULL indicator */ + uint16 bit_pos; /* Position to bit part */ + uint16 flag; + uint16 length; /* Keylength */ uint8 type; /* Type of key (for sort) */ uint8 language; uint8 null_bit; /* bitmask to test for NULL */ uint8 bit_start,bit_end; /* if bit field */ - uint16 flag; - uint16 length; /* Keylength */ - uint32 start; /* Start of key in record */ - uint32 null_pos; /* position to NULL indicator */ - CHARSET_INFO *charset; - uint8 bit_length; /* Length of bit part */ - uint16 bit_pos; /* Position to bit part */ + uint8 bit_length; /* Length of bit part */ } HA_KEYSEG; #define get_key_length(length,key) \ diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 143abe05cd7..12ceba38815 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -8,6 +8,7 @@ Created 4/24/1996 Heikki Tuuri *******************************************************/ #include "dict0load.h" +#include "mysql_version.h" #ifdef UNIV_NONINL #include "dict0load.ic" @@ -766,7 +767,7 @@ dict_load_table( return(NULL); } -#if MYSQL_VERSION_ID < 50300 +#if MYSQL_VERSION_ID < 50003 /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the "compact format" flag. */ field = rec_get_nth_field(rec, 7, &len); diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index dea48117e00..f62f63da538 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -614,9 +614,9 @@ fil_try_to_close_file_in_LRU( fputs("InnoDB: cannot close file ", stderr); ut_print_filename(stderr, node->name); fprintf(stderr, - ", because mod_count %lld != fl_count %lld\n", - node->modification_counter, - node->flush_counter); + ", because mod_count %ld != fl_count %ld\n", + (long) node->modification_counter, + (long) node->flush_counter); } node = UT_LIST_GET_PREV(LRU, node); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 006e6b431e8..434f9460bb6 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1681,7 +1681,7 @@ os_file_set_size( } /* Print about progress for each 100 MB written */ - if ((offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024) + if ((ib_longlong) (offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024) != offset / (ib_longlong)(100 * 1024 * 1024)) { fprintf(stderr, " %lu00", diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index ffc7e1bf104..c38bffed665 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -211,6 +211,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength; byte *lastkey_buf=ftbw->word+ftbw->off; + LINT_INIT(off); if (ftbw->flags & FTB_FLAG_TRUNC) lastkey_buf+=ftbw->len; diff --git a/myisam/ft_static.c b/myisam/ft_static.c index cdb1580e706..5241a492f58 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -25,23 +25,25 @@ char ft_boolean_syntax[]="+ -><()~*:\"\"&|"; const HA_KEYSEG ft_keysegs[FT_SEGS]={ { - HA_KEYTYPE_VARTEXT2, /* type */ - 63, /* language (will be overwritten) */ - 0, 2, 0, /* null_bit, bit_start, bit_end */ - HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */ - HA_FT_MAXBYTELEN, /* length */ - HA_FT_WLEN, /* start */ - 0, /* null_pos */ - NULL /* charset */ - }, - { -/* - Note, this (and the last HA_KEYTYPE_END) segment should NOT - be packed in any way, otherwise w_search() won't be able to - update key entry 'in vivo' -*/ - HA_FT_WTYPE, 63, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 0, 0, NULL - } + NullS, /* charset */ + HA_FT_WLEN, /* start */ + 0, /* null_pos */ + 0, /* Bit pos */ + HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */ + HA_FT_MAXBYTELEN, /* length */ + HA_KEYTYPE_VARTEXT2, /* type */ + 63, /* language (will be overwritten) */ + 0, /* null_bit */ + 2, 0, 0 /* bit_start, bit_end, bit_length */ +}, +{ + /* + Note, this (and the last HA_KEYTYPE_END) segment should NOT + be packed in any way, otherwise w_search() won't be able to + update key entry 'in vivo' + */ + NullS, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0 +} }; const struct _ft_vft _ft_vft_nlq = { diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 58db2e47c1f..5990a5f51d3 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -1047,17 +1047,19 @@ int mi_keyseg_write(File file, const HA_KEYSEG *keyseg) { uchar buff[HA_KEYSEG_SIZE]; uchar *ptr=buff; + ulong pos; - *ptr++ =keyseg->type; - *ptr++ =keyseg->language; - *ptr++ =keyseg->null_bit; - *ptr++ =keyseg->bit_start; - *ptr++ =keyseg->bit_end; + *ptr++= keyseg->type; + *ptr++= keyseg->language; + *ptr++= keyseg->null_bit; + *ptr++= keyseg->bit_start; + *ptr++= keyseg->bit_end; *ptr++= keyseg->bit_length; mi_int2store(ptr,keyseg->flag); ptr+=2; mi_int2store(ptr,keyseg->length); ptr+=2; mi_int4store(ptr,keyseg->start); ptr+=4; - mi_int4store(ptr, keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos); + pos= keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos; + mi_int4store(ptr, pos); ptr+=4; return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP)); diff --git a/myisammrg/myrg_static.c b/myisammrg/myrg_static.c index b21b834ac24..9e76cbae07b 100644 --- a/myisammrg/myrg_static.c +++ b/myisammrg/myrg_static.c @@ -27,4 +27,4 @@ LIST *myrg_open_list=0; static const char *merge_insert_methods[] = { "FIRST", "LAST", NullS }; TYPELIB merge_insert_method= { array_elements(merge_insert_methods)-1,"", - merge_insert_methods}; + merge_insert_methods, 0}; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index dbc29a92123..82411595545 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -358,15 +358,17 @@ show grants for mysqltest_3@localhost; Grants for mysqltest_3@localhost GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' GRANT SELECT (b) ON `mysqltest_1`.`t2` TO 'mysqltest_3'@'localhost' -GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' +GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1' -update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2' +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't1' update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; -ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' +ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't1' update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; @@ -387,7 +389,7 @@ flush privileges; use mysqltest_1; update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; -ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'a' in table 't1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' use mysqltest_2; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result index 4ccec5ef0d8..07e87832c0b 100644 --- a/mysql-test/r/index_merge.result +++ b/mysql-test/r/index_merge.result @@ -342,7 +342,7 @@ set @save_join_buffer_size=@@join_buffer_size; set join_buffer_size= 4000; show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 8228 +join_buffer_size 8200 explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) from t0 as A force index(i1,i2), t0 as B force index (i1,i2) where (A.key1 < 500000 or A.key2 < 3) diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index 4784c5e6106..a38139ba753 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE, diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result index a30ec0f160c..c0df8d968cb 100644 --- a/mysql-test/r/lowercase_table.result +++ b/mysql-test/r/lowercase_table.result @@ -1,6 +1,7 @@ drop table if exists t1,t2,t3,t4; drop table if exists t0,t5,t6,t7,t8,t9; drop database if exists mysqltest; +drop view if exists v0, v1, v2, v3, v4; create table T1 (id int primary key, Word varchar(40) not null, Index(Word)); create table t4 (id int primary key, Word varchar(40) not null); INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c'); diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index c5d1fc09082..d10a4bf65f5 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -1,5 +1,6 @@ drop table if exists t1,t2,t3; drop database if exists mysqltest; +drop view if exists v1; revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index d963fd04109..2507d545feb 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,5 +1,8 @@ drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; +drop database if exists testtets; +drop table if exists t1Aa,t2Aa,v1Aa,v2Aa; +drop view if exists t1Aa,t2Aa,v1Aa,v2Aa; test_sequence ------ basic tests ------ drop table if exists t1, t9 ; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 87cd0f3cd60..1fbdd737eba 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1943,7 +1943,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2040,7 +2040,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2128,7 +2128,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2218,7 +2218,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index c28a5ecd09a..e18f7745091 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1926,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2023,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2111,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2201,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 385ae38a506..690bee55848 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1927,7 +1927,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2024,7 +2024,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2112,7 +2112,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2202,7 +2202,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 0 31 8 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 8c90cdc588a..5c71d1fc53c 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1863,7 +1863,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1960,7 +1960,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2048,7 +2048,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2138,7 +2138,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -4872,7 +4872,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -4969,7 +4969,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5057,7 +5057,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5147,7 +5147,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 2b7170c4a85..b6fb52c1120 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1926,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2023,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2111,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2201,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8 def @arg29 253 8192 8 Y 128 31 63 def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 -def @arg32 253 8192 6 Y 128 31 63 +def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index ec9bd33d301..6b46b2dd6d0 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -338,9 +338,9 @@ delete from t2 where b=3; delete from t3 where a=3; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 4 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 # # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from t3; @@ -362,9 +362,9 @@ delete from t2 where b=5; delete from t3 where a=5; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 0 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 # # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database mysqltest; show create database mysqltest; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 701bcf490eb..e8929b2afdd 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1495,6 +1495,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select max(`test`.`t2`.`b`) from `test`.`t2`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1502,7 +1503,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select min(test.t2.b) from test.t2))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1513,7 +1514,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1521,7 +1522,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1529,7 +1530,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); @@ -1537,7 +1538,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); @@ -1545,7 +1546,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); @@ -1553,7 +1554,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 203286d4908..56702306b14 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -289,7 +289,9 @@ set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC') -2004-12-01 09:00:00 +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2004-11-31 12:00:00' select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; convert_tz(b, 'Europe/Moscow', 'UTC') update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 366d799fde3..ba5b9e945e8 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -659,7 +659,7 @@ ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column update v2 set c=a+c; ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'c' in table 'v2' update t2,v3 set v3.a=v3.a+v3.c where t2.x=v3.c; -ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 'v3' +ERROR 42000: update command denied to user 'mysqltest_1'@'localhost' for table 'v3' update v3 set a=a+c; ERROR 42000: update command denied to user 'mysqltest_1'@'localhost' for table 'v3' use test; @@ -1433,8 +1433,7 @@ insert into v1 values (1) on duplicate key update a=2; insert into v1 values (1) on duplicate key update a=2; ERROR HY000: CHECK OPTION failed 'test.v1' insert ignore into v1 values (1) on duplicate key update a=2; -Warnings: -Error 1369 CHECK OPTION failed 'test.v1' +ERROR HY000: CHECK OPTION failed 'test.v1' select * from t1; a 1 diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 64e3fe8929b..7148f86dea1 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -140,7 +140,6 @@ select * from ( select * from t1 union select * from t1) a,(select * from t1 uni explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b; drop table t1; - # # multi-update & multi-delete with derived tables # diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 77046e5111d..b204c23b82e 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -309,8 +309,10 @@ show grants for mysqltest_3@localhost; --error 1143 update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; --error 1143 +update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1; +--error 1142 update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; ---error 1143 +--error 1142 update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; --error 1143 update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; @@ -335,7 +337,7 @@ connection conn2; use mysqltest_1; update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; # the following failed before, should fail now. ---error 1143 +--error 1044 update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; use mysqltest_2; #the following used to succeed, it must fail now. diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index 15643ebe90c..af8bd9f98b8 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -1,4 +1,7 @@ -- source include/have_innodb.inc +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings # # Test for KEY_COLUMN_USAGE & TABLE_CONSTRAINTS tables diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test index a9c0c976afc..f6142b3ddfd 100644 --- a/mysql-test/t/lowercase_table.test +++ b/mysql-test/t/lowercase_table.test @@ -7,6 +7,7 @@ drop table if exists t1,t2,t3,t4; # Clear up from other tests (to ensure that SHOW TABLES below is right) drop table if exists t0,t5,t6,t7,t8,t9; drop database if exists mysqltest; +drop view if exists v0, v1, v2, v3, v4; --enable_warnings create table T1 (id int primary key, Word varchar(40) not null, Index(Word)); diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index f8445425245..b74b06fe191 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -5,6 +5,7 @@ --disable_warnings drop table if exists t1,t2,t3; drop database if exists mysqltest; +drop view if exists v1; --error 0,1141 revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; --error 0,1141 diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index f1d8d3f7386..d46a88b9166 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -11,6 +11,10 @@ --disable_warnings drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; +# Cleanup from other tests +drop database if exists testtets; +drop table if exists t1Aa,t2Aa,v1Aa,v2Aa; +drop view if exists t1Aa,t2Aa,v1Aa,v2Aa; --enable_warnings --disable_query_log diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index cb398fed856..6dc49b28426 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -528,7 +528,7 @@ update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c; -- error 1143 update v2 set c=a+c; # no rights for view --- error 1143 +-- error 1142 update t2,v3 set v3.a=v3.a+v3.c where t2.x=v3.c; -- error 1142 update v3 set a=a+c; @@ -1394,6 +1394,7 @@ create view v1 as select * from t1 where a < 2 with check option; insert into v1 values (1) on duplicate key update a=2; -- error 1369 insert into v1 values (1) on duplicate key update a=2; +-- error 1369 insert ignore into v1 values (1) on duplicate key update a=2; select * from t1; drop view v1; diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 64aca1d6709..aa2cefae38c 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -89,7 +89,6 @@ bool g_StopServer; extern EventLogger g_EventLogger; extern int global_mgmt_server_check; -static char *opt_connect_str= 0; enum ndb_mgmd_options { NDB_STD_OPTS_OPTIONS, diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp index 72dd146dacd..88f21b31d58 100644 --- a/ndb/tools/ndb_test_platform.cpp +++ b/ndb/tools/ndb_test_platform.cpp @@ -33,14 +33,14 @@ int test_snprintf(const char * fmt, int buf_sz, int result) if(ret < 0) { printf("BaseString::snprint returns %d with size=%d and strlen(fmt)=%d\n", - ret, buf_sz, strlen(fmt)); + ret, buf_sz, (int) strlen(fmt)); return -1; } if(ret+1 == buf_sz) { printf("BaseString::snprint truncates returns %d with size=%d and strlen(fmt)=%d\n", - ret, buf_sz, strlen(fmt)); + ret, buf_sz, (int) strlen(fmt)); return -1; } @@ -87,7 +87,7 @@ main(void) if (sizeof(UintPtr) != sizeof(Uint32*)) { printf("sizeof(UintPtr)=%d != sizeof(Uint32*)=%d\n", - sizeof(UintPtr), sizeof(Uint32*)); + (int) sizeof(UintPtr), (int) sizeof(Uint32*)); return -1; } diff --git a/regex/main.c b/regex/main.c index 29abca6d9a2..8fe16d74eee 100644 --- a/regex/main.c +++ b/regex/main.c @@ -78,7 +78,7 @@ char *argv[]; if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, (int) sizeof(erbuf), erbuf); + eprint(err), (int) len, (int) sizeof(erbuf), erbuf); exit(status); } regprint(&re, stdout); diff --git a/sql/field.cc b/sql/field.cc index 0f1faccfe42..a270f102cd5 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -342,9 +342,10 @@ String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_flag) longlong value= val_int(); if (val_buffer->alloc(length)) return 0; - length= (uint) cs->cset->longlong10_to_str(cs, (char*) val_buffer->ptr(), - length, unsigned_flag ? 10 : -10, - value); + length= (uint) (*cs->cset->longlong10_to_str)(cs, (char*) val_buffer->ptr(), + length, + unsigned_flag ? 10 : -10, + value); val_buffer->length(length); return val_buffer; } diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 0bbdf84c8d6..57b5e006489 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -83,8 +83,17 @@ TODO: #include "mysql_version.h" #include "lex.h" +const char *default_dbug_option="d:t:o,/tmp/gen_lex_hash.trace"; + struct my_option my_long_options[] = { +#ifdef DBUG_OFF + {"debug", '#', "This is a non-debug version. Catch this and exit", + 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#else + {"debug", '#', "Output debug log", (gptr*) &default_dbug_option, + (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"help", '?', "Display help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit", @@ -108,7 +117,7 @@ hash_lex_struct *get_hash_struct_by_len(hash_lex_struct **root_by_len, { if (*max_lenfirst_char= 0; @@ -353,6 +362,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case '?': usage(0); exit(0); + case '#': + DBUG_PUSH(argument ? argument : default_dbug_option); + break; } return 0; } @@ -425,11 +437,12 @@ int check_duplicates() int main(int argc,char **argv) { MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); if (get_options(argc,(char **) argv)) exit(1); - printf("/* Copyright (C) 2001 MySQL AB\n\ + printf("/* Copyright (C) 2001-2004 MySQL AB\n\ This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ and you are welcome to modify and redistribute it under the GPL license\n\ \n*/\n\n"); @@ -449,9 +462,8 @@ int main(int argc,char **argv) printf("\nunsigned int sql_functions_max_len=%d;\n",max_len); printf("\nunsigned int symbols_max_len=%d;\n\n",max_len2); - printf -( -"inline SYMBOL *get_hash_symbol(const char *s,\n\ + printf("\ +inline SYMBOL *get_hash_symbol(const char *s,\n \ unsigned int len,bool function)\n\ {\n\ register uchar *hash_map;\n\ @@ -516,5 +528,7 @@ int main(int argc,char **argv) }\n\ }\n" ); + my_end(0); + exit(0); } diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index c23a728b715..c89eb4426ff 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1410,8 +1410,9 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keydef[i].seg[j].start= pos->key_part[j].offset; keydef[i].seg[j].length= pos->key_part[j].length; keydef[i].seg[j].bit_start= keydef[i].seg[j].bit_end= - keydef[i].seg[j].bit_pos= 0; - keydef[i].seg[j].language = field->charset()->number; + keydef[i].seg[j].bit_length= 0; + keydef[i].seg[j].bit_pos= 0; + keydef[i].seg[j].language= field->charset()->number; if (field->null_ptr) { diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7320665dc49..2d2bd12f425 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -408,6 +408,7 @@ static inline bool ndb_supported_type(enum_field_types type) case MYSQL_TYPE_NULL: case MYSQL_TYPE_GEOMETRY: case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_BIT: break; } return FALSE; diff --git a/sql/item.cc b/sql/item.cc index ee77f2d43c0..7dba1f3a66a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -23,7 +23,6 @@ #include #include "my_dir.h" #include "sp_rcontext.h" -#include "sql_acl.h" #include "sp_head.h" #include "sql_trigger.h" #include "sql_select.h" @@ -1925,6 +1924,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) /* Search in the SELECT and GROUP lists of the outer select. */ if (outer_sel->resolve_mode == SELECT_LEX::SELECT_MODE) + { if (!(ref= resolve_ref_in_select_and_group(thd, this, outer_sel))) return TRUE; /* Some error occured (e.g. ambigous names). */ if (ref != not_found_item) diff --git a/sql/item.h b/sql/item.h index 5a760db23f5..2503f137355 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1120,9 +1120,9 @@ public: /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} - double val() + double val_real() { - double tmp=(*ref)->val(); + double tmp=(*ref)->val_real(); null_value=(*ref)->null_value; return tmp; } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a118de6fdb9..40513c2c25a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -154,7 +154,7 @@ void Item_func_not_all::print(String *str) longlong Item_func_nop_all::val_int() { DBUG_ASSERT(fixed == 1); - double value= args[0]->val(); + longlong value= args[0]->val_int(); /* return FALSE if there was records in underlaying select in max/min diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c346de98615..a820d04d900 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -635,7 +635,8 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list, bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, List &fields, List_item *values, List &update_fields, - List &update_values, enum_duplicates duplic); + List &update_values, enum_duplicates duplic, + COND **where, bool select_insert); bool mysql_insert(THD *thd,TABLE_LIST *table,List &fields, List &values, List &update_fields, List &update_values, enum_duplicates flag); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 203be4b96a4..2b51419d7b7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2124,7 +2124,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) if (!(opt_specialflag & SPECIAL_NO_PRIOR)) my_pthread_attr_setprio(&connection_attrib,INTERRUPT_PRIOR); if (pthread_create(&tmp,&connection_attrib, kill_server_thread, - (void*) sig)) + (void*) &sig)) sql_print_error("Can't create thread to kill server"); #else kill_server((void*) sig); // MIT THREAD has a alarm thread diff --git a/sql/sp.cc b/sql/sp.cc index 4605d49f3ab..04233f931b5 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -16,7 +16,6 @@ #include "mysql_priv.h" -#include "sql_acl.h" #include "sp.h" #include "sp_head.h" #include "sp_cache.h" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 31c6075b590..9afc0c04631 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -19,7 +19,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include "sp_head.h" #include "sp.h" #include "sp_pcontext.h" diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 81419d64e15..57430d5ee8e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2981,15 +2981,17 @@ err: bool check_grant_column(THD *thd, GRANT_INFO *grant, - char*db_name, char *table_name, + char *db_name, char *table_name, const char *name, uint length, uint show_tables) { GRANT_TABLE *grant_table; GRANT_COLUMN *grant_column; - ulong want_access= grant->want_privilege & ~grant->privilege; + DBUG_ENTER("check_grant_column"); + DBUG_PRINT("enter", ("table: %s want_access: %u", table_name, want_access)); + if (!want_access) - return 0; // Already checked + DBUG_RETURN(0); // Already checked rw_rdlock(&LOCK_grant); @@ -3000,7 +3002,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, grant->grant_table= table_hash_search(thd->host, thd->ip, db_name, thd->priv_user, - table_name, 0); /* purecov: inspected */ + table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } if (!(grant_table= grant->grant_table)) @@ -3010,13 +3012,13 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, if (grant_column && !(~grant_column->rights & want_access)) { rw_unlock(&LOCK_grant); - return 0; + DBUG_RETURN(0); } #ifdef NOT_USED if (show_tables && (grant_column || grant->privilege & COL_ACLS)) { rw_unlock(&LOCK_grant); /* purecov: deadcode */ - return 0; /* purecov: deadcode */ + DBUG_RETURN(0); /* purecov: deadcode */ } #endif @@ -3033,7 +3035,7 @@ err: name, table_name); } - return 1; + DBUG_RETURN(1); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 250da2981ff..62d0c72a4b3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2067,10 +2067,10 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list, uint *cached_field_index_ptr, bool register_tree_change) { - DBUG_ENTER("find_field_in_table"); - DBUG_PRINT("enter", ("table:%s name: %s item name %s, ref 0x%lx", - table_list->alias, name, item_name, (ulong)ref)); Field *fld; + DBUG_ENTER("find_field_in_table"); + DBUG_PRINT("enter", ("table: '%s' name: '%s' item name: '%s' ref 0x%lx", + table_list->alias, name, item_name, (ulong) ref)); if (table_list->field_translation) { DBUG_ASSERT(ref != 0 && table_list->view != 0); @@ -2097,10 +2097,7 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list, item_name); /* as far as Item_ref have defined reference it do not need tables */ if (register_tree_change && item_ref) - { thd->change_item_tree(ref, item_ref); - (*ref)->fix_fields(thd, 0, ref); - } } DBUG_RETURN((Field*) view_ref_found); } @@ -2788,6 +2785,7 @@ TABLE_LIST **make_leaves_list(TABLE_LIST **list, TABLE_LIST *tables) bool setup_tables(THD *thd, TABLE_LIST *tables, Item **conds, TABLE_LIST **leaves, bool refresh, bool select_insert) { + uint tablenr= 0; DBUG_ENTER("setup_tables"); /* this is used for INSERT ... SELECT. @@ -2800,13 +2798,9 @@ bool setup_tables(THD *thd, TABLE_LIST *tables, Item **conds, DBUG_RETURN(0); tables->setup_is_done= 1; - if (!(*leaves)) - { make_leaves_list(leaves, tables); - } - uint tablenr= 0; for (TABLE_LIST *table_list= *leaves; table_list; table_list= table_list->next_leaf, tablenr++) diff --git a/sql/sql_class.h b/sql/sql_class.h index 149d12225a3..db6dbd5e3ea 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1401,7 +1401,7 @@ public: List &fields_par, List &keys_par, List &select_fields,enum_duplicates duplic) - :select_insert (NULL, NULL, &select_fields, duplic, 0), create_table(table), + :select_insert (NULL, NULL, &select_fields, 0, 0, duplic, 0), create_table(table), extra_fields(&fields_par),keys(&keys_par), create_info(create_info_par), lock(0) {} diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index e2b7ee93905..c681fe25548 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -180,6 +180,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, char *query= thd->query; #endif thr_lock_type lock_type = table_list->lock_type; + Item *unused_conds= 0; DBUG_ENTER("mysql_insert"); /* @@ -244,7 +245,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, values= its++; if (mysql_prepare_insert(thd, table_list, table, fields, values, - update_fields, update_values, duplic)) + update_fields, update_values, duplic, &unused_conds, + FALSE)) goto abort; /* mysql_prepare_insert set table_list->table if it was not set */ @@ -651,6 +653,10 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list, mysql_prepare_insert() thd Thread handler table_list Global/local table list + table Table to insert into (can be NULL if table should be taken from + table_list->table) + where Where clause (for insert ... select) + select_insert TRUE if INSERT ... SELECT statement RETURN VALUE FALSE OK @@ -660,11 +666,11 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list, bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, List &fields, List_item *values, List &update_fields, List &update_values, - enum_duplicates duplic) + enum_duplicates duplic, + COND **where, bool select_insert) { bool insert_into_view= (table_list->view != 0); /* TODO: use this condition for 'WITH CHECK OPTION' */ - Item *unused_conds= 0; bool res; DBUG_ENTER("mysql_prepare_insert"); DBUG_PRINT("enter", ("table_list 0x%lx, table 0x%lx, view %d", @@ -675,11 +681,11 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, { /* it should be allocated before Item::fix_fields() */ if (table_list->set_insert_values(thd->mem_root)) - goto abort; + DBUG_RETURN(TRUE); } - if (mysql_prepare_insert_check_table(thd, table_list, fields, &unused_conds, - FALSE)) + if (mysql_prepare_insert_check_table(thd, table_list, fields, where, + select_insert)) DBUG_RETURN(TRUE); if ((values && check_insert_fields(thd, table_list, fields, *values, 1, @@ -799,7 +805,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) DBUG_ASSERT(table->insert_values != NULL); store_record(table,insert_values); restore_record(table,record[1]); - DBUG_ASSERT(info->update_fields->elements == info->update_values->elements); + DBUG_ASSERT(info->update_fields->elements == + info->update_values->elements); if (fill_record(thd, *info->update_fields, *info->update_values, 0)) goto err; @@ -808,7 +815,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) (res= info->view->view_check_option(current_thd, info->ignore)) == VIEW_CHECK_SKIP) break; - else if (res == VIEW_CHECK_ERROR) + if (res == VIEW_CHECK_ERROR) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) @@ -1715,23 +1722,25 @@ bool delayed_insert::handle_inserts(void) bool mysql_insert_select_prepare(THD *thd) { LEX *lex= thd->lex; - TABLE_LIST* first_select_table= - (TABLE_LIST*)lex->select_lex.table_list.first; - TABLE_LIST* first_select_leaf_table; + TABLE_LIST *first_select_table= + (TABLE_LIST*) lex->select_lex.table_list.first; + TABLE_LIST *first_select_leaf_table; int res; DBUG_ENTER("mysql_insert_select_prepare"); /* SELECT_LEX do not belong to INSERT statement, so we can't add WHERE - clasue if table is VIEW + clause if table is VIEW */ lex->query_tables->no_where_clause= 1; - if (mysql_prepare_insert_check_table(thd, lex->query_tables, - lex->field_list, - &lex->select_lex.where, - TRUE)) + if (mysql_prepare_insert(thd, lex->query_tables, + lex->query_tables->table, lex->field_list, 0, + lex->update_list, lex->value_list, + lex->duplicates, + &lex->select_lex.where, TRUE)) DBUG_RETURN(TRUE); + /* - setup was done in mysql_insert_select_prepare, but we have to mark + setup was done in mysql_prepare_insert_check_table, but we have to mark first local table */ if (first_select_table) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index ece960c5d1c..c8ad2b00480 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -952,13 +952,12 @@ int yylex(void *arg, void *yythd) if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && (thd->command != COM_PREPARE)) { - lex->found_colon=(char*)lex->ptr; - thd->server_status |= SERVER_MORE_RESULTS_EXISTS; - lex->next_state=MY_LEX_END; - return(END_OF_INPUT); + lex->found_colon= (char*) lex->ptr; + thd->server_status|= SERVER_MORE_RESULTS_EXISTS; + lex->next_state= MY_LEX_END; + return (END_OF_INPUT); } - else - state=MY_LEX_CHAR; // Return ';' + state= MY_LEX_CHAR; // Return ';' break; } /* fall true */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b5b0d76dcf3..6a59469f5c2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2983,13 +2983,8 @@ create_error: select_result *result; unit->set_limit(select_lex, select_lex); - if (!(res= open_and_lock_tables(thd, all_tables)) && - !(res= mysql_prepare_insert(thd, tables, first_local_table, - tables->table, lex->field_list, 0, - lex->update_list, lex->value_list, - lex->duplicates))) + if (!(res= open_and_lock_tables(thd, all_tables))) { - TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*)first_table->next_local; @@ -3008,8 +3003,10 @@ create_error: res= handle_select(thd, lex, result); lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; delete result; - table->insert_values= 0; } + /* in case of error first_table->table can be 0 */ + if (first_table->table) + first_table->table->insert_values= 0; /* revert changes for SP */ lex->select_lex.table_list.first= (byte*) first_table; } @@ -3819,8 +3816,8 @@ create_error: st_sp_security_context save_ctx; #endif ha_rows select_limit; - uint smrx; - LINT_INIT(smrx); + /* bits that should be cleared in thd->server_status */ + uint bits_to_be_cleared= 0; /* In case the arguments are subselects... */ if (all_tables && @@ -3842,8 +3839,13 @@ create_error: #endif goto error; } - smrx= thd->server_status & SERVER_MORE_RESULTS_EXISTS; - thd->server_status |= SERVER_MORE_RESULTS_EXISTS; + /* + If SERVER_MORE_RESULTS_EXISTS is not set, + then remember that it should be cleared + */ + bits_to_be_cleared= (~thd->server_status & + SERVER_MORE_RESULTS_EXISTS); + thd->server_status|= SERVER_MORE_RESULTS_EXISTS; } #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -3863,14 +3865,11 @@ create_error: #ifndef EMBEDDED_LIBRARY thd->net.no_send_ok= nsok; #endif - if (sp->m_multi_results) - { - if (! smrx) - thd->server_status &= ~SERVER_MORE_RESULTS_EXISTS; - } + thd->server_status&= ~bits_to_be_cleared; if (!res) - send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 : thd->row_count_func)); + send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 : + thd->row_count_func)); else goto error; // Substatement should already have sent error } @@ -6102,10 +6101,9 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info",("Checking sub query list")); for (table= tables; table; table= table->next_global) { - if (my_tz_check_n_skip_implicit_tables(&table, - lex->time_zone_tables_used)) - continue; - if (!table->table_in_first_from_clause && table->derived) + if (!my_tz_check_n_skip_implicit_tables(&table, + lex->time_zone_tables_used) && + !table->table_in_first_from_clause) { if (check_access(thd, SELECT_ACL, table->db, &table->grant.privilege, 0, 0) || diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index e4e61dc8d31..c860e3a79ac 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -905,10 +905,12 @@ static bool mysql_test_insert(Prepared_statement *stmt, { uint value_count; ulong counter= 0; + Item *unused_conds= 0; if ((res= mysql_prepare_insert(thd, table_list, table_list->table, fields, values, update_fields, - update_values, duplic))) + update_values, duplic, + &unused_conds, FALSE))) goto error; value_count= values->elements; @@ -1381,18 +1383,21 @@ static int mysql_test_multidelete(Prepared_statement *stmt, 1 error, sent to client -1 error, not sent to client */ + static int mysql_test_insert_select(Prepared_statement *stmt, TABLE_LIST *tables) { int res; LEX *lex= stmt->lex; + TABLE_LIST *first_local_table; + if ((res= insert_precheck(stmt->thd, tables))) return res; - TABLE_LIST *first_local_table= - (TABLE_LIST *)lex->select_lex.table_list.first; + first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first; DBUG_ASSERT(first_local_table != 0); /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*) first_local_table->next_local; + /* insert/replace from SELECT give its SELECT_LEX for SELECT, and item_list belong to SELECT @@ -1595,7 +1600,7 @@ static void cleanup_stmt_for_execute(Prepared_statement *stmt) { for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first; tables; - tables= tables->next) + tables= tables->next_global) { if (tables->table) tables->table->insert_values= 0; @@ -1698,7 +1703,6 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (!error) error= check_prepared_statement(stmt, test(name)); - cleanup_stmt_for_execute(stmt); /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */ if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -1713,6 +1717,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, lex_end(lex); thd->restore_backup_statement(stmt, &thd->stmt_backup); cleanup_items(stmt->free_list); + cleanup_stmt_for_execute(stmt); close_thread_tables(thd); thd->rollback_item_tree_changes(); thd->cleanup_after_query(); @@ -2057,9 +2062,9 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, cleanup_items(stmt->free_list); thd->rollback_item_tree_changes(); reset_stmt_params(stmt); + cleanup_stmt_for_execute(stmt); close_thread_tables(thd); // to close derived tables thd->set_statement(&thd->stmt_backup); - cleanup_stmt_for_execute(stmt); thd->cleanup_after_query(); if (stmt->state == Item_arena::PREPARED) @@ -2087,7 +2092,6 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) int error; DBUG_ENTER("mysql_stmt_fetch"); - thd->current_arena= stmt; if (!(stmt= thd->stmt_map.find(stmt_id)) || !stmt->cursor || !stmt->cursor->is_open()) @@ -2095,7 +2099,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), stmt_id, "fetch"); DBUG_VOID_RETURN; } - + thd->current_arena= stmt; thd->set_n_backup_statement(stmt, &thd->stmt_backup); stmt->cursor->init_thd(thd); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index a88dc0b20bf..96ede3fbe6b 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -2,8 +2,6 @@ #include "sp_head.h" #include "sql_trigger.h" #include "parse_file.h" -#include "sql_acl.h" - static const LEX_STRING triggers_file_type= {(char *)"TRIGGERS", 8}; static const char * const triggers_file_ext= ".TRG"; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index fa4acce31f7..d10c54f6fab 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -620,9 +620,8 @@ bool mysql_multi_update_prepare(THD *thd) LEX *lex= thd->lex; ulong opened_tables; TABLE_LIST *table_list= lex->query_tables; + TABLE_LIST *tl, *leaves; List *fields= &lex->select_lex.item_list; - TABLE_LIST *tl; - TABLE_LIST *leaves; table_map tables_for_update; int res; bool update_view= 0; @@ -634,9 +633,10 @@ bool mysql_multi_update_prepare(THD *thd) uint table_count= lex->table_count; const bool using_lock_tables= thd->locked_tables != 0; bool original_multiupdate= (thd->lex->sql_command == SQLCOM_UPDATE_MULTI); + DBUG_ENTER("mysql_multi_update_prepare"); + /* following need for prepared statements, to run next time multi-update */ thd->lex->sql_command= SQLCOM_UPDATE_MULTI; - DBUG_ENTER("mysql_multi_update_prepare"); /* open tables and create derived ones, but do not lock and fill them */ if ((original_multiupdate && open_tables(thd, table_list, & table_count)) || @@ -651,24 +651,7 @@ bool mysql_multi_update_prepare(THD *thd) if (setup_tables(thd, table_list, &lex->select_lex.where, &lex->select_lex.leaf_tables, FALSE, FALSE)) DBUG_RETURN(TRUE); - /* - Ensure that we have update privilege for all tables and columns in the - SET part - */ - for (tl= (leaves= lex->select_lex.leaf_tables); tl; tl= tl->next_leaf) - { - /* - Update of derived tables is checked later - We don't check privileges here, becasue then we would get error - "UPDATE command denided .. for column N" instead of - "Target table ... is not updatable" - */ - TABLE *table= tl->table; - TABLE_LIST *tlist; - if (!(tlist= tl->belong_to_view?tl->belong_to_view:tl)->derived) - tlist->grant.want_privilege= table->grant.want_privilege= - (UPDATE_ACL & ~table->grant.privilege); - } + leaves= lex->select_lex.leaf_tables; if ((lex->select_lex.no_wrap_view_item= 1, res= setup_fields(thd, 0, table_list, *fields, 1, 0, 0), @@ -698,11 +681,6 @@ bool mysql_multi_update_prepare(THD *thd) for (tl= leaves; tl; tl= tl->next_leaf) { TABLE *table= tl->table; - TABLE_LIST *tlist= tl->belong_to_view?tl->belong_to_view:tl; - - /* We only need SELECT privilege for columns in the values list */ - tlist->grant.want_privilege= table->grant.want_privilege= - (SELECT_ACL & ~table->grant.privilege); /* Only set timestamp column if this is not modified */ if (table->timestamp_field && table->timestamp_field->query_id == thd->query_id) @@ -730,26 +708,24 @@ bool mysql_multi_update_prepare(THD *thd) DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); tl->lock_type= lex->multi_lock_option; tl->updating= 1; - } + } else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); tl->lock_type= TL_READ; tl->updating= 0; } - if (!using_lock_tables) - tl->table->reginfo.lock_type= tl->lock_type; /* Check access privileges for table */ + if (!tl->derived) { - TABLE_LIST *save= tl->next; - bool res; - tl->next= 0; - res= (check_access(thd, tl->updating ? UPDATE_ACL : SELECT_ACL, - tl->db, &tl->grant.privilege, 0, 0) || - (grant_option && check_grant(thd, wants, tl, 0, 0, 0))); - tl->next= save; - if (res) + uint want_privilege= tl->updating ? UPDATE_ACL : SELECT_ACL; + if (!using_lock_tables) + tl->table->reginfo.lock_type= tl->lock_type; + + if (check_access(thd, want_privilege, + tl->db, &tl->grant.privilege, 0, 0) || + (grant_option && check_grant(thd, want_privilege, tl, 0, 1, 0))) DBUG_RETURN(TRUE); } } @@ -806,6 +782,22 @@ bool mysql_multi_update_prepare(THD *thd) res)) DBUG_RETURN(TRUE); } + + /* We only need SELECT privilege for columns in the values list */ + for (tl= leaves; tl; tl= tl->next_leaf) + { + TABLE *table= tl->table; + TABLE_LIST *tlist; + if (!(tlist= tl->belong_to_view ? tl->belong_to_view : tl)->derived) + { + tlist->grant.want_privilege= + (SELECT_ACL & ~tlist->grant.privilege); + table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege); + } + DBUG_PRINT("info", ("table: %s want_privilege: %u", tl->alias, + (uint) table->grant.want_privilege)); + } + if (thd->fill_derived_tables() && mysql_handle_derived(lex, &mysql_derived_filling)) DBUG_RETURN(TRUE); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 993a4d1987b..bafb57c44b0 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -16,7 +16,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" #include "parse_file.h" #include "sp.h" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1c2dde5d278..96e93fb126d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5716,7 +5716,7 @@ expr_or_default: opt_insert_update: /* empty */ - | ON DUPLICATE_SYM + | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; } KEY_SYM UPDATE_SYM insert_update_list ; @@ -5759,6 +5759,8 @@ update_list: update_elem: simple_ident_nospvar equal expr_or_default { + if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) + YYABORT; }; insert_update_list: diff --git a/sql/table.cc b/sql/table.cc index a37186287b4..877ffe4fbb9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -21,7 +21,6 @@ #include #include #include "md5.h" -#include "sql_acl.h" /* Functions defined in this file */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 07c45788d30..76981200a4d 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -277,7 +277,8 @@ static int my_strnncollsp_czech(CHARSET_INFO * cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index d3fb16aa52e..d21b340e768 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1360,7 +1360,8 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { /* TODO: Needs to be fixed to handle end space! */ return my_strnncoll_ucs2_bin(cs,s,slen,t,tlen,0); diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 896aef775cf..397dcd6f2f2 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -480,7 +480,8 @@ static int my_strnncollsp_win1250ch(CHARSET_INFO * cs, const uchar *s, uint slen, const uchar *t, uint tlen, - my_bool diff_if_only_endspace_difference) + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { for ( ; slen && s[slen-1] == ' ' ; slen--); for ( ; tlen && t[tlen-1] == ' ' ; tlen--); diff --git a/strings/xml.c b/strings/xml.c index 6ba52ea41a8..d19c3dab241 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -135,7 +135,7 @@ static int my_xml_value(MY_XML_PARSER *st, const char *str, uint len) static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len) { - if ( (st->attrend-st->attr+len+1)>sizeof(st->attr)) + if ((uint) (st->attrend-st->attr+len+1) > sizeof(st->attr)) { sprintf(st->errstr,"To deep XML"); return MY_XML_ERROR; diff --git a/tests/client_test.c b/tests/client_test.c index 1a6b9525f87..8dc0ec5ca84 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -705,8 +705,12 @@ static void verify_prepare_field(MYSQL_RES *result, as utf8. Field length is calculated as number of characters * maximum number of bytes a character can occupy. */ - if (length) + if (length && field->length != length * cs->mbmaxlen) + { + fprintf(stderr, "Expected field length: %d, got length: %d\n", + (int) (length * cs->mbmaxlen), (int) field->length); DIE_UNLESS(field->length == length * cs->mbmaxlen); + } if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } @@ -1419,7 +1423,9 @@ static void test_prepare_field_result() "t1", "test_prepare_field_result", current_db, 10, 0); verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP, "t1", "test_prepare_field_result", current_db, 19, 0); - verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_VAR_STRING, + verify_prepare_field(result, 4, "char_c", "char_c", + (mysql_get_server_version(mysql) <= 50000 ? + MYSQL_TYPE_VAR_STRING : MYSQL_TYPE_STRING), "t1", "test_prepare_field_result", current_db, 4, 0); verify_field_count(result, 5); @@ -7356,7 +7362,7 @@ static void test_explain_bug() verify_prepare_field(result, 0, "Field", "COLUMN_NAME", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 192, 0); + 0, 0, "", 64, 0); verify_prepare_field(result, 1, "Type", "COLUMN_TYPE", MYSQL_TYPE_BLOB, 0, 0, "", 0, 0); @@ -7364,22 +7370,22 @@ static void test_explain_bug() verify_prepare_field(result, 2, "Null", "IS_NULLABLE", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 9, 0); + 0, 0, "", 3, 0); verify_prepare_field(result, 3, "Key", "COLUMN_KEY", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 9, 0); + 0, 0, "", 3, 0); verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 192, 0); + 0, 0, "", 64, 0); verify_prepare_field(result, 5, "Extra", "EXTRA", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 60, 0); + 0, 0, "", 20, 0); mysql_free_result(result); mysql_stmt_close(stmt); @@ -12171,6 +12177,8 @@ static void test_rewind(void) myquery(rc); rc= mysql_stmt_free_result(stmt); rc= mysql_stmt_close(stmt); +} + static void test_truncation() { diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c index d05e50af16b..e4d32a75264 100644 --- a/vio/test-sslserver.c +++ b/vio/test-sslserver.c @@ -91,12 +91,7 @@ main(int argc __attribute__((unused)), char** argv) struct sockaddr_in sa_cli; int listen_sd; int err; - -#if defined(__sgi) && _NO_XOPEN4 && _NO_XOPEN5 - socklen_t client_len; -#else - size_t client_len; -#endif + size_socket client_len; int reuseaddr = 1; /* better testing, uh? */ MY_INIT(argv[0]); -- cgit v1.2.1