Merge abotchkov@work.mysql.com:/home/bk/mysql-4.1

into deer.mysql.r18.ru:/home/hf/work/mysql-default
This commit is contained in:
hf@deer.mysql.r18.ru 2003-01-22 20:51:54 +04:00
commit 524e33eb59
198 changed files with 3577 additions and 2158 deletions

View file

@ -3,9 +3,9 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags"
extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs"
strip=yes
#strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \

View file

@ -21,7 +21,8 @@ AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README \
COPYING COPYING.LIB
SUBDIRS = . include @docs_dirs@ @readline_dir@ \
SUBDIRS = . include @docs_dirs@ \
@readline_topdir@ @readline_dir@ \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests \
BUILD os2 libmysql_r @libmysqld_dirs@ \

View file

@ -25,7 +25,7 @@ CFG=bdb - Win32 Max
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "bdb - Win32 Debug"
@ -41,14 +41,13 @@ RSC=rc.exe
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb" /I "../bdb/dbinc" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\bdb.lib"
@ -66,13 +65,13 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /Fr
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_debug\bdb.lib"
# ADD LIB32 /nologo /out:"..\lib_release\bdb.lib"
@ -167,34 +166,6 @@ SOURCE=.\db\crdel_rec.c
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_app.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_except.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_lock.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_log.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_mpool.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_table.cpp
# End Source File
# Begin Source File
SOURCE=.\cxx\cxx_txn.cpp
# End Source File
# Begin Source File
SOURCE=.\db\db.c
# End Source File
# Begin Source File
@ -235,6 +206,10 @@ SOURCE=.\common\db_getlong.c
# End Source File
# Begin Source File
SOURCE=.\common\db_idspace.c
# End Source File
# Begin Source File
SOURCE=.\db\db_iface.c
# End Source File
# Begin Source File
@ -255,6 +230,10 @@ SOURCE=.\db\db_method.c
# End Source File
# Begin Source File
SOURCE=.\db\db_open.c
# End Source File
# Begin Source File
SOURCE=.\db\db_overflow.c
# End Source File
# Begin Source File
@ -271,6 +250,14 @@ SOURCE=.\db\db_reclaim.c
# End Source File
# Begin Source File
SOURCE=.\db\db_remove.c
# End Source File
# Begin Source File
SOURCE=.\db\db_rename.c
# End Source File
# Begin Source File
SOURCE=.\db\db_ret.c
# End Source File
# Begin Source File
@ -283,6 +270,10 @@ SOURCE=.\env\db_shash.c
# End Source File
# Begin Source File
SOURCE=.\db\db_truncate.c
# End Source File
# Begin Source File
SOURCE=.\db\db_upg.c
# End Source File
# Begin Source File
@ -303,6 +294,26 @@ SOURCE=.\dbm\dbm.c
# End Source File
# Begin Source File
SOURCE=.\dbreg\dbreg.c
# End Source File
# Begin Source File
SOURCE=.\dbreg\dbreg_auto.c
# End Source File
# Begin Source File
SOURCE=.\dbreg\dbreg_rec.c
# End Source File
# Begin Source File
SOURCE=.\dbreg\dbreg_util.c
# End Source File
# Begin Source File
SOURCE=.\env\env_file.c
# End Source File
# Begin Source File
SOURCE=.\env\env_method.c
# End Source File
# Begin Source File
@ -319,6 +330,22 @@ SOURCE=.\env\env_region.c
# End Source File
# Begin Source File
SOURCE=.\fileops\fileops_auto.c
# End Source File
# Begin Source File
SOURCE=.\fileops\fop_basic.c
# End Source File
# Begin Source File
SOURCE=.\fileops\fop_rec.c
# End Source File
# Begin Source File
SOURCE=.\fileops\fop_util.c
# End Source File
# Begin Source File
SOURCE=.\hash\hash.c
# End Source File
# Begin Source File
@ -347,6 +374,10 @@ SOURCE=.\hash\hash_method.c
# End Source File
# Begin Source File
SOURCE=.\hash\hash_open.c
# End Source File
# Begin Source File
SOURCE=.\hash\hash_page.c
# End Source File
# Begin Source File
@ -371,6 +402,10 @@ SOURCE=.\hash\hash_verify.c
# End Source File
# Begin Source File
SOURCE=.\hmac\hmac.c
# End Source File
# Begin Source File
SOURCE=.\hsearch\hsearch.c
# End Source File
# Begin Source File
@ -379,10 +414,6 @@ SOURCE=.\lock\lock.c
# End Source File
# Begin Source File
SOURCE=.\lock\lock_conflict.c
# End Source File
# Begin Source File
SOURCE=.\lock\lock_deadlock.c
# End Source File
# Begin Source File
@ -411,18 +442,10 @@ SOURCE=.\log\log_archive.c
# End Source File
# Begin Source File
SOURCE=.\log\log_auto.c
# End Source File
# Begin Source File
SOURCE=.\log\log_compare.c
# End Source File
# Begin Source File
SOURCE=.\log\log_findckp.c
# End Source File
# Begin Source File
SOURCE=.\log\log_get.c
# End Source File
# Begin Source File
@ -435,14 +458,6 @@ SOURCE=.\log\log_put.c
# End Source File
# Begin Source File
SOURCE=.\log\log_rec.c
# End Source File
# Begin Source File
SOURCE=.\log\log_register.c
# End Source File
# Begin Source File
SOURCE=.\mp\mp_alloc.c
# End Source File
# Begin Source File
@ -495,6 +510,10 @@ SOURCE=.\mutex\mut_tas.c
# End Source File
# Begin Source File
SOURCE=.\mutex\mut_win32.c
# End Source File
# Begin Source File
SOURCE=.\mutex\mutex.c
# End Source File
# Begin Source File
@ -507,6 +526,14 @@ SOURCE=.\os\os_alloc.c
# End Source File
# Begin Source File
SOURCE=.\os_win32\os_clock.c
# End Source File
# Begin Source File
SOURCE=.\os_win32\os_config.c
# End Source File
# Begin Source File
SOURCE=.\os_win32\os_dir.c
# End Source File
# Begin Source File
@ -519,15 +546,15 @@ SOURCE=.\os_win32\os_fid.c
# End Source File
# Begin Source File
SOURCE=.\os_win32\os_finit.c
SOURCE=.\os_win32\os_fsync.c
# End Source File
# Begin Source File
SOURCE=.\os\os_fsync.c
SOURCE=.\os_win32\os_handle.c
# End Source File
# Begin Source File
SOURCE=.\os\os_handle.c
SOURCE=.\os\os_id.c
# End Source File
# Begin Source File
@ -563,7 +590,7 @@ SOURCE=.\os\os_rpath.c
# End Source File
# Begin Source File
SOURCE=.\os\os_rw.c
SOURCE=.\os_win32\os_rw.c
# End Source File
# Begin Source File
@ -579,7 +606,7 @@ SOURCE=.\os_win32\os_spin.c
# End Source File
# Begin Source File
SOURCE=.\os\os_stat.c
SOURCE=.\os_win32\os_stat.c
# End Source File
# Begin Source File
@ -635,6 +662,26 @@ SOURCE=.\qam\qam_verify.c
# End Source File
# Begin Source File
SOURCE=.\rep\rep_method.c
# End Source File
# Begin Source File
SOURCE=.\rep\rep_record.c
# End Source File
# Begin Source File
SOURCE=.\rep\rep_region.c
# End Source File
# Begin Source File
SOURCE=.\rep\rep_util.c
# End Source File
# Begin Source File
SOURCE=.\hmac\sha1.c
# End Source File
# Begin Source File
SOURCE=.\clib\strcasecmp.c
# End Source File
# Begin Source File
@ -647,14 +694,30 @@ SOURCE=.\txn\txn_auto.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_method.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_rec.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_recover.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_region.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_stat.c
# End Source File
# Begin Source File
SOURCE=.\txn\txn_util.c
# End Source File
# Begin Source File
SOURCE=.\common\util_log.c
# End Source File
# Begin Source File

View file

@ -566,4 +566,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -25,7 +25,7 @@ CFG=mysqlclient - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqlclient - Win32 Release"
@ -48,7 +48,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
@ -72,7 +72,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
@ -382,7 +382,7 @@ SOURCE=..\mysys\my_thr_init.c
# End Source File
# Begin Source File
SOURCE=..\mysys\my_vsnprintf.c
SOURCE=..\strings\my_vsnprintf.c
# End Source File
# Begin Source File
@ -490,6 +490,10 @@ SOURCE=..\strings\strxmov.c
# End Source File
# Begin Source File
SOURCE=..\strings\strxnmov.c
# End Source File
# Begin Source File
SOURCE=..\mysys\thr_mutex.c
# End Source File
# Begin Source File
@ -512,5 +516,9 @@ SOURCE=..\vio\viossl.c
SOURCE=..\vio\viosslfactories.c
# End Source File
# Begin Source File
SOURCE=..\strings\xml.c
# End Source File
# End Target
# End Project

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -38,4 +38,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -38,4 +38,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -27,7 +27,7 @@ CFG=INNOBASE - WIN32 RELEASE
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "innobase - Win32 Debug"
@ -43,14 +43,14 @@ RSC=rc.exe
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "__NT__" /D "WIN32" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /GX /Z7 /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "__NT__" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /GX /Z7 /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\innobase-nt.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\innodb.lib"
@ -74,7 +74,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\innodb.lib"
# ADD LIB32 /nologo /out:"..\lib_release\innodb.lib"
@ -98,7 +98,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\innodb.lib"
# ADD LIB32 /nologo /out:"..\lib_release\innodb.lib"
@ -122,7 +122,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\innodb.lib"
# ADD LIB32 /nologo /out:"..\lib_release\innodb.lib"

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -797,4 +797,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -25,7 +25,7 @@ CFG=mysqldemb - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqldemb - Win32 Release"
@ -41,14 +41,14 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
@ -65,14 +65,14 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
@ -168,10 +168,18 @@ SOURCE=..\sql\item_func.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\item_row.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\item_strfunc.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\item_subselect.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\item_sum.cpp
# End Source File
# Begin Source File
@ -216,10 +224,6 @@ SOURCE=..\sql\mini_client.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\net_pkg.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
@ -244,6 +248,10 @@ SOURCE=..\sql\procedure.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\protocol.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\records.cpp
# End Source File
# Begin Source File
@ -288,10 +296,18 @@ SOURCE=..\sql\sql_delete.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_derived.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_do.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_error.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_handler.cpp
# End Source File
# Begin Source File
@ -320,6 +336,10 @@ SOURCE=..\sql\sql_parse.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_prepare.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_rename.cpp
# End Source File
# Begin Source File

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,7 +26,7 @@ CFG=mysys - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysys - Win32 Release"
@ -49,7 +49,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysys.lib"
@ -73,7 +73,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib"
@ -98,7 +98,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib"
@ -434,10 +434,6 @@ SOURCE=.\my_thr_init.c
# End Source File
# Begin Source File
SOURCE=.\my_vsnprintf.c
# End Source File
# Begin Source File
SOURCE=.\my_wincond.c
# End Source File
# Begin Source File

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -28,7 +28,7 @@ CFG=mysqld - Win32 Release
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqld - Win32 Release"
@ -52,7 +52,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.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 /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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe"
# SUBTRACT LINK32 /debug
@ -78,7 +78,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.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 /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 ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept
@ -105,7 +105,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.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 Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT LINK32 /pdb:none /debug
@ -133,7 +133,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT BASE LINK32 /pdb:none /debug
# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe"
@ -162,7 +162,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe"
# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe"
# SUBTRACT LINK32 /debug
@ -464,8 +464,6 @@ SOURCE=.\item_func.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"
# ADD CPP /I "../zlib"
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
# ADD CPP /G5 /I "../zlib"
@ -662,6 +660,10 @@ SOURCE=.\mini_client.cpp
# End Source File
# Begin Source File
SOURCE=..\myisammrg\myrg_rnext_same.c
# End Source File
# Begin Source File
SOURCE=.\mysqld.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"
@ -779,6 +781,10 @@ SOURCE=.\procedure.cpp
# End Source File
# Begin Source File
SOURCE=.\protocol.cpp
# End Source File
# Begin Source File
SOURCE=.\records.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -25,7 +25,7 @@ CFG=strings - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "strings - Win32 Release"
@ -48,7 +48,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\strings.lib"
@ -72,7 +72,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\strings.lib"
@ -104,11 +104,11 @@ SOURCE=.\bmove512.c
# End Source File
# Begin Source File
SOURCE=".\ctype-bin.c"
SOURCE=".\ctype-big5.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-big5.c"
SOURCE=".\ctype-bin.c"
# End Source File
# Begin Source File
@ -132,6 +132,10 @@ SOURCE=".\ctype-latin1_de.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-mb.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-simple.c"
# End Source File
# Begin Source File
@ -148,6 +152,14 @@ SOURCE=".\ctype-ujis.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-utf8.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-win1250ch.c"
# End Source File
# Begin Source File
SOURCE=.\ctype.c
# End Source File
# Begin Source File
@ -164,6 +176,10 @@ SOURCE=.\longlong2str.c
# End Source File
# Begin Source File
SOURCE=.\my_vsnprintf.c
# End Source File
# Begin Source File
SOURCE=.\r_strinstr.c
# End Source File
# Begin Source File
@ -172,18 +188,6 @@ SOURCE=.\str2int.c
# End Source File
# Begin Source File
SOURCE=.\strcend.c
# End Source File
# Begin Source File
SOURCE=.\strend.c
# End Source File
# Begin Source File
SOURCE=.\strfill.c
# End Source File
# Begin Source File
SOURCE=.\Strings.asm
!IF "$(CFG)" == "strings - Win32 Release"
@ -215,19 +219,6 @@ InputName=Strings
# End Source File
# Begin Source File
SOURCE=.\strmake.c
# End Source File
# Begin Source File
SOURCE=.\strmov.c
# End Source File
# Begin Source File
SOURCE=.\strnmov.c
# End Source File
# Begin Source File
SOURCE=.\strtol.c
# End Source File
# Begin Source File
@ -277,5 +268,9 @@ InputName=Strxmov
SOURCE=.\strxnmov.c
# End Source File
# Begin Source File
SOURCE=.\xml.c
# End Source File
# End Target
# End Project

View file

@ -26,4 +26,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -1,9 +1,51 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
Microsoft Developer Studio Workspace File, Format Version 5.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "build_all"=.\build_all.dsp - Package Owner=<4>
Project: "DB_DLL"=.\db_dll.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "DB_Static"=.\db_static.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "db_archive"=.\db_archive.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
###############################################################################
Project: "db_buildall"=.\db_buildall.dsp - Package Owner=<4>
Package=<5>
{{{
@ -83,25 +125,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name excxx_tpcb
End Project Dependency
Begin Project Dependency
Project_Dep_Name db_lib
End Project Dependency
Begin Project Dependency
}}}
###############################################################################
Project: "db_archive"=.\db_archive.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
End Project Dependency
}}}
###############################################################################
@ -115,7 +138,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -132,18 +158,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name DB_DLL
End Project Dependency
}}}
###############################################################################
Project: "db_dll"=.\db_dll.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
###############################################################################
@ -157,7 +174,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -178,24 +198,6 @@ Package=<4>
###############################################################################
Project: "db_lib"=.\db_lib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_dll
End Project Dependency
Begin Project Dependency
Project_Dep_Name db_static
End Project Dependency
}}}
###############################################################################
Project: "db_load"=.\db_load.dsp - Package Owner=<4>
Package=<5>
@ -205,22 +207,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
}}}
###############################################################################
Project: "db_perf"=.\db_perf.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -235,7 +225,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -250,7 +243,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -265,20 +261,11 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
###############################################################################
Project: "db_static"=.\db_static.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
@ -307,7 +294,7 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name build_all
Project_Dep_Name db_buildall
End Project Dependency
Begin Project Dependency
Project_Dep_Name db_tcl
@ -325,7 +312,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -340,7 +330,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -355,7 +348,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -370,7 +366,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_Static
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_DLL
End Project Dependency
}}}
@ -385,7 +384,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -400,7 +402,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -415,7 +420,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -430,7 +438,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -445,7 +456,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -460,7 +474,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -475,7 +492,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -490,7 +510,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -505,7 +528,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -520,7 +546,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name db_lib
Project_Dep_Name DB_DLL
End Project Dependency
Begin Project Dependency
Project_Dep_Name DB_Static
End Project Dependency
}}}
@ -537,4 +566,3 @@ Package=<3>
}}}
###############################################################################

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2002 MySQL AB
/* Copyright (C) 2000-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
@ -80,8 +80,6 @@ extern "C" {
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
#else
// readline 4.2 has own __P
#undef __P
#include <readline/readline.h>
#define HAVE_READLINE
#endif
@ -1443,7 +1441,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (result)
{
int num_rows= mysql_num_rows(result);
ulonglong num_rows= mysql_num_rows(result);
if (num_rows == 1)
{
if (!(cur= mysql_fetch_row(result)))

View file

@ -67,7 +67,8 @@ static void dump_remote_table(NET* net, const char* db, const char* table);
static void die(const char* fmt, ...);
static MYSQL* safe_connect();
class Load_log_processor {
class Load_log_processor
{
char target_dir_name[MY_NFILE];
int target_dir_name_len;
DYNAMIC_ARRAY file_names;
@ -103,12 +104,10 @@ class Load_log_processor {
void append_to_file(const char* fname, int flags,
gptr data, uint size)
{
FILE *file;
if(!(file= my_fopen(fname,flags,MYF(MY_WME))))
exit(1);
if (my_fwrite(file,data,size,MYF(MY_WME|MY_NABP)))
exit(1);
if (my_fclose(file,MYF(MY_WME)))
File file;
if ((file= my_open(fname,flags,MYF(MY_WME)) < 0) ||
my_write(file,(byte*) data,size,MYF(MY_WME|MY_NABP)) ||
my_close(file,MYF(MY_WME)))
exit(1);
}
@ -176,7 +175,7 @@ public:
void process(Create_file_log_event *ce)
{
const char *fname= create_file(ce);
append_to_file (fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
append_to_file(fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
}
void process(Append_block_log_event *ae)
{

View file

@ -0,0 +1,6 @@
## Process this file with automake to create Makefile.in
SUBDIRS= @readline_basedir@
# Don't update the files from bitkeeper
%::SCCS/s.%

View file

@ -2039,14 +2039,18 @@ mkdir include/readline
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then
readline_dir="cmd-line-utils/libedit"
readline_topdir="cmd-line-utils"
readline_basedir="libedit"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/libedit/liblibedit.a"
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/libedit/readline/*.h readline/"
compile_libedit=yes
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
elif test "$with_readline" = "yes"
then
readline_dir="cmd-line-utils/readline"
readline_topdir="cmd-line-utils"
readline_basedir="readline"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/readline/*.h readline/"
compile_readline=yes
@ -2056,16 +2060,19 @@ else
MYSQL_CHECK_NEW_RL_INTERFACE
if ["$mysql_cv_new_rl_interface"="yes"] || [test "$mysql_cv_libedit_interface"="no"]
then
readline_dir=""
readline_link="-lreadline"
else
readline_dir=""
readline_link="-ledit"
fi
readline_topdir=""
readline_basedir=""
readline_dir=""
readline_h_ln_cmd=""
fi
AC_SUBST(readline_dir)
AC_SUBST(readline_topdir)
AC_SUBST(readline_basedir)
AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd)
@ -2077,10 +2084,10 @@ dnl you must also create strings/ctype-$charset_name.c
AC_DIVERT_PUSH(0)
CHARSETS_AVAILABLE="armscii8 big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
latin1 latin1_de latin2 latin5 sjis swe7 tis620 ucs2 ujis
usa7 utf8 win1250 win1250ch win1251ukr"
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
latin1 latin1_de latin2 latin5 sjis swe7 tis620 ucs2 ujis
usa7 utf8 win1250 win1250ch win1251ukr"
CHARSETS_DEPRECATED="win1251"
CHARSETS_COMPLEX="big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ucs2 ujis utf8 win1250ch"
DEFAULT_CHARSET=latin1
@ -2462,6 +2469,11 @@ then
AC_OUTPUT(cmd-line-utils/libedit/Makefile)
fi
if [test "$compile_libedit" = "yes"] || [test "$compile_readline" = "yes"]
then
AC_OUTPUT(cmd-line-utils/Makefile)
fi
AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \
strings/Makefile regex/Makefile heap/Makefile \
bdb/Makefile \

View file

@ -20,6 +20,8 @@
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status);
static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
my_bool print_status);
/*

View file

@ -262,6 +262,7 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_ISAM /* We want to have support for ISAM in 4.0 */
#define HAVE_QUERY_CACHE
#define SPRINTF_RETURNS_INT
#define HAVE_VIO
#ifdef NOT_USED
#define HAVE_SNPRINTF /* Gave link error */

View file

@ -26,7 +26,6 @@
extern "C" {
#endif
#define MY_CS_NAME_SIZE 32
#define MY_CS_CTYPE_TABLE_SIZE 257
#define MY_CS_TO_LOWER_TABLE_SIZE 256
@ -38,7 +37,8 @@ extern "C" {
#define my_wc_t ulong
typedef struct unicase_info_st {
typedef struct unicase_info_st
{
uint16 toupper;
uint16 tolower;
uint16 sort;
@ -66,7 +66,8 @@ typedef struct unicase_info_st {
#define MY_CHARSET_CURRENT (default_charset_info->number)
typedef struct my_uni_idx_st {
typedef struct my_uni_idx_st
{
uint16 from;
uint16 to;
uchar *tab;
@ -136,18 +137,27 @@ typedef struct charset_info_st
char max_sort_char; /* For LIKE optimization */
/* Charset dependant snprintf() */
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix, long int val);
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, int radix, longlong val);
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
...);
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
long int val);
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
int radix, longlong val);
/* String-to-number convertion routines */
long (*strntol)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, int *err);
long (*strntol)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
int *err);
ulong (*scan)(struct charset_info_st *, const char *b, const char *e, int sq);
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
int sq);
} CHARSET_INFO;
@ -162,8 +172,10 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
/* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, const uchar *, uint);
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint);
extern uint my_hash_caseup_simple(CHARSET_INFO *cs,
const byte *key, uint len);
@ -181,36 +193,45 @@ extern void my_casedn_8bit(CHARSET_INFO *, char *, uint);
extern void my_tosort_8bit(CHARSET_INFO *, char *, uint);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, uint);
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *,
uint);
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
const char *fmt, ...);
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e, int *err);
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
int *err);
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, long int val);
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, longlong val);
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
long int val);
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
longlong val);
my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
int escape, int w_one, int w_many,
uint res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
const char *ptr, uint ptr_length,
int escape, int w_one, int w_many,
uint res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
int my_wildcmp_8bit(CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
#ifdef USE_MB
@ -220,15 +241,14 @@ extern void my_casedn_str_mb(CHARSET_INFO *, char *);
extern void my_caseup_mb(CHARSET_INFO *, char *, uint);
extern void my_casedn_mb(CHARSET_INFO *, char *, uint);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t, uint);
extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t,
uint);
int my_wildcmp_mb(CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
#endif
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
#define _NMR 04 /* Numeral (digit) */

View file

@ -43,6 +43,13 @@ typedef struct st_HA_KEYSEG /* Key-portion */
{ length=mi_uint2korr((key)+1); (key)+=3; } \
}
#define get_key_length_rdonly(length,key) \
{ if ((uchar) *(key) != 255) \
length= ((uint) (uchar) *((key))); \
else \
{ length=mi_uint2korr((key)+1); } \
}
#define get_key_pack_length(length,length_pack,key) \
{ if ((uchar) *(key) != 255) \
{ length= (uint) (uchar) *((key)++); length_pack=1; }\

View file

@ -32,8 +32,8 @@ extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,uint free_data);
extern uint list_length(LIST *list);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *list);
extern int list_walk(LIST *list,list_walk_action action,gptr argument);
#define rest(a) ((a)->next)

View file

@ -342,6 +342,12 @@ typedef struct st_mi_check_param
char *op_name;
} MI_CHECK;
typedef struct st_sort_ft_buf
{
uchar *buf, *end;
int count;
uchar lastkey[MI_MAX_KEY_BUFF];
} SORT_FT_BUF;
typedef struct st_sort_info
{
@ -354,7 +360,8 @@ typedef struct st_sort_info
MI_CHECK *param;
char *buff;
SORT_KEY_BLOCKS *key_block,*key_block_end;
/* sync things*/
SORT_FT_BUF *ft_buf;
/* sync things */
uint got_error, threads_running;
pthread_mutex_t mutex;
pthread_cond_t cond;

View file

@ -473,17 +473,17 @@ enum PREP_STMT_STATE { MY_ST_UNKNOWN, MY_ST_PREPARE, MY_ST_EXECUTE };
/* bind structure */
typedef struct st_mysql_bind
{
long *length; /* output length pointer */
gptr buffer; /* buffer */
unsigned long *length; /* output length pointer */
my_bool *is_null; /* Pointer to null indicators */
char *buffer; /* buffer to get/put data */
enum enum_field_types buffer_type; /* buffer type */
my_bool is_null; /* NULL indicator */
my_bool is_long_data; /* long data indicator */
/* Must be set for string/blob data */
unsigned long buffer_length; /* buffer length */
/* The following are for internal use. Set by mysql_bind_param */
unsigned long buffer_length; /* buffer length */
long bind_length; /* Default length of data */
my_bool long_ended; /* All data supplied for long */
unsigned long bind_length; /* Default length of data */
unsigned int param_number; /* For null count and error messages */
my_bool long_data_used; /* If used with mysql_send_long_data */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
} MYSQL_BIND;
@ -499,20 +499,21 @@ typedef struct st_mysql_stmt
MYSQL_FIELD *fields; /* prepare meta info */
LIST list; /* list to keep track of all stmts */
char *query; /* query buffer */
char *buffer; /* buffer to hold results */
MEM_ROOT mem_root; /* root allocations */
MYSQL_RES tmp_result; /* Used by mysql_prepare_result */
unsigned long param_count; /* parameters count */
unsigned long field_count; /* fields count */
unsigned long long_length; /* long buffer alloced length */
unsigned long buffer_length; /* long buffer alloced length */
unsigned long stmt_id; /* Id for prepared statement */
unsigned int last_errno; /* error code */
enum PREP_STMT_STATE state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
my_bool long_alloced; /* flag to indicate long alloced */
my_bool send_types_to_server; /* to indicate types supply to server */
my_bool param_buffers; /* to indicate the param bound buffers */
my_bool res_buffers; /* to indicate the output bound buffers */
my_bool result_buffered; /* to indicate the results buffered */
my_bool send_types_to_server; /* Types sent to server */
my_bool param_buffers; /* param bound buffers */
my_bool res_buffers; /* output bound buffers */
my_bool result_buffered; /* Results buffered */
} MYSQL_STMT;
@ -532,10 +533,7 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt);
my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
unsigned int param_number,
const char *data,
unsigned long length,
my_bool last_data);
int STDCALL mysql_multi_query(MYSQL *mysql,const char *query,
unsigned long len);
unsigned long length);
MYSQL_RES *STDCALL mysql_prepare_result(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
@ -549,8 +547,6 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql);
#define MYSQL_STATUS_ERROR 1
#define MYSQL_NO_DATA 100
#define MYSQL_NEED_DATA 99
#define MYSQL_NULL_DATA (-1)
#define MYSQL_LONG_DATA (-2)
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)

View file

@ -216,6 +216,7 @@ enum SSL_type
SSL_TYPE_SPECIFIED
};
#ifndef EMBEDDED_LIBRARY
/* This structure is for every connection on both sides */
struct st_vio
@ -233,7 +234,7 @@ struct st_vio
void (*viodelete)(Vio*);
int (*vioerrno)(Vio*);
int (*read)(Vio*, gptr, int);
int (*write)(Vio*, gptr, int);
int (*write)(Vio*, const gptr, int);
int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);

View file

@ -2181,6 +2181,7 @@ dict_skip_word(
/*************************************************************************
Returns the number of opening brackets '(' subtracted by the number
of closing brackets ')' between string and ptr. */
#ifdef NOT_USED
static
int
dict_bracket_count(
@ -2204,7 +2205,7 @@ dict_bracket_count(
return(count);
}
#endif
/*************************************************************************
Scans a table create SQL string and adds to the data dictionary the foreign
key constraints declared in the string. This function should be called after

View file

@ -456,7 +456,7 @@ dict_load_indexes(
ut_ad(len == 8);
id = mach_read_from_8(field);
ut_a(0 == ut_strcmp("NAME",
ut_a(0 == ut_strcmp((void*) "NAME",
dict_field_get_col(
dict_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 4))->name));
@ -515,7 +515,7 @@ dict_load_indexes(
&& ((type & DICT_CLUSTERED)
|| ((table == dict_sys->sys_tables)
&& (name_len == ut_strlen("ID_IND"))
&& (0 == ut_memcmp(name_buf, "ID_IND",
&& (0 == ut_memcmp(name_buf, (void*) "ID_IND",
name_len))))) {
/* The index was created in memory already in

View file

@ -16,7 +16,7 @@ typedef void* os_process_t;
typedef unsigned long int os_process_id_t;
/* The cell type in os_awe_allocate_mem page info */
#ifdef __NT__
#if defined(__NT__) && defined(ULONG_PTR)
typedef ULONG_PTR os_awe_t;
#else
typedef ulint os_awe_t;

View file

@ -189,12 +189,12 @@ os_awe_allocate_physical_mem(
#elif defined(__NT__)
BOOL bResult;
ULONG_PTR NumberOfPages; /* Question: why does Windows
os_awe_t NumberOfPages; /* Question: why does Windows
use the name ULONG_PTR for
a scalar integer type? Maybe
because we may also refer to
&NumberOfPages? */
ULONG_PTR NumberOfPagesInitial;
os_awe_t NumberOfPagesInitial;
SYSTEM_INFO sSysInfo;
int PFNArraySize;
@ -224,9 +224,9 @@ os_awe_allocate_physical_mem(
/* Calculate the size of page_info for allocated physical pages */
PFNArraySize = NumberOfPages * sizeof(ULONG_PTR);
PFNArraySize = NumberOfPages * sizeof(os_awe_t);
*page_info = (ULONG_PTR*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
*page_info = (os_awe_t*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
if (*page_info == NULL) {
fprintf(stderr,
@ -426,9 +426,9 @@ os_awe_map_physical_mem_to_window(
#elif defined(__NT__)
BOOL bResult;
ULONG_PTR n_pages;
os_awe_t n_pages;
n_pages = (ULONG_PTR)n_mem_pages;
n_pages = (os_awe_t)n_mem_pages;
if (!(ptr >= os_awe_window)) {
fprintf(stderr,

View file

@ -13,6 +13,7 @@ Created 5/11/1994 Heikki Tuuri
#endif
#include <stdarg.h>
#include <string.h>
#include "ut0sort.h"

View file

@ -46,22 +46,6 @@
#define OLD_EXT ".OLD"
#define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE
#ifdef __WIN__
static double ulonglong2double(ulonglong value)
{
longlong nr=(longlong) value;
if (nr >= 0)
return (double) nr;
return (18446744073709551616.0 + (double) nr);
}
#if SIZEOF_OFF_T > 4
#define my_off_t2double(A) ulonglong2double(A)
#else
#define my_off_t2double(A) ((double) (A))
#endif /* SIZEOF_OFF_T > 4 */
#endif
struct st_file_buffer {
File file;
char *buffer,*pos,*end;

View file

@ -452,14 +452,16 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
unique_part is uniquel value for each object (events and file-mapping)
number_of_connection is number of connection between server and client
*/
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,"_",NullS);
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
"_",NullS);
strmov(suffix_pos, "DATA");
if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL)
{
error_allow = CR_SHARED_MEMORY_FILE_MAP_ERROR;
goto err2;
}
if ((handle_map = MapViewOfFile(handle_file_map,FILE_MAP_WRITE,0,0,smem_buffer_length)) == NULL)
if ((handle_map = MapViewOfFile(handle_file_map,FILE_MAP_WRITE,0,0,
smem_buffer_length)) == NULL)
{
error_allow = CR_SHARED_MEMORY_MAP_ERROR;
goto err2;
@ -2330,8 +2332,8 @@ Try also with PIPE or TCP/IP
/* Create password to decode scramble */
create_key_from_old_password(passwd,password_hash);
/* Decypt and store scramble 4 = hash for stage2 */
password_crypt(net->read_pos+4,mysql->scramble_buff,password_hash,
SCRAMBLE41_LENGTH);
password_crypt((const char*) net->read_pos+4,mysql->scramble_buff,
password_hash, SCRAMBLE41_LENGTH);
mysql->scramble_buff[SCRAMBLE41_LENGTH]=0;
/* Finally scramble decoded scramble with password */
scramble(buff, mysql->scramble_buff, passwd,0);
@ -4088,37 +4090,33 @@ static void store_param_null(NET *net, MYSQL_BIND *param)
client application
*/
static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
{
MYSQL *mysql= stmt->mysql;
NET *net = &mysql->net;
DBUG_ENTER("store_param");
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %d", param->buffer_type,
param->buffer ? param->buffer : "0", *param->length));
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d",
param->buffer_type,
param->buffer ? param->buffer : "0", *param->length,
*param->is_null));
if (param->buffer_type == MYSQL_TYPE_NULL ||
*param->length == MYSQL_NULL_DATA)
if (*param->is_null)
store_param_null(net, param);
else
{
unsigned int length;
/*
Allocate for worst case (long string), ignore the length
buffer for numeric/double types by assigning the default
length using get_binary_length
*/
if (!(length= get_binary_length(param->buffer_type)))
length= *param->length;
if ((my_realloc_str(net, 9 + length)))
Param->length should ALWAYS point to the correct length for the type
Either to the length pointer given by the user or param->bind_length
*/
if ((my_realloc_str(net, 9 + *param->length)))
DBUG_RETURN(1);
(*param->store_param_func)(net, param);
}
DBUG_RETURN(0);
}
/*
Send the prepare query to server for execution
*/
@ -4200,14 +4198,11 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt)
for (param= stmt->params; param < param_end; param++)
{
/* Check for long data which has not been propery given/terminated */
if (*param->length == MYSQL_LONG_DATA)
{
if (!param->long_ended)
DBUG_RETURN(MYSQL_NEED_DATA);
}
/* check if mysql_long_data() was used */
if (param->long_data_used)
param->long_data_used= 0; /* Clear for next execute call */
else if (store_param(stmt, param))
DBUG_RETURN(1);
DBUG_RETURN(1);
}
length= (ulong) (net->write_pos - net->buff);
/* TODO: Look into avoding the following memdup */
@ -4245,6 +4240,11 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt)
return stmt->mysql->last_used_con->affected_rows;
}
static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */
static my_bool int_is_null_false= 0;
static my_bool int_is_null_dummy;
/*
Setup the parameter data buffers from application
*/
@ -4277,19 +4277,6 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
param++)
{
param->param_number= count++;
if (param->length && *param->length == MYSQL_LONG_DATA &&
(param->buffer_type < MYSQL_TYPE_TINY_BLOB ||
param->buffer_type > MYSQL_TYPE_STRING))
{
/*
Long data handling should be used only for string/binary
types only
*/
sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
param->param_number);
DBUG_RETURN(1);
}
/*
If param->length is not given, change it to point to bind_length.
This way we can always use *param->length to get the length of data
@ -4297,33 +4284,44 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
if (!param->length)
param->length= &param->bind_length;
/* If param->is_null is not set, then the value can never be NULL */
if (!param->is_null)
param->is_null= &int_is_null_false;
/* Setup data copy functions for the different supported types */
switch (param->buffer_type) {
case MYSQL_TYPE_NULL:
param->bind_length= MYSQL_NULL_DATA;
param->is_null= &int_is_null_true;
break;
case MYSQL_TYPE_TINY:
param->bind_length= 1;
/* Force param->length as this is fixed for this type */
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 1;
param->store_param_func= store_param_tinyint;
break;
case MYSQL_TYPE_SHORT:
param->bind_length= 2;
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 2;
param->store_param_func= store_param_short;
break;
case MYSQL_TYPE_LONG:
param->bind_length= 4;
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 4;
param->store_param_func= store_param_int32;
break;
case MYSQL_TYPE_LONGLONG:
param->bind_length= 8;
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 8;
param->store_param_func= store_param_int64;
break;
case MYSQL_TYPE_FLOAT:
param->bind_length= 4;
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 4;
param->store_param_func= store_param_float;
break;
case MYSQL_TYPE_DOUBLE:
param->bind_length= 8;
param->length= &param->bind_length;
param->bind_length= param->buffer_length= 8;
param->store_param_func= store_param_double;
break;
case MYSQL_TYPE_TINY_BLOB:
@ -4336,7 +4334,8 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
param->store_param_func= store_param_str;
break;
default:
sprintf(stmt->last_error, ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
sprintf(stmt->last_error,
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
param->buffer_type, param->param_number);
DBUG_RETURN(1);
}
@ -4361,18 +4360,16 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
param_number Parameter number (0 - N-1)
data Data to send to server
length Length of data to send (may be 0)
last_data If != 0 then this is the last data to the
server.
RETURN VALUES
0 ok
1 error
0 ok
1 error
*/
my_bool STDCALL
mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
const char *data, ulong length,
my_bool last_data)
const char *data, ulong length)
{
MYSQL_BIND *param;
DBUG_ENTER("mysql_send_long_data");
@ -4386,6 +4383,19 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
DBUG_RETURN(1);
}
param= stmt->params+param_number;
if (param->buffer_type < MYSQL_TYPE_TINY_BLOB ||
param->buffer_type > MYSQL_TYPE_STRING)
{
/*
Long data handling should be used only for string/binary
types only
*/
sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
param->param_number);
DBUG_RETURN(1);
}
/* Mark for execute that the result is already sent */
param->long_data_used= 1;
if (length)
{
MYSQL *mysql= stmt->mysql;
@ -4407,7 +4417,6 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
DBUG_RETURN(1);
}
}
param->long_ended= last_data;
DBUG_RETURN(0);
}
@ -4582,6 +4591,7 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length)
}
}
/* Fetch data to buffers */
static my_bool fetch_results(MYSQL_STMT *stmt, MYSQL_BIND *param,
uint field_type, uchar **row)
@ -4645,7 +4655,7 @@ static my_bool fetch_results(MYSQL_STMT *stmt, MYSQL_BIND *param,
break;
}
if (param->buffer_type < MYSQL_TYPE_VAR_STRING ||
param->buffer_type > MYSQL_TYPE_STRING)
param->buffer_type > MYSQL_TYPE_STRING)
{
/*
Don't allow fetching of date/time/ts to non-string types
@ -4829,6 +4839,13 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
for (param= stmt->bind, end= param+bind_count; param < end ; param++)
{
/*
Set param->is_null to point to a dummy variable if it's not set.
This is to make the excute code easier
*/
if (!param->is_null)
param->is_null= &int_is_null_dummy;
/* Setup data copy functions for the different supported types */
switch (param->buffer_type) {
case MYSQL_TYPE_TINY:
@ -4855,10 +4872,12 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
DBUG_ASSERT(param->buffer_length != 0);
param->fetch_result= fetch_result_str;
break;
default:
sprintf(stmt->last_error, ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
sprintf(stmt->last_error,
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
param->buffer_type, param->param_number);
DBUG_RETURN(1);
}
@ -4884,8 +4903,8 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
return 0;
null_ptr= row;
row+= (stmt->field_count+9)/8; /* skip null bits */
bit= 4; /* first 2 bits are reserved */
row+= (stmt->field_count+9)/8; /* skip null bits */
bit= 4; /* first 2 bits are reserved */
/* Copy complete row to application buffers */
for (bind= stmt->bind, end= (MYSQL_BIND *) bind + stmt->field_count,
@ -4895,15 +4914,16 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
bind++, field++)
{
if (*null_ptr & bit)
*bind->length= MYSQL_NULL_DATA;
*bind->is_null= 1;
else
{
*bind->is_null= 0;
if (field->type == bind->buffer_type)
(*bind->fetch_result)(bind, &row);
else if (fetch_results(stmt, bind, field->type, &row))
return 1;
}
if (! (bit<<=1) & 255)
if (! ((bit<<=1) & 255))
{
bit= 1; /* To next byte */
null_ptr++;

View file

@ -107,7 +107,6 @@ EXPORTS
getopt_ull_limit_value
getopt_compare_strings
mysql_warning_count
mysql_warnings
mysql_prepare
mysql_execute
mysql_param_count
@ -119,7 +118,6 @@ EXPORTS
mysql_stmt_errno
mysql_fetch
mysql_send_long_data
mysql_multi_query
mysql_next_result
mysql_commit
mysql_rollback

View file

@ -88,7 +88,6 @@ void THD::clear_error()
static bool check_user(THD *thd,enum_server_command command, const char *user,
const char *passwd, const char *db, bool check_count)
{
USER_RESOURCES ur;
thd->db=0;
if (!(thd->user = my_strdup(user, MYF(0))))

View file

@ -21,6 +21,7 @@
#define FT_CORE
#include "ftdefs.h"
#include <queues.h>
#include <assert.h> /* for DBUG_ASSERT() */
/* search with boolean queries */
@ -63,42 +64,44 @@ struct st_ftb_expr
{
FTB_EXPR *up;
byte *quot, *qend;
float weight;
uint flags;
my_off_t docid[2]; /* for index search and for scan */
float weight;
float cur_weight;
int yesses; /* number of "yes" words matched */
int nos; /* number of "no" words matched */
int ythresh; /* number of "yes" words in expr */
int yweaks; /* number of "yes" words for scan only */
uint flags;
uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */
uint ythresh; /* number of "yes" words in expr */
uint yweaks; /* number of "yes" words for scan only */
};
typedef struct st_ftb_word
{
FTB_EXPR *up;
float weight;
uint flags;
my_off_t docid[2]; /* for index search and for scan */
uint ndepth;
int len;
/* ... docid cache can be added here. SerG */
byte word[1];
FTB_EXPR *up;
MI_KEYDEF *keyinfo;
my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root;
float weight;
uint ndepth;
uint flags;
uint len;
uchar off;
byte word[1];
} FTB_WORD;
typedef struct st_ft_info
{
struct _ft_vft *please;
MI_INFO *info;
uint keynr;
CHARSET_INFO *charset;
enum { UNINITIALIZED, READY, INDEX_SEARCH, INDEX_DONE /*, SCAN*/ } state;
uint with_scan;
my_off_t lastpos;
FTB_EXPR *root;
QUEUE queue;
TREE no_dupes;
FTB_WORD **list;
MEM_ROOT mem_root;
QUEUE queue;
TREE no_dupes;
my_off_t lastpos;
uint keynr;
uchar with_scan;
enum { UNINITIALIZED, READY, INDEX_SEARCH, INDEX_DONE } state;
} FTB;
static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b)
@ -160,6 +163,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw->up=up;
ftbw->docid[0]=ftbw->docid[1]=HA_POS_ERROR;
ftbw->ndepth= (param.yesno<0) + depth;
ftbw->key_root=HA_POS_ERROR;
memcpy(ftbw->word+1, w.pos, w.len);
ftbw->word[0]=w.len;
if (param.yesno > 0) up->ythresh++;
@ -194,22 +198,98 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
}
/* returns 1 if the search was finished (must-word wasn't found) */
static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
{
int r;
uint off;
int subkeys;
MI_INFO *info=ftb->info;
if (init_search)
{
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_BIGGER, ftbw->key_root);
}
else
{
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word+ftbw->off,
USE_WHOLE_KEY, SEARCH_BIGGER, ftbw->key_root);
}
if (!r && !ftbw->off)
{
r= mi_compare_text(ftb->charset,
info->lastkey + (ftbw->flags & FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
(uchar*) ftbw->word + (ftbw->flags & FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
0);
}
if (r) /* not found */
{
if (!ftbw->off || !(ftbw->flags & FTB_FLAG_TRUNC))
{
ftbw->docid[0]=HA_POS_ERROR;
if ((ftbw->flags & FTB_FLAG_YES) && ftbw->up->up==0)
{
/*
This word MUST BE present in every document returned,
so we can stop the search right now
*/
ftb->state=INDEX_DONE;
return 1; /* search is done */
}
else
return 0;
}
/* going up to the first-level tree to continue search there */
_mi_dpointer(info, ftbw->word+ftbw->off+HA_FT_WLEN, ftbw->key_root);
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
return _ft2_search(ftb, ftbw, 0);
}
/* matching key found */
memcpy(ftbw->word+ftbw->off, info->lastkey, info->lastkey_length);
if (!ftbw->off && (init_search || (ftbw->flags & FTB_FLAG_TRUNC)))
{
/* going down ? */
get_key_full_length_rdonly(off, info->lastkey);
subkeys=ft_sintXkorr(info->lastkey+off);
if (subkeys<0)
{
/* yep, going down, to the second-level tree */
/* TODO here: subkey-based optimization */
ftbw->off=off;
ftbw->key_root=info->lastpos;
ftbw->keyinfo=& info->s->ft2_keyinfo;
r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
DBUG_ASSERT(r==0); /* found something */
memcpy(ftbw->word+off, info->lastkey, info->lastkey_length);
}
}
ftbw->docid[0]=info->lastpos;
return 0;
}
static void _ftb_init_index_search(FT_INFO *ftb)
{
int i, r;
int i;
FTB_WORD *ftbw;
MI_INFO *info=ftb->info;
MI_KEYDEF *keyinfo;
my_off_t keyroot;
if ((ftb->state != READY && ftb->state !=INDEX_DONE) ||
ftb->keynr == NO_SUCH_KEY)
return;
ftb->state=INDEX_SEARCH;
keyinfo=info->s->keyinfo+ftb->keynr;
keyroot=info->s->state.key_root[ftb->keynr];
for (i=ftb->queue.elements; i; i--)
{
ftbw=(FTB_WORD *)(ftb->queue.root[i]);
@ -248,34 +328,9 @@ static void _ftb_init_index_search(FT_INFO *ftb)
}
}
}
r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_BIGGER, keyroot);
if (!r)
{
r= mi_compare_text(ftb->charset,
info->lastkey + (ftbw->flags&FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags&FTB_FLAG_TRUNC),
(uchar*) ftbw->word + (ftbw->flags&FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags&FTB_FLAG_TRUNC),
0);
}
if (r) /* not found */
{
if (ftbw->flags&FTB_FLAG_YES && ftbw->up->up==0)
{
/*
This word MUST BE present in every document returned,
so we can abort the search right now
*/
ftb->state=INDEX_DONE;
return;
}
}
else
{
memcpy(ftbw->word, info->lastkey, info->lastkey_length);
ftbw->docid[0]=info->lastpos;
}
if (_ft2_search(ftb, ftbw, 1))
return;
}
queue_fix(& ftb->queue);
}
@ -436,10 +491,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
FTB_EXPR *ftbe;
FTB_WORD *ftbw;
MI_INFO *info=ftb->info;
MI_KEYDEF *keyinfo=info->s->keyinfo+ftb->keynr;
my_off_t keyroot=info->s->state.key_root[ftb->keynr];
my_off_t curdoc;
int r;
if (ftb->state != INDEX_SEARCH && ftb->state != INDEX_DONE)
return -1;
@ -466,34 +518,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
_ftb_climb_the_tree(ftb, ftbw, 0);
/* update queue */
r=_mi_search(info, keyinfo, (uchar*) ftbw->word, USE_WHOLE_KEY,
SEARCH_BIGGER , keyroot);
if (!r)
{
r= mi_compare_text(ftb->charset,
info->lastkey + (ftbw->flags&FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags&FTB_FLAG_TRUNC),
(uchar*) ftbw->word + (ftbw->flags&FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags&FTB_FLAG_TRUNC),
0);
}
if (r) /* not found */
{
ftbw->docid[0]=HA_POS_ERROR;
if (ftbw->flags&FTB_FLAG_YES && ftbw->up->up==0)
{
/*
This word MUST BE present in every document returned,
so we can stop the search right now
*/
ftb->state=INDEX_DONE;
}
}
else
{
memcpy(ftbw->word, info->lastkey, info->lastkey_length);
ftbw->docid[0]=info->lastpos;
}
_ft2_search(ftb, ftbw, 0);
queue_replaced(& ftb->queue);
}
@ -505,7 +530,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
if (is_tree_inited(&ftb->no_dupes) &&
tree_insert(&ftb->no_dupes, &curdoc, 0,
ftb->no_dupes.custom_arg)->count >1)
/* but it managed to get past this line once */
/* but it managed already to get past this line once */
continue;
info->lastpos=curdoc;

View file

@ -56,7 +56,7 @@ static struct my_option my_long_options[] =
int main(int argc,char *argv[])
{
int error=0;
int error=0, subkeys;
uint keylen, keylen2=0, inx, doc_cnt=0;
float weight;
double gws, min_gws=0, avg_gws=0;
@ -125,7 +125,9 @@ int main(int argc,char *argv[])
keylen=*(info->lastkey);
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
mi_float4get(weight,info->lastkey+keylen+1);
subkeys=mi_sint4korr(info->lastkey+keylen+1);
if (subkeys >= 0)
weight=*(float*)&subkeys;
#else
#error
#endif
@ -164,7 +166,10 @@ int main(int argc,char *argv[])
}
}
if (dump)
printf("%9qx %20.7f %s\n",info->lastpos,weight,buf);
if (subkeys>=0)
printf("%9qx %20.7f %s\n",info->lastpos,weight,buf);
else
printf("%9qx => %17d %s\n",info->lastpos,-subkeys,buf);
if(verbose && (total%HOW_OFTEN_TO_WRITE)==0)
printf("%10ld\r",total);

View file

@ -42,8 +42,6 @@ typedef struct st_all_in_one
uint keynr;
CHARSET_INFO *charset;
uchar *keybuff;
MI_KEYDEF *keyinfo;
my_off_t key_root;
TREE dtree;
} ALL_IN_ONE;
@ -66,13 +64,14 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
{
int subkeys;
uint keylen, r, doc_cnt;
#ifdef EVAL_RUN
uint cnt;
double sum, sum2, suml;
#endif /* EVAL_RUN */
FT_SUPERDOC sdoc, *sptr;
TREE_ELEMENT *selem;
MI_INFO *info=aio->info;
uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr];
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight;
#else
@ -83,45 +82,45 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
word->weight=LWS_FOR_QUERY;
keylen=_ft_make_key(aio->info,aio->keynr,(char*) aio->keybuff,word,0);
#ifdef EVAL_RUN
keylen-=1+HA_FT_WLEN;
#else /* EVAL_RUN */
keylen=_ft_make_key(info,aio->keynr,(char*) keybuff,word,0);
keylen-=HA_FT_WLEN;
#endif /* EVAL_RUN */
#ifdef EVAL_RUN
sum=sum2=suml=
#endif /* EVAL_RUN */
doc_cnt=0;
r=_mi_search(aio->info, aio->keyinfo, aio->keybuff, keylen,
SEARCH_FIND | SEARCH_PREFIX, aio->key_root);
aio->info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */
r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root);
info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */
while (!r)
{
if (mi_compare_text(aio->charset,
aio->info->lastkey,keylen,
aio->keybuff,keylen,0))
if (keylen &&
mi_compare_text(aio->charset,info->lastkey,keylen, keybuff,keylen,0))
break;
subkeys=ft_sintXkorr(info->lastkey+keylen);
if (subkeys<0)
{
if (doc_cnt)
DBUG_RETURN(1); /* index is corrupted */
/*
TODO here: unsafe optimization, should this word
be skipped (based on subkeys) ?
*/
keybuff+=keylen;
keyinfo=& info->s->ft2_keyinfo;
key_root=info->lastpos;
keylen=0;
r=_mi_search_first(info, keyinfo, key_root);
continue;
}
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
#ifdef EVAL_RUN
mi_float4get(tmp_weight,aio->info->lastkey+keylen+1);
#else /* EVAL_RUN */
mi_float4get(tmp_weight,aio->info->lastkey+keylen);
#endif /* EVAL_RUN */
tmp_weight=*(float*)&subkeys;
#else
#error
#endif
if(tmp_weight==0) DBUG_RETURN(doc_cnt); /* stopword, doc_cnt should be 0 */
if (tmp_weight==0)
DBUG_RETURN(doc_cnt); /* stopword, doc_cnt should be 0 */
#ifdef EVAL_RUN
cnt=*(byte *)(aio->info->lastkey+keylen);
#endif /* EVAL_RUN */
sdoc.doc.dpos=aio->info->lastpos;
sdoc.doc.dpos=info->lastpos;
/* saving document matched into dtree */
if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg)))
@ -138,20 +137,13 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
sptr->tmp_weight=tmp_weight;
doc_cnt++;
#ifdef EVAL_RUN
sum +=cnt;
sum2+=cnt*cnt;
suml+=cnt*log(cnt);
#endif /* EVAL_RUN */
if (_mi_test_if_changed(aio->info) == 0)
r=_mi_search_next(aio->info, aio->keyinfo, aio->info->lastkey,
aio->info->lastkey_length, SEARCH_BIGGER,
aio->key_root);
if (_mi_test_if_changed(info) == 0)
r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length,
SEARCH_BIGGER, key_root);
else
r=_mi_search(aio->info, aio->keyinfo, aio->info->lastkey,
aio->info->lastkey_length, SEARCH_BIGGER,
aio->key_root);
r=_mi_search(info, keyinfo, info->lastkey, info->lastkey_length,
SEARCH_BIGGER, key_root);
}
if (doc_cnt)
{
@ -201,10 +193,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
aio.info=info;
aio.keynr=keynr;
aio.keyinfo=info->s->keyinfo+keynr;
aio.charset=aio.keyinfo->seg->charset;
aio.charset=info->s->keyinfo[keynr].seg->charset;
aio.keybuff=info->lastkey+info->s->base.max_key_length;
aio.key_root=info->s->state.key_root[keynr];
bzero(&allocated_wtree,sizeof(allocated_wtree));

View file

@ -18,21 +18,10 @@
#include "ftdefs.h"
#ifdef EVAL_RUN
#ifdef PIVOT_STAT
ulong collstat=0;
#endif
#endif /* EVAL_RUN */
typedef struct st_ft_docstat {
FT_WORD *list;
uint uniq;
double sum;
#ifdef EVAL_RUN
uint words, totlen;
double max, nsum, nsum2;
#endif /* EVAL_RUN */
} FT_DOCSTAT;
static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2)
@ -44,15 +33,7 @@ static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2)
static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word->weight=LWS_IN_USE;
#ifdef EVAL_RUN
word->cnt= (uchar) count;
if(docstat->max < word->weight) docstat->max=word->weight;
docstat->words+=count;
docstat->totlen+=word->len;
#endif /* EVAL_RUN */
docstat->sum+=word->weight;
memcpy_fixed((docstat->list)++,word,sizeof(FT_WORD));
return 0;
}
@ -70,9 +51,6 @@ FT_WORD * ft_linearize(TREE *wtree)
{
docstat.list=wlist;
docstat.uniq=wtree->elements_in_tree;
#ifdef EVAL_RUN
docstat.nsum=docstat.nsum2=docstat.max=docstat.words=docstat.totlen=
#endif /* EVAL_RUN */
docstat.sum=0;
tree_walk(wtree,(tree_walk_action)&walk_and_copy,&docstat,left_root_right);
}
@ -85,18 +63,8 @@ FT_WORD * ft_linearize(TREE *wtree)
for (p=wlist;p->pos;p++)
{
p->weight=PRENORM_IN_USE;
#ifdef EVAL_RUN
docstat.nsum+=p->weight;
docstat.nsum2+=p->weight*p->weight;
#endif /* EVAL_RUN */
}
#ifdef EVAL_RUN
#ifdef PIVOT_STAT
collstat+=PIVOT_STAT;
#endif
#endif /* EVAL_RUN */
for (p=wlist;p->pos;p++)
{
p->weight/=NORM_IN_USE;

View file

@ -26,25 +26,21 @@ const char *ft_boolean_syntax="+ -><()~*:\"\"&|";
const HA_KEYSEG ft_keysegs[FT_SEGS]={
{
HA_KEYTYPE_VARTEXT, /* type */
7, /* language (will be overwritten) */
63, /* language (will be overwritten) */
0, 0, 0, /* null_bit, bit_start, bit_end */
HA_VAR_LENGTH | HA_PACK_KEY, /* flag */
HA_FT_MAXLEN, /* length */
#ifdef EVAL_RUN
HA_FT_WLEN+1, /* start */
#else /* EVAL_RUN */
HA_FT_WLEN, /* start */
#endif /* EVAL_RUN */
0, /* null_pos */
NULL /* charset */
},
#ifdef EVAL_RUN
{
HA_KEYTYPE_INT8, 7, 0, 0, 0, 0, 1, HA_FT_WLEN, 0, NULL
},
#endif /* EVAL_RUN */
{
HA_FT_WTYPE, 7, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 0, 0, NULL
/*
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
}
};

View file

@ -31,7 +31,7 @@
void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const byte *record,
FT_SEG_ITERATOR *ftsi)
{
ftsi->num=info->s->keyinfo[keynr].keysegs-FT_SEGS;
ftsi->num=info->s->keyinfo[keynr].keysegs;
ftsi->seg=info->s->keyinfo[keynr].seg;
ftsi->rec=record;
}
@ -113,7 +113,7 @@ FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr,
if (_mi_ft_parse(&ptree, info, keynr, record))
return NULL;
return ft_linearize(/*info, keynr, keybuf, */ &ptree);
return ft_linearize(&ptree);
}
static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf,
@ -267,13 +267,7 @@ uint _ft_make_key(MI_INFO *info, uint keynr, byte *keybuf, FT_WORD *wptr,
#error
#endif
#ifdef EVAL_RUN
*(buf+HA_FT_WLEN)=wptr->cnt;
int2store(buf+HA_FT_WLEN+1,wptr->len);
memcpy(buf+HA_FT_WLEN+3,wptr->pos,wptr->len);
#else /* EVAL_RUN */
int2store(buf+HA_FT_WLEN,wptr->len);
memcpy(buf+HA_FT_WLEN+2,wptr->pos,wptr->len);
#endif /* EVAL_RUN */
return _mi_make_key(info,keynr,(uchar*) keybuf,buf,filepos);
}

View file

@ -60,16 +60,6 @@
#define NORM_SUM (docstat.nsum)
#define NORM_COS (sqrt(docstat.nsum2))
#ifdef EVAL_RUN
/*
extern ulong collstat;
#define PIVOT_STAT (docstat.uniq)
#define PIVOT_SLOPE (0.69)
#define PIVOT_PIVOT ((double)collstat/(info->state->records+1))
#define NORM_PIVOT ((1-PIVOT_SLOPE)*PIVOT_PIVOT+PIVOT_SLOPE*docstat.uniq)
*/
#endif /* EVAL_RUN */
#define PIVOT_VAL (0.0115)
#define NORM_PIVOT (1+PIVOT_VAL*docstat.uniq)
/*---------------------------------------------------------------*/
@ -102,9 +92,6 @@ typedef struct st_ft_word {
byte * pos;
uint len;
double weight;
#ifdef EVAL_RUN
byte cnt;
#endif /* EVAL_RUN */
} FT_WORD;
typedef struct st_ftb_param {

View file

@ -21,19 +21,16 @@
#include "myisamdef.h"
#include "ft_global.h"
/* shoudn't be def'ed when linking with mysql */
#undef EVAL_RUN
#define HA_FT_WTYPE HA_KEYTYPE_FLOAT
#define HA_FT_WLEN 4
#ifdef EVAL_RUN
#define FT_SEGS 3
#else /* EVAL_RUN */
#define FT_SEGS 2
#endif /* EVAL_RUN */
#define ft_sintXkorr(A) mi_sint4korr(A)
#define ft_intXstore(T,A) mi_int4store(T,A)
extern const HA_KEYSEG ft_keysegs[FT_SEGS];
int _mi_ft_cmp(MI_INFO *, uint, const byte *, const byte *);
int _mi_ft_add(MI_INFO *, uint, byte *, const byte *, my_off_t);
int _mi_ft_del(MI_INFO *, uint, byte *, const byte *, my_off_t);

View file

@ -49,10 +49,11 @@ static int sort_key_read(MI_SORT_PARAM *sort_param,void *key);
static int sort_ft_key_read(MI_SORT_PARAM *sort_param,void *key);
static int sort_get_next_record(MI_SORT_PARAM *sort_param);
static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a,const void *b);
static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a);
static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a);
static my_off_t get_record_for_key(MI_INFO *info,MI_KEYDEF *keyinfo,
uchar *key);
static int sort_insert_key(MI_SORT_PARAM *sort_param,
static int sort_insert_key(MI_SORT_PARAM *sort_param,
reg1 SORT_KEY_BLOCKS *key_block,
uchar *key, my_off_t prev_block);
static int sort_delete_record(MI_SORT_PARAM *sort_param);
@ -1875,7 +1876,6 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
((param->testflag & T_CREATE_MISSING_KEYS) ? info->state->records :
(ha_rows) (sort_info.filelength/length+1));
sort_param.key_cmp=sort_key_cmp;
sort_param.key_write=sort_key_write;
sort_param.lock_in_memory=lock_memory;
sort_param.tmpdir=param->tmpdir;
sort_param.sort_info=&sort_info;
@ -1928,10 +1928,14 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
(ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1);
sort_param.key_read=sort_ft_key_read;
sort_param.key_write=sort_ft_key_write;
sort_param.key_length+=ft_max_word_len_for_sort-HA_FT_MAXLEN;
}
else
{
sort_param.key_read=sort_key_read;
sort_param.key_write=sort_key_write;
}
if (_create_index_by_sort(&sort_param,
(my_bool) (!(param->testflag & T_VERBOSE)),
@ -1977,9 +1981,6 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
else
info->state->data_file_length=sort_param.max_pos;
/*if (flush_pending_blocks(param))
goto err;*/
param->read_cache.file=info->dfile; /* re-init read cache */
reinit_io_cache(&param->read_cache,READ_CACHE,share->pack.header_length,
1,1);
@ -2078,6 +2079,7 @@ err:
MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@ -2093,7 +2095,7 @@ err:
Threaded repair of table using sorting
SYNOPSIS
mi_repair_by_sort_r()
mi_repair_by_sort_parallel()
param Repair parameters
info MyISAM handler to repair
name Name of table (for warnings)
@ -2265,10 +2267,17 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
}
if ((!(param->testflag & T_SILENT)))
printf ("- Fixing index %d\n",key+1);
sort_param[i].key_read= ((sort_param[i].keyinfo->flag & HA_FULLTEXT) ?
sort_ft_key_read : sort_key_read);
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
{
sort_param[i].key_read=sort_ft_key_read;
sort_param[i].key_write=sort_ft_key_write;
}
else
{
sort_param[i].key_read=sort_key_read;
sort_param[i].key_write=sort_key_write;
}
sort_param[i].key_cmp=sort_key_cmp;
sort_param[i].key_write=sort_key_write;
sort_param[i].lock_in_memory=lock_memory;
sort_param[i].tmpdir=param->tmpdir;
sort_param[i].sort_info=&sort_info;
@ -2461,6 +2470,7 @@ err:
pthread_cond_destroy (&sort_info.cond);
pthread_mutex_destroy(&sort_info.mutex);
my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_param,MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
@ -3095,6 +3105,137 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
(uchar*) a, HA_OFFSET_ERROR));
} /* sort_key_write */
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param)
{
SORT_INFO *sort_info=sort_param->sort_info;
SORT_KEY_BLOCKS *key_block=sort_info->key_block;
MYISAM_SHARE *share=sort_info->info->s;
uint val_off, val_len, error;
SORT_FT_BUF *ft_buf=sort_info->ft_buf;
uchar *from, *to;
val_len=share->ft2_keyinfo.keylength;
get_key_full_length_rdonly(val_off, ft_buf->lastkey);
to=ft_buf->lastkey+val_off;
if (ft_buf->buf)
{ /* flushing first-level tree */
error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,HA_OFFSET_ERROR);
for (from=to+val_len;
!error && from < ft_buf->buf;
from+= val_len)
{
memcpy(to, from, val_len);
error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,HA_OFFSET_ERROR);
}
return error;
}
/* flushing second-level tree keyblocks */
error=flush_pending_blocks(sort_param);
/* updating lastkey with second-level tree info */
ft_intXstore(ft_buf->lastkey+val_off, -ft_buf->count);
_mi_dpointer(sort_info->info, ft_buf->lastkey+val_off+HA_FT_WLEN,
share->state.key_root[sort_param->key]);
/* restoring first level tree data in sort_info/sort_param */
sort_info->key_block=sort_info->key_block_end- sort_info->param->sort_key_blocks;
sort_param->keyinfo=share->keyinfo+sort_param->key;
share->state.key_root[sort_param->key]=HA_OFFSET_ERROR;
/* writing lastkey in first-level tree */
return error ? error :
sort_insert_key(sort_param,sort_info->key_block,
ft_buf->lastkey,HA_OFFSET_ERROR);
}
static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
uint a_len, val_off, val_len, error;
uchar *p;
SORT_INFO *sort_info=sort_param->sort_info;
SORT_FT_BUF *ft_buf=sort_info->ft_buf;
SORT_KEY_BLOCKS *key_block=sort_info->key_block;
val_len=HA_FT_WLEN+sort_info->info->s->base.rec_reflength;
get_key_full_length_rdonly(a_len, (uchar *)a);
if (!ft_buf)
{
/*
use two-level tree only if key_reflength fits in rec_reflength place
and row format is NOT static - for _mi_dpointer not to garble offsets
*/
if ((sort_info->info->s->base.key_reflength <=
sort_info->info->s->base.rec_reflength) &&
(sort_info->info->s->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
ft_buf=(SORT_FT_BUF *)my_malloc(sort_param->keyinfo->block_length +
sizeof(SORT_FT_BUF), MYF(MY_WME));
if (!ft_buf)
{
sort_param->key_write=sort_key_write;
return sort_key_write(sort_param, a);
}
sort_info->ft_buf=ft_buf;
goto word_init_ft_buf; /* no need to duplicate the code */
}
get_key_full_length_rdonly(val_off, ft_buf->lastkey);
if (val_off == a_len &&
mi_compare_text(sort_param->keyinfo->seg->charset,
((uchar *)a)+1,a_len-1,
ft_buf->lastkey+1,val_off-1, 0)==0)
{
if (!ft_buf->buf) /* store in second-level tree */
{
ft_buf->count++;
return sort_insert_key(sort_param,key_block,
((uchar *)a)+val_off, HA_OFFSET_ERROR);
}
/* storing the key in the buffer. */
memcpy (ft_buf->buf, a+val_off, val_len);
ft_buf->buf+=val_len;
if (ft_buf->buf < ft_buf->end)
return 0;
/* converting to two-level tree */
p=ft_buf->lastkey+val_off;
while (key_block->inited)
key_block++;
sort_info->key_block=key_block;
sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo;
ft_buf->count=(ft_buf->buf - p)/val_len;
/* flushing buffer to second-level tree */
for (error=0; !error && p < ft_buf->buf; p+= val_len)
error=sort_insert_key(sort_param,key_block,p,HA_OFFSET_ERROR);
ft_buf->buf=0;
return error;
}
else
{
/* flushing buffer */
if ((error=sort_ft_buf_flush(sort_param)))
return error;
word_init_ft_buf:
a_len+=val_len;
memcpy(ft_buf->lastkey, a, a_len);
ft_buf->buf=ft_buf->lastkey+a_len;
ft_buf->end=ft_buf->lastkey+ (sort_param->keyinfo->block_length-32);
/* 32 is just a safety margin here
(at least max(val_len, sizeof(nod_flag)) should be there).
May be better performance could be achieved if we'd put
(sort_info->keyinfo->block_length-32)/XXX
instead.
TODO: benchmark the best value for XXX.
*/
return 0;
}
return -1; /* impossible */
} /* sort_ft_key_write */
/* get pointer to record from a key */
@ -3254,7 +3395,7 @@ int flush_pending_blocks(MI_SORT_PARAM *sort_param)
my_off_t filepos,key_file_length;
SORT_KEY_BLOCKS *key_block;
SORT_INFO *sort_info= sort_param->sort_info;
MI_CHECK *param=sort_info->param;
myf myf_rw=sort_info->param->myf_rw;
MI_INFO *info=sort_info->info;
MI_KEYDEF *keyinfo=sort_param->keyinfo;
DBUG_ENTER("flush_pending_blocks");
@ -3279,7 +3420,7 @@ int flush_pending_blocks(MI_SORT_PARAM *sort_param)
DBUG_RETURN(1);
}
else if (my_pwrite(info->s->kfile,(byte*) key_block->buff,
(uint) keyinfo->block_length,filepos, param->myf_rw))
(uint) keyinfo->block_length,filepos, myf_rw))
DBUG_RETURN(1);
DBUG_DUMP("buff",(byte*) key_block->buff,length);
nod_flag=1;

View file

@ -44,7 +44,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
uint fields,length,max_key_length,packed,pointer,
key_length,info_length,key_segs,options,min_key_length_skipp,
base_pos,varchar_count,long_varchar_count,varchar_length,
max_key_block_length,unique_key_parts,offset;
max_key_block_length,unique_key_parts,fulltext_keys,offset;
ulong reclength, real_reclength,min_pack_length;
char filename[FN_REFLEN],linkname[FN_REFLEN], *linkname_ptr;
ulong pack_reclength;
@ -223,6 +223,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
reclength+=long_varchar_count; /* We need space for this! */
max_key_length=0; tot_length=0 ; key_segs=0;
fulltext_keys=0;
max_key_block_length=0;
share.state.rec_per_key_part=rec_per_key_part;
share.state.key_root=key_root;
@ -249,7 +250,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
{
/*
called by myisamchk - i.e. table structure was taken from
MYI file and SPATIAL key *do has* additional sp_segs keysegs.
MYI file and SPATIAL key *does have* additional sp_segs keysegs.
We'd better delete them now
*/
keydef->keysegs-=sp_segs;
@ -271,20 +272,11 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
min_key_length_skipp+=SPLEN*2*SPDIMS;
}
else
if (keydef->flag & HA_FULLTEXT) /* SerG */
if (keydef->flag & HA_FULLTEXT)
{
keydef->flag=HA_FULLTEXT | HA_PACK_KEY | HA_VAR_LENGTH_KEY;
options|=HA_OPTION_PACK_KEYS; /* Using packed keys */
if (flags & HA_DONT_TOUCH_DATA)
{
/* called by myisamchk - i.e. table structure was taken from
MYI file and FULLTEXT key *do has* additional FT_SEGS keysegs.
We'd better delete them now
*/
keydef->keysegs-=FT_SEGS;
}
for (j=0, keyseg=keydef->seg ; (int) j < keydef->keysegs ;
j++, keyseg++)
{
@ -295,19 +287,11 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
goto err;
}
}
keydef->keysegs+=FT_SEGS;
fulltext_keys++;
key_length+= HA_FT_MAXLEN+HA_FT_WLEN;
#ifdef EVAL_RUN
key_length++;
#endif
length++; /* At least one length byte */
min_key_length_skipp+=HA_FT_MAXLEN;
#if HA_FT_MAXLEN >= 255
min_key_length_skipp+=2; /* prefix may be 3 bytes */
length+=2;
#endif
}
else
{
@ -473,8 +457,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
mi_get_pointer_length((tot_length + max_key_block_length * keys *
MI_INDEX_BLOCK_MARGIN) / MI_MIN_KEY_BLOCK_LENGTH,
3);
share.base.keys= share.state.header.keys = keys;
share.base.keys= share.state.header.keys= keys;
share.state.header.uniques= uniques;
share.state.header.fulltext_keys= fulltext_keys;
mi_int2store(share.state.header.key_parts,key_segs);
mi_int2store(share.state.header.unique_key_parts,unique_key_parts);
@ -590,21 +575,13 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
/* Write key and keyseg definitions */
for (i=0 ; i < share.base.keys - uniques; i++)
{
uint ft_segs=(keydefs[i].flag & HA_FULLTEXT) ? FT_SEGS : 0;
uint sp_segs=(keydefs[i].flag & HA_SPATIAL) ? 2*SPDIMS : 0;
if (mi_keydef_write(file, &keydefs[i]))
goto err;
for (j=0 ; j < keydefs[i].keysegs-ft_segs-sp_segs ; j++)
for (j=0 ; j < keydefs[i].keysegs-sp_segs ; j++)
if (mi_keyseg_write(file, &keydefs[i].seg[j]))
goto err;
for (j=0 ; j < ft_segs ; j++)
{
HA_KEYSEG seg=ft_keysegs[j];
seg.language= keydefs[i].seg[0].language;
if (mi_keyseg_write(file, &seg))
goto err;
}
for (j=0 ; j < sp_segs ; j++)
{
HA_KEYSEG sseg;

View file

@ -23,13 +23,13 @@
#include <errno.h>
#endif
static int d_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,
uint key_length, my_off_t page, uchar *anc_buff);
static int d_search(MI_INFO *info,MI_KEYDEF *keyinfo,uint comp_flag,
uchar *key,uint key_length,my_off_t page,uchar *anc_buff);
static int del(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,uchar *anc_buff,
my_off_t leaf_page,uchar *leaf_buff,uchar *keypos,
my_off_t next_block,uchar *ret_key);
static int underflow(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *anc_buff,
my_off_t leaf_page, uchar *leaf_buff,uchar *keypos);
my_off_t leaf_page,uchar *leaf_buff,uchar *keypos);
static uint remove_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar *keypos,
uchar *lastkey,uchar *page_end,
my_off_t *next_block);
@ -73,7 +73,6 @@ int mi_delete(MI_INFO *info,const byte *record)
if (((ulonglong) 1 << i) & info->s->state.key_map)
{
info->s->keyinfo[i].version++;
/* The following code block is for text searching by SerG */
if (info->s->keyinfo[i].flag & HA_FULLTEXT )
{
if (_mi_ft_del(info,i,(char*) old_key,record,info->lastpos))
@ -82,7 +81,7 @@ int mi_delete(MI_INFO *info,const byte *record)
else
{
if (info->s->keyinfo[i].ck_delete(info,i,old_key,
_mi_make_key(info,i,old_key,record,info->lastpos)))
_mi_make_key(info,i,old_key,record,info->lastpos)))
goto err;
}
}
@ -128,19 +127,24 @@ err:
int _mi_ck_delete(register MI_INFO *info, uint keynr, uchar *key,
uint key_length)
{
return _mi_ck_real_delete(info, info->s->keyinfo+keynr, key, key_length,
&info->s->state.key_root[keynr]);
} /* _mi_ck_delete */
int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
uchar *key, uint key_length, my_off_t *root)
{
int error;
uint nod_flag;
my_off_t old_root;
uchar *root_buff;
MI_KEYDEF *keyinfo;
DBUG_ENTER("_mi_ck_delete");
DBUG_ENTER("_mi_ck_real_delete");
if ((old_root=info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
if ((old_root=*root) == HA_OFFSET_ERROR)
{
DBUG_RETURN(my_errno=HA_ERR_CRASHED);
}
keyinfo=info->s->keyinfo+keynr;
if (!(root_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
MI_MAX_KEY_BUFF*2)))
{
@ -153,12 +157,15 @@ int _mi_ck_delete(register MI_INFO *info, uint keynr, uchar *key,
error= -1;
goto err;
}
if ((error=d_search(info,keyinfo,key,key_length,old_root,root_buff)) >0)
if ((error=d_search(info,keyinfo,
(keyinfo->flag & HA_FULLTEXT ? SEARCH_FIND
: SEARCH_SAME),
key,key_length,old_root,root_buff)) >0)
{
if (error == 2)
{
DBUG_PRINT("test",("Enlarging of root when deleting"));
error=_mi_enlarge_root(info,keynr,key);
error=_mi_enlarge_root(info,keyinfo,key,root);
}
else /* error == 1 */
{
@ -166,10 +173,9 @@ int _mi_ck_delete(register MI_INFO *info, uint keynr, uchar *key,
{
error=0;
if (nod_flag)
info->s->state.key_root[keynr]=_mi_kpos(nod_flag,
root_buff+2+nod_flag);
*root=_mi_kpos(nod_flag,root_buff+2+nod_flag);
else
info->s->state.key_root[keynr]= HA_OFFSET_ERROR;
*root=HA_OFFSET_ERROR;
if (_mi_dispose(info,keyinfo,old_root))
error= -1;
}
@ -180,7 +186,7 @@ int _mi_ck_delete(register MI_INFO *info, uint keynr, uchar *key,
err:
my_afree((gptr) root_buff);
DBUG_RETURN(error);
} /* _mi_ck_delete */
} /* _mi_ck_real_delete */
/*
@ -192,11 +198,11 @@ err:
*/
static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
uchar *key, uint key_length, my_off_t page,
uchar *anc_buff)
uint comp_flag, uchar *key, uint key_length,
my_off_t page, uchar *anc_buff)
{
int flag,ret_value,save_flag;
uint length,nod_flag;
uint length,nod_flag,search_key_length;
my_bool last_key;
uchar *leaf_buff,*keypos;
my_off_t leaf_page,next_block;
@ -204,9 +210,9 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_ENTER("d_search");
DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff));
flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, USE_WHOLE_KEY,
SEARCH_SAME,
&keypos, lastkey, &last_key);
search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, search_key_length,
comp_flag, &keypos, lastkey, &last_key);
if (flag == MI_FOUND_WRONG_KEY)
{
DBUG_PRINT("error",("Found wrong key"));
@ -214,6 +220,52 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
}
nod_flag=mi_test_if_nod(anc_buff);
if (!flag && keyinfo->flag & HA_FULLTEXT)
{
uint off;
int subkeys;
get_key_full_length_rdonly(off, lastkey);
subkeys=ft_sintXkorr(lastkey+off);
comp_flag=SEARCH_SAME;
if (subkeys >= 0)
{
/* normal word, one-level tree structure */
flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key,USE_WHOLE_KEY,
comp_flag, &keypos, lastkey, &last_key);
/* fall through to normal delete */
}
else
{
/* popular word. two-level tree. going down */
uint tmp_key_length;
my_off_t root;
uchar *kpos=keypos;
tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey);
root=_mi_dpos(info,nod_flag,kpos);
if (subkeys == -1)
{
/* the last entry in sub-tree */
_mi_dispose(info, keyinfo, root);
/* fall through to normal delete */
}
else
{
keyinfo=&info->s->ft2_keyinfo;
kpos-=keyinfo->keylength; /* we'll modify key entry 'in vivo' */
key+=off;
ret_value=_mi_ck_real_delete(info, &info->s->ft2_keyinfo,
key, HA_FT_WLEN, &root);
_mi_dpointer(info, kpos+HA_FT_WLEN, root);
subkeys++;
ft_intXstore(kpos, subkeys);
if (!ret_value)
ret_value=_mi_write_keypage(info,keyinfo,page,anc_buff);
DBUG_RETURN(ret_value);
}
}
}
leaf_buff=0;
LINT_INIT(leaf_page);
if (nod_flag)
@ -239,7 +291,8 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
goto err;
}
save_flag=0;
ret_value=d_search(info,keyinfo,key,key_length,leaf_page,leaf_buff);
ret_value=d_search(info,keyinfo,comp_flag,key,key_length,
leaf_page,leaf_buff);
}
else
{ /* Found key */

View file

@ -69,7 +69,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{
int lock_error,kfile,open_mode,save_errno,have_rtree=0;
uint i,j,len,errpos,head_length,base_pos,offset,info_length,keys,
key_parts,unique_key_parts,tmp_length,uniques;
key_parts,unique_key_parts,fulltext_keys,uniques;
char name_buff[FN_REFLEN], org_name [FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
char *disk_cache,*disk_pos;
@ -126,8 +126,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
HA_OPTION_TEMP_COMPRESS_RECORD | HA_OPTION_CHECKSUM |
HA_OPTION_TMP_TABLE | HA_OPTION_DELAY_KEY_WRITE))
{
DBUG_PRINT("error",("wrong options: 0x%lx",
share->options));
DBUG_PRINT("error",("wrong options: 0x%lx", share->options));
my_errno=HA_ERR_OLD_FILE;
goto err;
}
@ -162,11 +161,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
len=mi_uint2korr(share->state.header.state_info_length);
keys= (uint) share->state.header.keys;
uniques= (uint) share->state.header.uniques;
fulltext_keys= (uint) share->state.header.fulltext_keys;
key_parts= mi_uint2korr(share->state.header.key_parts);
unique_key_parts= mi_uint2korr(share->state.header.unique_key_parts);
tmp_length=(MI_STATE_INFO_SIZE + keys * MI_STATE_KEY_SIZE +
key_parts*MI_STATE_KEYSEG_SIZE +
share->state.header.max_block_size*MI_STATE_KEYBLOCK_SIZE);
if (len != MI_STATE_INFO_SIZE)
{
DBUG_PRINT("warning",
@ -203,6 +200,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
goto err;
}
key_parts+=fulltext_keys*FT_SEGS;
if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY ||
key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG)
{
@ -211,7 +209,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
goto err;
}
/* Correct max_file_length based on length of sizeof_t */
/* Correct max_file_length based on length of sizeof(off_t) */
max_data_file_length=
(share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ?
(((ulonglong) 1 << (share->base.rec_reflength*8))-1) :
@ -290,6 +288,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for (i=0 ; i < keys ; i++)
{
disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]);
if (share->keyinfo[i].key_alg == HA_KEY_ALG_RTREE)
have_rtree=1;
set_if_smaller(share->blocksize,share->keyinfo[i].block_length);
share->keyinfo[i].seg=pos;
for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++)
@ -312,11 +312,41 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
uint sp_segs=SPDIMS*2;
share->keyinfo[i].seg=pos-sp_segs;
share->keyinfo[i].keysegs--;
} else if (share->keyinfo[i].flag & HA_FULLTEXT)
{
share->keyinfo[i].seg=pos-FT_SEGS;
share->fulltext_index=1;
}
else if (share->keyinfo[i].flag & HA_FULLTEXT)
{
if (!fulltext_keys)
{ /* 4.0 compatibility code, to be removed in 5.0 */
share->keyinfo[i].seg=pos-FT_SEGS;
share->keyinfo[i].keysegs-=FT_SEGS;
share->state.header.fulltext_keys++;
}
else
{
uint j;
share->keyinfo[i].seg=pos;
for (j=0; j < FT_SEGS; j++)
{
*pos=ft_keysegs[j];
pos[0].language= pos[-1].language;
pos[0].charset= pos[-1].charset;
pos++;
}
}
if (!share->ft2_keyinfo.seg)
{
memcpy(& share->ft2_keyinfo, & share->keyinfo[i], sizeof(MI_KEYDEF));
share->ft2_keyinfo.keysegs=1;
share->ft2_keyinfo.flag=0;
share->ft2_keyinfo.keylength=
share->ft2_keyinfo.minlength=
share->ft2_keyinfo.maxlength=HA_FT_WLEN+share->base.rec_reflength;
share->ft2_keyinfo.seg=pos-1;
share->ft2_keyinfo.end=pos;
setup_key_functions(& share->ft2_keyinfo);
}
}
setup_key_functions(share->keyinfo+i);
share->keyinfo[i].end=pos;
pos->type=HA_KEYTYPE_END; /* End */
pos->length=share->base.rec_reflength;
@ -349,12 +379,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
pos++;
}
}
for (i=0 ; i < keys ; i++)
{
if (share->keyinfo[i].key_alg == HA_KEY_ALG_RTREE)
have_rtree=1;
setup_key_functions(share->keyinfo+i);
}
for (i=j=offset=0 ; i < share->base.fields ; i++)
{
@ -720,9 +744,9 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo)
}
/***************************************************************************
** Function to save and store the header in the index file (.MSI)
***************************************************************************/
/*
Function to save and store the header in the index file (.MYI)
*/
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
{

View file

@ -51,7 +51,7 @@ int mi_rnext(MI_INFO *info, byte *buf, int inx)
case HA_KEY_ALG_BTREE:
default:
error=_mi_search_first(info,info->s->keyinfo+inx,
info->s->state.key_root[inx]);
info->s->state.key_root[inx]);
break;
}
}
@ -81,15 +81,15 @@ int mi_rnext(MI_INFO *info, byte *buf, int inx)
error=_mi_search(info,info->s->keyinfo+inx,info->lastkey,
USE_WHOLE_KEY,flag, info->s->state.key_root[inx]);
}
if (!error)
if (!error && info->s->concurrent_insert)
{
while (info->lastpos >= info->state->data_file_length)
{
/* Skip rows that are inserted by other threads since we got a lock */
if ((error=_mi_search_next(info,info->s->keyinfo+inx,info->lastkey,
info->lastkey_length,
SEARCH_BIGGER,
info->s->state.key_root[inx])))
if ((error=_mi_search_next(info,info->s->keyinfo+inx,info->lastkey,
info->lastkey_length,
SEARCH_BIGGER,
info->s->state.key_root[inx])))
break;
}
}

View file

@ -91,7 +91,6 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
{
if (((ulonglong) 1 << i) & share->state.key_map)
{
/* The following code block is for text searching by SerG */
if (share->keyinfo[i].flag & HA_FULLTEXT )
{
if (_mi_ft_cmp(info,i,oldrec, newrec))
@ -175,7 +174,6 @@ err:
{
if (((ulonglong) 1 << i) & changed)
{
/* The following code block is for text searching by SerG */
if (share->keyinfo[i].flag & HA_FULLTEXT)
{
if ((flag++ && _mi_ft_del(info,i,(char*) new_key,newrec,pos)) ||

View file

@ -38,9 +38,9 @@ static int _mi_balance_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,
static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
uchar *key, uint *return_key_length,
uchar **after_key);
int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
int _mi_ck_write_tree(register MI_INFO *info, uint keynr,uchar *key,
uint key_length);
int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
int _mi_ck_write_btree(register MI_INFO *info, uint keynr,uchar *key,
uint key_length);
/* Write new record to database */
@ -250,11 +250,12 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
int error;
uint comp_flag;
MI_KEYDEF *keyinfo=info->s->keyinfo+keynr;
my_off_t *root=&info->s->state.key_root[keynr];
DBUG_ENTER("_mi_ck_write_btree");
if (keyinfo->flag & HA_SORT_ALLOWS_SAME)
comp_flag=SEARCH_BIGGER; /* Put after same key */
else if (keyinfo->flag & HA_NOSAME)
else if (keyinfo->flag & (HA_NOSAME|HA_FULLTEXT))
{
comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* No dupplicates */
if (keyinfo->flag & HA_NULL_ARE_EQUAL)
@ -263,37 +264,34 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
else
comp_flag=SEARCH_SAME; /* Keys in rec-pos order */
if (info->s->state.key_root[keynr] == HA_OFFSET_ERROR ||
if (*root == HA_OFFSET_ERROR ||
(error=w_search(info, keyinfo, comp_flag, key, key_length,
info->s->state.key_root[keynr], (uchar *) 0, (uchar*) 0,
*root, (uchar *) 0, (uchar*) 0,
(my_off_t) 0, 1)) > 0)
error=_mi_enlarge_root(info,keynr,key);
error=_mi_enlarge_root(info,keyinfo,key,root);
DBUG_RETURN(error);
} /* _mi_ck_write_btree */
/* Make a new root with key as only pointer */
int _mi_enlarge_root(register MI_INFO *info, uint keynr, uchar *key)
int _mi_enlarge_root(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
my_off_t *root)
{
uint t_length,nod_flag;
reg2 MI_KEYDEF *keyinfo;
MI_KEY_PARAM s_temp;
MYISAM_SHARE *share=info->s;
DBUG_ENTER("_mi_enlarge_root");
nod_flag= (share->state.key_root[keynr] != HA_OFFSET_ERROR) ?
share->base.key_reflength : 0;
_mi_kpointer(info,info->buff+2,share->state.key_root[keynr]); /* if nod */
keyinfo=share->keyinfo+keynr;
nod_flag= (*root != HA_OFFSET_ERROR) ? share->base.key_reflength : 0;
_mi_kpointer(info,info->buff+2,*root); /* if nod */
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar*) 0,
(uchar*) 0, (uchar*) 0, key,&s_temp);
mi_putint(info->buff,t_length+2+nod_flag,nod_flag);
(*keyinfo->store_key)(keyinfo,info->buff+2+nod_flag,&s_temp);
info->buff_used=info->page_changed=1; /* info->buff is used */
if ((share->state.key_root[keynr]= _mi_new(info,keyinfo)) ==
HA_OFFSET_ERROR ||
_mi_write_keypage(info,keyinfo,share->state.key_root[keynr],info->buff))
if ((*root= _mi_new(info,keyinfo)) == HA_OFFSET_ERROR ||
_mi_write_keypage(info,keyinfo,*root,info->buff))
DBUG_RETURN(-1);
DBUG_RETURN(0);
} /* _mi_enlarge_root */
@ -333,15 +331,54 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (flag == 0)
{
uint tmp_key_length;
my_errno=HA_ERR_FOUND_DUPP_KEY;
/* get position to record with duplicated key */
tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff);
if (tmp_key_length)
info->dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length);
else
info->dupp_key_pos= HA_OFFSET_ERROR;
my_afree((byte*) temp_buff);
DBUG_RETURN(-1);
if (keyinfo->flag & HA_FULLTEXT)
{
uint off;
int subkeys;
get_key_full_length_rdonly(off, keybuff);
subkeys=ft_sintXkorr(keybuff+off);
comp_flag=SEARCH_SAME;
if (subkeys >= 0)
{
/* normal word, one-level tree structure */
flag=(*keyinfo->bin_search)(info, keyinfo, temp_buff, key,
USE_WHOLE_KEY, comp_flag,
&keypos, keybuff, &was_last_key);
}
else
{
/* popular word. two-level tree. going down */
my_off_t root=info->dupp_key_pos;
keyinfo=&info->s->ft2_keyinfo;
key+=off;
keypos-=keyinfo->keylength; /* we'll modify key entry 'in vivo' */
if ((error=w_search(info, keyinfo, comp_flag, key, HA_FT_WLEN, root,
(uchar *) 0, (uchar*) 0, (my_off_t) 0, 1)) > 0)
{
error=_mi_enlarge_root(info, keyinfo, key, &root);
_mi_dpointer(info, keypos+HA_FT_WLEN, root);
}
subkeys--; /* should there be underflow protection ? */
ft_intXstore(keypos, subkeys);
if (!error)
error=_mi_write_keypage(info,keyinfo,page,temp_buff);
my_afree((byte*) temp_buff);
DBUG_RETURN(error);
}
}
else /* not HA_FULLTEXT, normal HA_NOSAME key */
{
my_afree((byte*) temp_buff);
my_errno=HA_ERR_FOUND_DUPP_KEY;
DBUG_RETURN(-1);
}
}
if (flag == MI_FOUND_WRONG_KEY)
DBUG_RETURN(-1);
@ -394,7 +431,9 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
#ifndef DBUG_OFF
if (key_pos != anc_buff+2+nod_flag && (keyinfo->flag &
(HA_BINARY_PACK_KEY | HA_PACK_KEY)))
{
DBUG_DUMP("prev_key",(byte*) key_buff,_mi_keylength(keyinfo,key_buff));
}
if (keyinfo->flag & HA_PACK_KEY)
{
DBUG_PRINT("test",("t_length: %d ref_len: %d",

View file

@ -874,8 +874,8 @@ static int myisamchk(MI_CHECK *param, my_string filename)
}
else
{
if (share->fulltext_index)
ft_init_stopwords(ft_precompiled_stopwords); /* SerG */
if (share->state.header.fulltext_keys)
ft_init_stopwords(ft_precompiled_stopwords);
if (!(param->testflag & T_READONLY))
lock_type = F_WRLCK; /* table is changed */

View file

@ -55,7 +55,8 @@ typedef struct st_mi_state_info
uchar uniques; /* number of UNIQUE definitions */
uchar language; /* Language for indexes */
uchar max_block_size; /* max keyblock size */
uchar not_used[2]; /* To align to 8 */
uchar fulltext_keys;
uchar not_used; /* To align to 8 */
} header;
MI_STATUS_INFO state;
@ -90,7 +91,7 @@ typedef struct st_mi_state_info
} MI_STATE_INFO;
#define MI_STATE_INFO_SIZE (24+14*8+7*4+2*2+8)
#define MI_STATE_KEY_SIZE 8
#define MI_STATE_KEY_SIZE 8
#define MI_STATE_KEYBLOCK_SIZE 8
#define MI_STATE_KEYSEG_SIZE 4
#define MI_STATE_EXTRA_SIZE ((MI_MAX_KEY+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + MI_MAX_KEY*MI_MAX_KEY_SEG*MI_STATE_KEYSEG_SIZE)
@ -154,6 +155,7 @@ typedef struct st_mi_isam_pack {
typedef struct st_mi_isam_share { /* Shared between opens */
MI_STATE_INFO state;
MI_BASE_INFO base;
MI_KEYDEF ft2_keyinfo; /* Second-level ft-key definition */
MI_KEYDEF *keyinfo; /* Key definitions */
MI_UNIQUEDEF *uniqueinfo; /* unique definitions */
HA_KEYSEG *keyparts; /* key part info */
@ -197,8 +199,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */
global_changed, /* If changed since open */
not_flushed,
temporary,delay_key_write,
concurrent_insert,
fulltext_index;
concurrent_insert;
#ifdef THREAD
THR_LOCK lock;
pthread_mutex_t intern_lock; /* Locking for use with _locking */
@ -229,6 +230,8 @@ struct st_myisam_info {
byte *rec_buff; /* Tempbuff for recordpack */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */
int (*read_record)(struct st_myisam_info*, my_off_t, byte*);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_unique; /* uniq filenumber or thread */
@ -247,7 +250,6 @@ struct st_myisam_info {
int dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */
uint update; /* If file changed since open */
uint int_nod_flag; /* -""- */
int lastinx; /* Last used index */
uint lastkey_length; /* Length of key in lastkey */
uint last_rkey_length; /* Last length in mi_rkey() */
@ -259,7 +261,6 @@ struct st_myisam_info {
uint data_changed; /* Somebody has changed data */
uint save_update; /* When using KEY_READ */
int save_lastinx;
uint32 int_keytree_version; /* -""- */
LIST open_list;
IO_CACHE rec_cache; /* When cacheing records */
myf lock_wait; /* is 0 or MY_DONT_WAIT */
@ -372,6 +373,13 @@ typedef struct st_mi_sort_param
{ length=mi_uint2korr((key)+1)+3; (key)+=3; } \
}
#define get_key_full_length_rdonly(length,key) \
{ if ((uchar) *(key) != 255) \
length= ((uint) (uchar) *((key)))+1; \
else \
{ length=mi_uint2korr((key)+1)+3; } \
}
#define get_pack_length(length) ((length) >= 255 ? 3 : 1)
#define MI_MIN_BLOCK_LENGTH 20 /* Because of delete-link */
@ -395,7 +403,7 @@ typedef struct st_mi_sort_param
#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH)
#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/myisam_block_size+1)*myisam_block_size)
#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) (((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/myisam_block_size+1)*myisam_block_size)
#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
@ -455,7 +463,7 @@ extern int _mi_delete_static_record(MI_INFO *info);
extern int _mi_cmp_static_record(MI_INFO *info,const byte *record);
extern int _mi_read_rnd_static_record(MI_INFO*, byte *,my_off_t, my_bool);
extern int _mi_ck_write(MI_INFO *info,uint keynr,uchar *key,uint length);
extern int _mi_enlarge_root(MI_INFO *info,uint keynr,uchar *key);
extern int _mi_enlarge_root(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, my_off_t *root);
extern int _mi_insert(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,
uchar *anc_buff,uchar *key_pos,uchar *key_buff,
uchar *father_buff, uchar *father_keypos,
@ -690,6 +698,7 @@ void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));
int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
#ifdef THREAD
pthread_handler_decl(thr_find_all_keys,arg);

View file

@ -71,6 +71,7 @@ static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys,
BUFFPEK *Fb, BUFFPEK *Tb);
static int NEAR_F merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int,
IO_CACHE *);
static int flush_ft_buf(MI_SORT_PARAM *info);
static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys,
uint count, BUFFPEK *buffpek,
@ -207,7 +208,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
goto err; /* purecov: inspected */
}
if (flush_pending_blocks(info))
if (flush_ft_buf(info) || flush_pending_blocks(info))
goto err;
if (my_b_inited(&tempfile_for_exceptions))
@ -478,7 +479,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
fflush(stdout);
}
if (write_index(sinfo, sinfo->sort_keys, sinfo->keys) ||
flush_pending_blocks(sinfo))
flush_ft_buf(sinfo) || flush_pending_blocks(sinfo))
got_error=1;
}
}
@ -551,6 +552,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
if (merge_index(sinfo, keys, (uchar **)mergebuf,
dynamic_element(&sinfo->buffpek,0,BUFFPEK *),
maxbuffer,&sinfo->tempfile) ||
flush_ft_buf(sinfo) ||
flush_pending_blocks(sinfo))
{
got_error=1;
@ -976,3 +978,16 @@ merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys,
DBUG_RETURN(0);
} /* merge_index */
static int
flush_ft_buf(MI_SORT_PARAM *info)
{
int err=0;
if (info->sort_info->ft_buf)
{
err=sort_ft_buf_flush(info);
my_free((gptr)info->sort_info->ft_buf, MYF(0));
info->sort_info->ft_buf=0;
}
return err;
}

View file

@ -1,5 +1,8 @@
drop table if exists t1;
create table t1 (id int not null, str char(10), unique(str));
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
select * from t1 where str is null;
id str

View file

@ -16,6 +16,8 @@ select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
a b
Full-text indexes are called collections
Only MyISAM tables support collections
select * from t1 where MATCH(a,b) AGAINST ("only");
a b
select * from t1 where MATCH(a,b) AGAINST ("collections") UNION ALL select * from t1 where MATCH(a,b) AGAINST ("indexes");
a b
Only MyISAM tables support collections

View file

@ -0,0 +1,871 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
a varchar(255) not null,
FULLTEXT KEY (a)
) TYPE=MyISAM;
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaaxxx');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaazzz');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
insert t1 (a) values ('aaayyy');
repair table t1 quick;
Table Op Msg_type Msg_text
test.t1 repair status OK
select count(*) from t1 where match a against ('aaaxxx');
count(*)
260
select count(*) from t1 where match a against ('aaayyy');
count(*)
250
select count(*) from t1 where match a against ('aaazzz');
count(*)
255
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
count(*)
260
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
count(*)
250
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
count(*)
255
select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz');
count(*)
765
select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode);
count(*)
765
select count(*) from t1 where match a against ('aaax*' in boolean mode);
count(*)
260
select count(*) from t1 where match a against ('aaay*' in boolean mode);
count(*)
250
select count(*) from t1 where match a against ('aaa*' in boolean mode);
count(*)
765
insert t1 (a) values ('aaaxxx'),('aaayyy');
insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz');
select count(*) from t1 where match a against ('aaaxxx');
count(*)
261
select count(*) from t1 where match a against ('aaayyy');
count(*)
251
select count(*) from t1 where match a against ('aaazzz');
count(*)
260
insert t1 (a) values ('aaaxxx 000000');
select count(*) from t1 where match a against ('000000');
count(*)
1
delete from t1 where match a against ('000000');
select count(*) from t1 where match a against ('000000');
count(*)
0
select count(*) from t1 where match a against ('aaaxxx');
count(*)
261
delete from t1 where match a against ('aaazzz');
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
count(*)
261
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
count(*)
251
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
count(*)
0
select count(*) from t1 where a = 'aaaxxx';
count(*)
261
select count(*) from t1 where a = 'aaayyy';
count(*)
251
select count(*) from t1 where a = 'aaazzz';
count(*)
0
insert t1 (a) values ('aaaxxx 000000');
select count(*) from t1 where match a against ('000000');
count(*)
1
update t1 set a='aaazzz' where match a against ('000000');
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
count(*)
261
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
count(*)
1
update t1 set a='aaazzz' where a = 'aaaxxx';
update t1 set a='aaaxxx' where a = 'aaayyy';
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
count(*)
251
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
count(*)
0
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
count(*)
262
DROP TABLE IF EXISTS t1;

View file

@ -14,8 +14,7 @@ insert into t1 values (101);
insert into t1 values (105);
insert into t1 values (106);
insert into t1 values (107);
insert into t2 values (107);
insert into t2 values (75);
insert into t2 values (107),(75),(1000);
select t1.id, t2.id from t1, t2 where t2.id = t1.id;
id id
107 107
@ -28,6 +27,16 @@ select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id;
id count(t2.id)
75 1
107 1
select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
id id
NULL 75
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
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
drop table t1,t2;
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,

View file

@ -5,6 +5,7 @@
drop table if exists t1;
--enable_warnings
create table t1 (id int not null, str char(10), unique(str));
explain select * from t1;
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
select * from t1 where str is null;
select * from t1 where str="foo";
@ -14,8 +15,10 @@ explain select * from t1 ignore key (str) where str="foo";
explain select * from t1 use key (str,str) where str="foo";
#The following should give errors
!$1072 explain select * from t1 use key (str,str,foo) where str="foo";
!$1072 explain select * from t1 ignore key (str,str,foo) where str="foo";
--error 1072
explain select * from t1 use key (str,str,foo) where str="foo";
--error 1072
explain select * from t1 ignore key (str,str,foo) where str="foo";
drop table t1;
explain select 1;

View file

@ -18,6 +18,7 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
select * from t1 where MATCH(a,b) AGAINST ("collections");
select * from t1 where MATCH(a,b) AGAINST ("indexes");
select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
select * from t1 where MATCH(a,b) AGAINST ("only");
# UNION of fulltext's
select * from t1 where MATCH(a,b) AGAINST ("collections") UNION ALL select * from t1 where MATCH(a,b) AGAINST ("indexes");

View file

@ -0,0 +1,96 @@
#
# test of new fulltext search features
#
#
# two-level tree
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
a varchar(255) not null,
FULLTEXT KEY (a)
) TYPE=MyISAM;
# two-level entry, second-level tree with depth 2
let $1=260;
while ($1)
{
eval insert t1 (a) values ('aaaxxx');
dec $1;
}
# two-level entry, second-level tree has only one page
let $1=255;
while ($1)
{
eval insert t1 (a) values ('aaazzz');
dec $1;
}
# one-level entry (entries)
let $1=250;
while ($1)
{
eval insert t1 (a) values ('aaayyy');
dec $1;
}
# converting to two-level
repair table t1 quick;
select count(*) from t1 where match a against ('aaaxxx');
select count(*) from t1 where match a against ('aaayyy');
select count(*) from t1 where match a against ('aaazzz');
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz');
select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode);
select count(*) from t1 where match a against ('aaax*' in boolean mode);
select count(*) from t1 where match a against ('aaay*' in boolean mode);
select count(*) from t1 where match a against ('aaa*' in boolean mode);
# mi_write:
insert t1 (a) values ('aaaxxx'),('aaayyy');
# call to enlarge_root() below
insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz');
select count(*) from t1 where match a against ('aaaxxx');
select count(*) from t1 where match a against ('aaayyy');
select count(*) from t1 where match a against ('aaazzz');
# mi_delete
insert t1 (a) values ('aaaxxx 000000');
select count(*) from t1 where match a against ('000000');
delete from t1 where match a against ('000000');
select count(*) from t1 where match a against ('000000');
select count(*) from t1 where match a against ('aaaxxx');
delete from t1 where match a against ('aaazzz');
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
# double-check without index
select count(*) from t1 where a = 'aaaxxx';
select count(*) from t1 where a = 'aaayyy';
select count(*) from t1 where a = 'aaazzz';
# update
insert t1 (a) values ('aaaxxx 000000');
select count(*) from t1 where match a against ('000000');
update t1 set a='aaazzz' where match a against ('000000');
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
update t1 set a='aaazzz' where a = 'aaaxxx';
update t1 set a='aaaxxx' where a = 'aaayyy';
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
DROP TABLE IF EXISTS t1;

View file

@ -21,13 +21,18 @@ insert into t1 values (105);
insert into t1 values (106);
insert into t1 values (107);
insert into t2 values (107);
insert into t2 values (75);
insert into t2 values (107),(75),(1000);
select t1.id, t2.id from t1, t2 where t2.id = t1.id;
select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t1.id;
select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id;
#
# Test problems with impossible ON or WHERE
#
select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
drop table t1,t2;
#

View file

@ -19,14 +19,16 @@
/*
Malloc many pointers at the same time
Only ptr1 can be free'd, and doing this will free all
the memory allocated. ptr2, etc all point inside big allocated
memory area.
SYNOPSIS
my_multi_malloc()
myFlags Flags
... Multiple arguments terminated by null ptr
ptr, length
ptr, length
myFlags Flags
ptr1, length1 Multiple arguments terminated by null ptr
ptr2, length2 ...
...
NULL
*/

View file

@ -23,6 +23,7 @@
#include "mysys_priv.h"
#include "my_static.h"
#include "mysys_err.h"
#include <m_string.h>
/*
Alloc for things we don't nead to free

View file

@ -455,7 +455,7 @@ void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs,
(each path from root to leaf has the same length)
*/
ha_rows tree_record_pos(TREE *tree, const void *key,
enum ha_rkey_function flag, void *custom_arg)
enum ha_rkey_function flag, void *custom_arg)
{
int cmp;
TREE_ELEMENT *element= tree->root;
@ -470,7 +470,7 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
{
switch (flag) {
case HA_READ_KEY_EXACT:
last_equal_pos= (left + right) / 2;
last_equal_pos= (ha_rows) ((left + right) / 2);
cmp= 1;
break;
case HA_READ_BEFORE_KEY:
@ -498,9 +498,9 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
case HA_READ_KEY_EXACT:
return last_equal_pos;
case HA_READ_BEFORE_KEY:
return (uint) right;
return (ha_rows) right;
case HA_READ_AFTER_KEY:
return (uint) left;
return (ha_rows) left;
default:
return HA_POS_ERROR;
}

View file

@ -2053,7 +2053,8 @@ String *Field_longlong::val_str(String *val_buffer,
#endif
longlongget(j,ptr);
length=(uint) cs->longlong10_to_str(cs,to,mlength,unsigned_flag ? 10 : -10, j);
length=(uint) (cs->longlong10_to_str)(cs,to,mlength,
unsigned_flag ? 10 : -10, j);
val_buffer->length(length);
if (zerofill)
prepend_zeros(val_buffer);
@ -3928,7 +3929,7 @@ int Field_string::store(longlong nr)
char buff[64];
int l;
CHARSET_INFO *cs=charset();
l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr);
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
return Field_string::store(buff,(uint)l,cs);
}
@ -4095,7 +4096,7 @@ int Field_varstring::store(longlong nr)
char buff[64];
int l;
CHARSET_INFO *cs=charset();
l=cs->longlong10_to_str(cs,buff,sizeof(buff),-10,nr);
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
return Field_varstring::store(buff,(uint)l,cs);
}

View file

@ -23,7 +23,6 @@
#endif
#include <m_ctype.h>
#include "sql_sort.h"
#include "assert.h"
#ifndef THREAD
#define SKIP_DBUG_IN_FILESORT

View file

@ -55,7 +55,6 @@
#ifdef HAVE_BERKELEY_DB
#include <m_ctype.h>
#include <myisampack.h>
#include <assert.h>
#include <hash.h>
#include "ha_berkeley.h"
#include "sql_manager.h"

View file

@ -32,7 +32,6 @@ InnoDB */
#ifdef HAVE_INNOBASE_DB
#include <m_ctype.h>
#include <assert.h>
#include <hash.h>
#include <myisampack.h>

View file

@ -22,7 +22,6 @@
#include "mysql_priv.h"
#include <m_ctype.h>
#include "my_dir.h"
#include <assert.h>
/*****************************************************************************
** Item functions
@ -1058,7 +1057,8 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
break;
if ((tmp= find_field_in_tables(thd, this,
sl->get_table_list(), &where,
0)) != not_found_field);
0)) != not_found_field)
break;
if (sl->master_unit()->first_select()->linkage ==
DERIVED_TABLE_TYPE)
break; // do not look over derived table

View file

@ -23,7 +23,6 @@
#include "mysql_priv.h"
#include <m_ctype.h>
#include "assert.h"
Item_bool_func2* Item_bool_func2::eq_creator(Item *a, Item *b)
{
return new Item_func_eq(a, b);

View file

@ -28,7 +28,6 @@
#include <time.h>
#include <ft_global.h>
#include <zlib.h>
#include <assert.h>
/* return TRUE if item is a constant */

View file

@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
#include "assert.h"
Item_row::Item_row(List<Item> &arg):
Item(), used_tables_cache(0), array_holder(1), const_item_cache(1)

View file

@ -1321,12 +1321,14 @@ String *Item_func_password::val_str(String *str)
char* seed_ptr=key->c_ptr();
while (*seed_ptr)
{
seed=seed*211+*seed_ptr; /* Use simple hashing */
seed=(seed*211+*seed_ptr) & 0xffffffffL; /* Use simple hashing */
seed_ptr++;
}
/* Use constants which allow nice random values even with small seed */
randominit(&rand_st,seed*111111+33333333L,seed*1111+55555555L);
randominit(&rand_st,
(ulong) ((ulonglong) seed*111111+33333333L) & (ulong) 0xffffffff,
(ulong) ((ulonglong) seed*1111+55555555L) & (ulong) 0xffffffff);
make_scrambled_password(tmp_value,res->c_ptr(),use_old_passwords,
&rand_st);

View file

@ -494,7 +494,7 @@ void Item_in_subselect::single_value_transformer(THD *thd,
else
{
sl->item_list.empty();
sl->item_list.push_back(new Item_int(1));
sl->item_list.push_back(new Item_int("Not_used", (longlong) 1, 21));
if (sl->table_list.elements)
{
item= (*func)(expr, new Item_asterisk_remover(this, item,

View file

@ -22,7 +22,7 @@
#endif
#include "mysql_priv.h"
#include "assert.h"
Item_sum::Item_sum(List<Item> &list)
{
arg_count=list.elements;

View file

@ -136,7 +136,7 @@ static SYMBOL symbols[] = {
{ "DROP", SYM(DROP),0,0},
{ "DUMPFILE", SYM(DUMPFILE),0,0},
{ "DYNAMIC", SYM(DYNAMIC_SYM),0,0},
{ "DUPLICATE", SYM(DUPLICATE),0,0},
{ "DUPLICATE", SYM(DUPLICATE_SYM),0,0},
{ "ERRORS", SYM(ERRORS),0,0},
{ "END", SYM(END),0,0},
{ "ELSE", SYM(ELSE),0,0},

View file

@ -68,8 +68,7 @@ TODO:
#include "mysql_priv.h"
#include <hash.h>
#include <assert.h>
#include <ha_myisammrg.h>
#include "ha_myisammrg.h"
#ifndef MASTER
#include "../srclib/myisammrg/myrg_def.h"
#else

View file

@ -29,7 +29,6 @@
#include <my_dir.h>
#include <stdarg.h>
#include <m_ctype.h> // For test_if_number
#include <assert.h>
#define files_charset_info my_charset_latin1

View file

@ -24,8 +24,6 @@
#include <my_dir.h>
#endif /* MYSQL_CLIENT */
#include <assert.h>
#define log_cs my_charset_latin1
/*****************************************************************************
@ -1660,7 +1658,7 @@ void Rotate_log_event::pack_info(Protocol *protocol)
memcpy(buf, new_log_ident, ident_len);
b_pos+= ident_len;
b_pos= strmov(b_pos, ";pos=");
b_pos=int10_to_str(pos, b_pos, 10);
b_pos=longlong10_to_str(pos, b_pos, 10);
if (flags & LOG_EVENT_FORCED_ROTATE_F)
b_pos= strmov(b_pos ,"; forced by master");
protocol->store(buf, b_pos-buf);
@ -1797,7 +1795,7 @@ void Intvar_log_event::pack_info(Protocol *protocol)
char buf[64], *pos;
pos= strmov(buf, get_var_type_name());
*(pos++)='=';
pos=int10_to_str(val, pos, -10);
pos= longlong10_to_str(val, pos, -10);
protocol->store(buf, pos-buf);
}
#endif
@ -2010,7 +2008,7 @@ void Slave_log_event::pack_info(Protocol *protocol)
pos= strmov(pos, ",log=");
pos= strmov(pos, master_log);
pos= strmov(pos, ",pos=");
pos= int10_to_str(master_pos, pos, 10);
pos= longlong10_to_str(master_pos, pos, 10);
protocol->store(buf, pos-buf);
}
#endif // !MYSQL_CLIENT

View file

@ -38,7 +38,6 @@
#include <errno.h>
static void my_aiowait(my_aio_result *result);
#endif
#include <assert.h>
extern "C" {

View file

@ -24,6 +24,7 @@
#include <thr_lock.h>
#include <my_base.h> /* Needed by field.h */
#include <my_bitmap.h>
#include <assert.h>
#ifdef __EMX__
#undef write /* remove pthread.h macro definition for EMX */

View file

@ -32,7 +32,6 @@
#include <nisam.h>
#include <thr_alarm.h>
#include <ft_global.h>
#include <assert.h>
#define mysqld_charset my_charset_latin1

View file

@ -33,8 +33,6 @@
#include <m_ctype.h>
#include <nisam.h>
#include "sql_select.h"
#include <assert.h>
#ifndef EXTRA_DEBUG
#define test_rb_tree(A,B) {}

Some files were not shown because too many files have changed in this diff Show more