Commit 1e731c9a authored by bk@mysql.r18.ru's avatar bk@mysql.r18.ru

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.r18.ru:/usr/home/bk/mysql-4.1
parents 365f06b3 e8de3ff6
......@@ -87,7 +87,7 @@ LINK32=link.exe
# Name "mysql - Win32 Debug"
# Begin Source File
SOURCE=..\mysys\my_gethostbyname.c
SOURCE=.\completion_hash.cpp
# End Source File
# Begin Source File
......@@ -101,6 +101,14 @@ SOURCE=.\mysql.cpp
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\readline.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_string.cpp
# End Source File
# End Target
# End Project
......@@ -25,7 +25,7 @@ CFG=mysqlclient - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
CPP=cl.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=xilink6.exe -lib
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
......@@ -72,7 +72,7 @@ LIB32=xilink6.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
......@@ -108,14 +108,6 @@ SOURCE=..\libmysql\client.c
# End Source File
# Begin Source File
SOURCE=.\completion_hash.cpp
# End Source File
# Begin Source File
SOURCE=.\completion_hash.h
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-big5.c"
# End Source File
# Begin Source File
......@@ -426,10 +418,6 @@ SOURCE=..\libmysql\password.c
# End Source File
# Begin Source File
SOURCE=.\readline.cpp
# End Source File
# Begin Source File
SOURCE=..\mysys\safemalloc.c
# End Source File
# Begin Source File
......@@ -438,14 +426,6 @@ SOURCE=..\mysys\sha1.c
# End Source File
# Begin Source File
SOURCE=.\sql_string.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_string.h
# End Source File
# Begin Source File
SOURCE=..\strings\str2int.c
# End Source File
# Begin Source File
......
......@@ -7,18 +7,18 @@
CFG=test_libmysqld - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE
!MESSAGE NMAKE /f "test_libmysqld.mak".
!MESSAGE
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE
!MESSAGE NMAKE /f "test_libmysqld.mak" CFG="test_libmysqld - Win32 Release"
!MESSAGE
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE
!MESSAGE "test_libmysqld - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
......@@ -55,7 +55,19 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\client\completion_hash.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\mysql.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\readline.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\sql_string.cpp
# End Source File
# End Group
# Begin Source File
......
LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 4.0 Embedded Server Library'
VERSION 4.0
DESCRIPTION 'MySQL 4.1 Embedded Server Library'
VERSION 4.1
EXPORTS
mysql_server_end
mysql_server_init
mysql_use_result
mysql_thread_safe
mysql_thread_id
mysql_store_result
mysql_stat
mysql_shutdown
mysql_select_db
mysql_row_tell
mysql_row_seek
mysql_real_query
mysql_real_connect
mysql_query
mysql_ping
mysql_options
mysql_num_rows
mysql_num_fields
mysql_list_tables
mysql_list_processes
mysql_list_fields
mysql_list_dbs
mysql_kill
mysql_insert_id
mysql_init
mysql_info
mysql_get_server_info
mysql_get_proto_info
mysql_get_host_info
mysql_get_client_info
mysql_free_result
mysql_field_tell
mysql_field_count
mysql_field_seek
mysql_fetch_row
mysql_fetch_lengths
mysql_fetch_fields
mysql_fetch_field_direct
mysql_fetch_field
mysql_escape_string
mysql_real_escape_string
mysql_error
mysql_errno
mysql_eof
mysql_dump_debug_info
mysql_drop_db
mysql_debug
mysql_data_seek
mysql_create_db
mysql_character_set_name
_dig_vec
bmove_upp
delete_dynamic
free_defaults
getopt_compare_strings
getopt_ull_limit_value
handle_options
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
load_defaults
max_allowed_packet
my_end
my_getopt_print_errors
my_init
my_malloc
my_memdup
my_no_flags_free
my_path
my_print_help
my_print_variables
my_realloc
my_strdup
my_thread_end
my_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_change_user
mysql_connect
mysql_character_set_name
mysql_close
mysql_affected_rows
mysql_thread_init
mysql_thread_end
mysql_send_query
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_odbc_escape_string
myodbc_remove_escape
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_query
mysql_shutdown
mysql_ssl_set
mysql_stat
mysql_store_result
mysql_sqlstate
mysql_thread_id
mysql_thread_safe
mysql_use_result
mysql_warning_count
net_buffer_length
set_dynamic
strcend
strcont
strdup_root
strfill
strinstr
strmake
strmov
strxmov
mysql_server_end
mysql_server_init
get_tty_password
sql_protocol_typelib
mysql_get_server_version
mysql_sqlstate
charsets_dir
disabled_my_option
my_charset_latin1
init_alloc_root
my_progname
get_charset_by_csname
print_defaults
find_type
strxnmov
strend
my_fopen
my_fclose
unpack_filename
str2int
int10_to_str
longlong10_to_str
my_snprintf_8bit
alloc_root
free_root
my_read
......@@ -43,7 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /mktyplib203 /win32 # ADD BASE MTL /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
......@@ -68,7 +69,8 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /mktyplib203 /win32 # ADD BASE MTL /c
# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
......@@ -87,7 +89,11 @@ LINK32=link.exe
# Name "libmysqld - Win32 Debug"
# Begin Source File
SOURCE=.\client.c
SOURCE="..\strings\ctype-latin1.c"
# End Source File
# Begin Source File
SOURCE=..\mysys\default.c
# End Source File
# Begin Source File
......@@ -111,7 +117,7 @@ SOURCE=..\sql\filesort.cpp
# End Source File
# Begin Source File
SOURCE=..\libmysql\get_password.c
SOURCE=..\client\get_password.c
# End Source File
# Begin Source File
......@@ -159,6 +165,10 @@ SOURCE=..\sql\init.cpp
# End Source File
# Begin Source File
SOURCE=..\strings\int2str.c
# End Source File
# Begin Source File
SOURCE=..\sql\item.cpp
# End Source File
# Begin Source File
......@@ -240,6 +250,14 @@ SOURCE=..\sql\mf_iocache.cpp
# End Source File
# Begin Source File
SOURCE=..\mysys\my_alloc.c
# End Source File
# Begin Source File
SOURCE=..\mysys\my_getopt.c
# End Source File
# Begin Source File
SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
......@@ -384,6 +402,10 @@ SOURCE=..\sql\sql_show.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_state.c
# End Source File
# Begin Source File
SOURCE=..\sql\sql_string.cpp
# End Source File
# Begin Source File
......@@ -412,6 +434,26 @@ SOURCE=..\sql\sql_yacc.cpp
# End Source File
# Begin Source File
SOURCE=..\strings\str2int.c
# End Source File
# Begin Source File
SOURCE=..\strings\strcend.c
# End Source File
# Begin Source File
SOURCE=..\strings\strcont.c
# End Source File
# Begin Source File
SOURCE=..\strings\strinstr.c
# End Source File
# Begin Source File
SOURCE=..\strings\strxnmov.c
# End Source File
# Begin Source File
SOURCE=..\sql\table.cpp
# End Source File
# Begin Source File
......
......@@ -193,6 +193,10 @@ SOURCE=.\mi_panic.c
# End Source File
# Begin Source File
SOURCE=.\mi_preload.c
# End Source File
# Begin Source File
SOURCE=.\mi_range.c
# End Source File
# Begin Source File
......
......@@ -725,19 +725,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
Begin Project Dependency
Project_Dep_Name libmysqld
End Project Dependency
Begin Project Dependency
Project_Dep_Name vio
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
......
......@@ -28,7 +28,7 @@ CFG=mysqld - Win32 Release
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqld - Win32 Release"
......@@ -45,14 +45,14 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /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
......@@ -71,14 +71,14 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /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
......@@ -98,14 +98,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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
......@@ -126,14 +126,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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"
......@@ -155,14 +155,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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
......@@ -893,6 +893,10 @@ SOURCE=.\sql_class.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_client.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_crypt.cpp
# End Source File
# Begin Source File
......
......@@ -266,6 +266,7 @@ typedef struct st_mysql
my_bool free_me; /* If free in mysql_close */
my_ulonglong insert_id; /* id if insert on table with NEXTNR */
unsigned int last_errno;
unsigned int server_status;
char *last_error; /* Used by embedded server */
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
} MYSQL;
......
......@@ -2,8 +2,43 @@ LIBRARY LIBMYSQL
DESCRIPTION 'MySQL 4.1 Client Library'
VERSION 6.0
EXPORTS
_dig_vec
bmove_upp
delete_dynamic
free_defaults
getopt_compare_strings
getopt_ull_limit_value
handle_options
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
load_defaults
max_allowed_packet
my_end
my_getopt_print_errors
my_init
my_malloc
my_memdup
my_no_flags_free
my_path
my_print_help
my_print_variables
my_realloc
my_strdup
my_thread_end
my_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_bind_param
mysql_bind_result
mysql_change_user
mysql_character_set_name
mysql_close
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
......@@ -11,6 +46,9 @@ EXPORTS
mysql_errno
mysql_error
mysql_escape_string
mysql_execute
mysql_fetch
mysql_fetch_column
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
......@@ -32,113 +70,54 @@ EXPORTS
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_param_count
mysql_param_result
mysql_ping
mysql_prepare
mysql_prepare_result
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_long_data
mysql_send_query
mysql_shutdown
mysql_ssl_set
mysql_stat
mysql_stmt_affected_rows
mysql_stmt_close
mysql_stmt_data_seek
mysql_stmt_errno
mysql_stmt_error
mysql_stmt_free_result
mysql_stmt_num_rows
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_store_result
mysql_store_result
mysql_thread_id
mysql_thread_safe
mysql_use_result
bmove_upp
delete_dynamic
_dig_vec
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
max_allowed_packet
my_init
my_end
my_strdup
my_malloc
my_memdup
my_no_flags_free
my_realloc
my_thread_end
my_thread_init
mysql_warning_count
net_buffer_length
set_dynamic
strcend
strcont
strdup_root
strfill
strinstr
strmake
strmov
strxmov
myodbc_remove_escape
mysql_thread_safe
mysql_character_set_name
mysql_change_user
mysql_send_query
mysql_read_query_result
mysql_real_escape_string
mysql_ssl_set
mysql_real_connect
mysql_master_query
mysql_master_send_query
mysql_slave_query
mysql_slave_send_query
mysql_enable_rpl_parse
mysql_disable_rpl_parse
mysql_rpl_parse_enabled
mysql_enable_reads_from_master
mysql_disable_reads_from_master
mysql_reads_from_master_enabled
mysql_rpl_query_type
mysql_rpl_probe
mysql_set_master
mysql_add_slave
my_getopt_print_errors
handle_options
my_print_help
my_print_variables
getopt_ull_limit_value
getopt_compare_strings
mysql_warning_count
mysql_prepare
mysql_execute
mysql_param_count
mysql_bind_param
mysql_bind_result
mysql_param_result
mysql_prepare_result
mysql_stmt_close
mysql_stmt_free_result
mysql_stmt_error
mysql_stmt_errno
mysql_fetch
mysql_fetch_column
mysql_send_long_data
mysql_next_result
mysql_stmt_affected_rows
mysql_stmt_store_result
mysql_stmt_data_seek
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_num_rows
mysql_more_results
mysql_commit
mysql_rollback
mysql_autocommit
load_defaults
free_defaults
my_path
......@@ -49,6 +49,8 @@
static my_bool mysql_client_init=0;
uint mysql_port=0;
my_string mysql_unix_port=0;
const char *not_error_sqlstate= "00000";
const char *sql_protocol_names_lib[] =
{ "TCP", "SOCKET", "PIPE", "MEMORY",NullS };
TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"",
......@@ -516,6 +518,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
client_flag&= ~CLIENT_COMPRESS;
if (db)
client_flag|=CLIENT_CONNECT_WITH_DB;
mysql->server_status= SERVER_STATUS_AUTOCOMMIT;
if (mysql->options.init_commands)
{
......@@ -1040,9 +1043,9 @@ mysql_list_fields(MYSQL *mysql __attribute__((unused)), const char *table __attr
/* List all running processes (threads) in server */
MYSQL_RES * STDCALL
mysql_list_processes(MYSQL *mysql)
mysql_list_processes(MYSQL *mysql __attribute__((unused)))
{
#ifdef DUMMY
#ifdef FOR_THE_FUTURE
MYSQL_DATA *fields;
uint field_count;
uchar *pos;
......@@ -1063,7 +1066,7 @@ mysql_list_processes(MYSQL *mysql)
mysql->status=MYSQL_STATUS_GET_RESULT;
mysql->field_count=field_count;
DBUG_RETURN(mysql_store_result(mysql));
#endif /*DUMMY*/
#endif /* FOR_THE_FUTURE */
return 0;
}
......@@ -1535,3 +1538,96 @@ myodbc_remove_escape(MYSQL *mysql,char *name)
}
*to=0;
}
/********************************************************************
Transactional APIs
*********************************************************************/
/*
Commit the current transaction
*/
my_bool STDCALL mysql_commit(MYSQL * mysql)
{
DBUG_ENTER("mysql_commit");
DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6));
}
/*
Rollback the current transaction
*/
my_bool STDCALL mysql_rollback(MYSQL * mysql)
{
DBUG_ENTER("mysql_rollback");
DBUG_RETURN((my_bool) mysql_real_query(mysql, "rollback", 8));
}
/*
Set autocommit to either true or false
*/
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
{
DBUG_ENTER("mysql_autocommit");
DBUG_PRINT("enter", ("mode : %d", auto_mode));
if (auto_mode) /* set to true */
DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=1", 16));
DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=0", 16));
}
/********************************************************************
Multi query execution + SPs APIs
*********************************************************************/
/*
Returns if there are any more query results exists to be read using
mysql_next_result()
*/
my_bool STDCALL mysql_more_results(MYSQL *mysql)
{
my_bool res;
DBUG_ENTER("mysql_more_results");
res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ?
1: 0);
DBUG_PRINT("exit",("More results exists ? %d", res));
DBUG_RETURN(res);
}
/*
Reads and returns the next query results
*/
my_bool STDCALL mysql_next_result(MYSQL *mysql)
{
DBUG_ENTER("mysql_next_result");
mysql->last_error[0]= 0;
mysql->last_errno= 0;
strmov(mysql->sqlstate, not_error_sqlstate);
mysql->affected_rows= ~(my_ulonglong) 0;
if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
DBUG_RETURN(mysql_read_query_result(mysql));
DBUG_RETURN(0);
}
my_bool STDCALL
mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
const char *key __attribute__((unused)),
const char *cert __attribute__((unused)),
const char *ca __attribute__((unused)),
const char *capath __attribute__((unused)),
const char *cipher __attribute__((unused)))
{
return 0;
}
LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 4.0 Embedded Server Library'
VERSION 4.0
DESCRIPTION 'MySQL 4.1 Embedded Server Library'
VERSION 4.1
EXPORTS
mysql_server_end
mysql_server_init
mysql_use_result
mysql_thread_safe
mysql_thread_id
mysql_store_result
mysql_stat
mysql_shutdown
mysql_select_db
mysql_row_tell
mysql_row_seek
mysql_real_query
mysql_real_connect
mysql_query
mysql_ping
mysql_options
mysql_num_rows
mysql_num_fields
mysql_list_tables
mysql_list_processes
mysql_list_fields
mysql_list_dbs
mysql_kill
mysql_insert_id
mysql_init
mysql_info
mysql_get_server_info
mysql_get_proto_info
mysql_get_host_info
mysql_get_client_info
mysql_free_result
mysql_field_tell
mysql_field_count
mysql_field_seek
mysql_fetch_row
mysql_fetch_lengths
mysql_fetch_fields
mysql_fetch_field_direct
mysql_fetch_field
mysql_escape_string
mysql_real_escape_string
mysql_error
mysql_errno
mysql_eof
mysql_dump_debug_info
mysql_drop_db
mysql_debug
mysql_data_seek
mysql_create_db
mysql_character_set_name
_dig_vec
bmove_upp
delete_dynamic
free_defaults
getopt_compare_strings
getopt_ull_limit_value
handle_options
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
load_defaults
max_allowed_packet
my_end
my_getopt_print_errors
my_init
my_malloc
my_memdup
my_no_flags_free
my_path
my_print_help
my_print_variables
my_realloc
my_strdup
my_thread_end
my_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_change_user
mysql_connect
mysql_character_set_name
mysql_close
mysql_affected_rows
mysql_thread_init
mysql_thread_end
mysql_send_query
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_odbc_escape_string
myodbc_remove_escape
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_query
mysql_shutdown
mysql_ssl_set
mysql_stat
mysql_store_result
mysql_sqlstate
mysql_thread_id
mysql_thread_safe
mysql_use_result
mysql_warning_count
net_buffer_length
set_dynamic
strcend
strcont
strdup_root
strfill
strinstr
strmake
strmov
strxmov
mysql_server_end
mysql_server_init
get_tty_password
sql_protocol_typelib
mysql_get_server_version
mysql_sqlstate
charsets_dir
disabled_my_option
my_charset_latin1
init_alloc_root
my_progname
get_charset_by_csname
print_defaults
find_type
strxnmov
strend
my_fopen
my_fclose
unpack_filename
str2int
int10_to_str
longlong10_to_str
my_snprintf_8bit
alloc_root
free_root
my_read
......@@ -42,35 +42,32 @@
int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
{
uint i;
uint length;
uint block_length= 0;
ulong length, block_length= 0;
uchar *buff= NULL;
MYISAM_SHARE* share= info->s;
uint keys= share->state.header.keys;
MI_KEYDEF *keyinfo= share->keyinfo;
my_off_t key_file_length= share->state.state.key_file_length;
my_off_t pos= share->base.keystart;
DBUG_ENTER("mi_preload");
if (!keys || !key_map || key_file_length == pos)
return 0;
DBUG_RETURN(0);
block_length= keyinfo[0].block_length;
if (!key_map)
return 0;
/* Check whether all indexes use the same block size */
for (i= 1 ; i < keys ; i++)
{
if (keyinfo[i].block_length != block_length)
return (my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
}
length= info->preload_buff_size/block_length * block_length;
set_if_bigger(length, block_length);
if (!(buff= (uchar *) my_malloc(length, MYF(MY_WME))))
return (my_errno= HA_ERR_OUT_OF_MEM);
DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM);
if (flush_key_blocks(share->kfile, FLUSH_RELEASE))
goto err;
......@@ -78,7 +75,8 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
do
{
/* Read the next block of index file into the preload buffer */
set_if_smaller(length, key_file_length-pos);
if ((my_off_t) length > (key_file_length-pos))
length= (ulong) (key_file_length-pos);
if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE)))
goto err;
......@@ -103,16 +101,14 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
goto err;
pos+= length;
}
}
while (pos != key_file_length);
my_free(buff, MYF(0));
return 0;
DBUG_RETURN(0);
err:
my_free(buff, MYF(MY_ALLOW_ZERO_PTR));
return (my_errno= errno);
DBUG_RETURN(my_errno= errno);
}
......@@ -251,7 +251,7 @@ touch $BASE/innobase/ib_config.h
cd $SOURCE
for i in COPYING ChangeLog README \
INSTALL-SOURCE INSTALL-WIN \
INSTALL-WIN-SOURCE
INSTALL-WIN-SOURCE \
Docs/manual_toc.html Docs/manual.html \
Docs/mysqld_error.txt Docs/INSTALL-BINARY
......@@ -350,7 +350,7 @@ set_tarzip_options()
else
ZIPFILE1=zip
ZIPFILE2=""
OPT="-vr"
OPT="-r"
EXT=".zip"
NEED_COMPRESS=0
if [ "$SILENT" = "1" ] ; then
......@@ -382,6 +382,7 @@ print_debug "Using $tar to create archive"
cd $TMP
rm -f $SOURCE/$NEW_NAME$EXT
$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME
cd $SOURCE
......
......@@ -145,20 +145,19 @@ then
then
i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');
INSERT INTO user (host,user) values ('$hostname','');"
else
i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');"
i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);"
if test "$windows" -eq 0
then
i_u="$i_u
INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('$hostname','');"
fi
INSERT INTO user (host,user) values ('localhost','');
else
i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);"
fi
fi
fi
......
......@@ -57,6 +57,9 @@ then
elif test -x @bindir@/mysql_print_defaults
then
print_defaults="@bindir@/mysql_print_defaults"
elif test -x extra/my_print_defaults
then
print_defaults="extra/my_print_defaults"
else
print_defaults="my_print_defaults"
fi
......
......@@ -2022,7 +2022,6 @@ my_bool mysql_reconnect(MYSQL *mysql)
}
mysql_init(&tmp_mysql);
tmp_mysql.options=mysql->options;
bzero((char*) &mysql->options,sizeof(mysql->options));
tmp_mysql.rpl_pivot = mysql->rpl_pivot;
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
......@@ -2033,7 +2032,9 @@ my_bool mysql_reconnect(MYSQL *mysql)
strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate);
DBUG_RETURN(1);
}
tmp_mysql.free_me=mysql->free_me;
tmp_mysql.free_me= mysql->free_me;
/* Don't free options as these are now used in tmp_mysql */
bzero((char*) &mysql->options,sizeof(mysql->options));
mysql->free_me=0;
mysql_close(mysql);
*mysql=tmp_mysql;
......@@ -2070,9 +2071,6 @@ mysql_select_db(MYSQL *mysql, const char *db)
static void mysql_close_free_options(MYSQL *mysql)
{
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.host,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR));
......@@ -2099,14 +2097,17 @@ static void mysql_close_free_options(MYSQL *mysql)
if (mysql->options.shared_memory_base_name != def_shared_memory_base_name)
my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif /* HAVE_SMEM */
bzero((char*) &mysql->options,sizeof(mysql->options));
bzero((char*) &mysql->options,sizeof(mysql->options));
}
static void mysql_close_free(MYSQL *mysql)
{
/* Clear pointers for better safety */
my_free((gptr) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
/* Clear pointers for better safety */
mysql->host_info=mysql->user=mysql->passwd=mysql->db=0;
}
......
......@@ -39,7 +39,7 @@ Item::Item():
{
marker= 0;
maybe_null=null_value=with_sum_func=unsigned_flag=0;
coercibility=COER_COERCIBLE;
set_charset(&my_charset_bin, DERIVATION_COERCIBLE);
name= 0;
decimals= 0; max_length= 0;
THD *thd= current_thd;
......@@ -67,7 +67,7 @@ Item::Item(THD *thd, Item &item):
unsigned_flag(item.unsigned_flag),
with_sum_func(item.with_sum_func),
fixed(item.fixed),
coercibility(item.coercibility)
collation(item.collation)
{
next=thd->free_list; // Put in free list
thd->free_list= this;
......@@ -183,12 +183,12 @@ CHARSET_INFO * Item::default_charset() const
return current_thd->variables.collation_connection;
}
bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
CHARSET_INFO *cs2, enum coercion co2)
bool Item::set_charset(CHARSET_INFO *cs1, Derivation co1,
CHARSET_INFO *cs2, Derivation co2)
{
if (cs1 == &my_charset_bin || cs2 == &my_charset_bin)
{
set_charset(&my_charset_bin, COER_NOCOLL);
set_charset(&my_charset_bin, DERIVATION_NONE);
return 0;
}
......@@ -207,7 +207,7 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
{
if (cs1 != cs2)
{
if (co1 == COER_EXPLICIT)
if (co1 == DERIVATION_EXPLICIT)
{
return 1;
}
......@@ -216,7 +216,7 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
CHARSET_INFO *bin= get_charset_by_csname(cs1->csname, MY_CS_BINSORT,MYF(0));
if (!bin)
return 1;
set_charset(bin, COER_NOCOLL);
set_charset(bin, DERIVATION_NONE);
}
}
else
......@@ -228,7 +228,7 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
Item_field::Item_field(Field *f) :Item_ident(NullS,f->table_name,f->field_name)
{
set_field(f);
coercibility= COER_IMPLICIT;
set_charset(DERIVATION_IMPLICIT);
fixed= 1; // This item is not needed in fix_fields
}
......@@ -237,7 +237,7 @@ Item_field::Item_field(THD *thd, Item_field &item):
Item_ident(thd, item),
field(item.field),
result_field(item.result_field)
{ coercibility= COER_IMPLICIT; }
{ set_charset(DERIVATION_IMPLICIT); }
void Item_field::set_field(Field *field_par)
{
......@@ -249,7 +249,7 @@ void Item_field::set_field(Field *field_par)
field_name=field_par->field_name;
db_name=field_par->table->table_cache_key;
unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
set_charset(field_par->charset(), COER_IMPLICIT);
set_charset(field_par->charset(), DERIVATION_IMPLICIT);
}
const char *Item_ident::full_name() const
......@@ -1100,7 +1100,7 @@ Item_varbinary::Item_varbinary(const char *str, uint str_length)
str+=2;
}
*ptr=0; // Keep purify happy
coercibility= COER_COERCIBLE;
set_charset(&my_charset_bin, DERIVATION_COERCIBLE);
}
longlong Item_varbinary::val_int()
......
......@@ -23,6 +23,63 @@ class Protocol;
struct st_table_list;
void item_init(void); /* Init item functions */
/*
"Declared Type Collation"
A combination of collation and its deriviation.
*/
enum Derivation
{
DERIVATION_COERCIBLE= 3,
DERIVATION_IMPLICIT= 2,
DERIVATION_NONE= 1,
DERIVATION_EXPLICIT= 0
};
class DTCollation {
public:
CHARSET_INFO *collation;
enum Derivation derivation;
DTCollation()
{
collation= &my_charset_bin;
derivation= DERIVATION_NONE;
}
DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg)
{
collation= collation_arg;
derivation= derivation_arg;
}
void set(DTCollation *dt)
{
collation= dt->collation;
derivation= dt->derivation;
}
void set(CHARSET_INFO *collation_arg, Derivation derivation_arg)
{
collation= collation_arg;
derivation= derivation_arg;
}
void set(CHARSET_INFO *collation_arg)
{ collation= collation_arg; }
void set(Derivation derivation_arg)
{ derivation= derivation_arg; }
bool aggregate(DTCollation *dt);
const char *derivation_name() const
{
switch(derivation)
{
case DERIVATION_COERCIBLE: return "COERCIBLE";
case DERIVATION_IMPLICIT: return "IMPLICIT";
case DERIVATION_EXPLICIT: return "EXPLICIT";
case DERIVATION_NONE: return "NONE";
default: return "UNKNOWN";
}
}
};
class Item {
uint loop_id; /* Used to find selfrefering loops */
Item(const Item &); /* Prevent use of these */
......@@ -41,19 +98,6 @@ public:
SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM};
enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
enum coercion { COER_COERCIBLE=3, COER_IMPLICIT=2,
COER_NOCOLL=1, COER_EXPLICIT=0 };
const char *coercion_name(enum coercion coer) const
{
switch(coer)
{
case COER_COERCIBLE: return "COERCIBLE";
case COER_IMPLICIT: return "IMPLICIT";
case COER_EXPLICIT: return "EXPLICIT";
case COER_NOCOLL: return "NO COLLATION";
default: return "UNKNOWN";
}
}
String str_value; /* used to store value */
my_string name; /* Name from select */
......@@ -65,8 +109,8 @@ public:
my_bool unsigned_flag;
my_bool with_sum_func;
my_bool fixed; /* If item fixed with fix_fields */
enum coercion coercibility; /* Precedence order of collation */
DTCollation collation;
// alloc & destruct is done as start of select using sql_alloc
Item();
/*
......@@ -123,18 +167,27 @@ public:
virtual Item *real_item() { return this; }
virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
virtual bool binary() const
{ return str_value.charset()->state & MY_CS_BINSORT ? 1 : 0 ; }
CHARSET_INFO *default_charset() const;
CHARSET_INFO *charset() const { return str_value.charset(); };
void set_charset(CHARSET_INFO *cs) { str_value.set_charset(cs); }
void set_charset(CHARSET_INFO *cs, enum coercion coer)
{
str_value.set_charset(cs);
coercibility= coer;
Derivation derivation() const { return collation.derivation; }
CHARSET_INFO *charset() const { return collation.collation; }
void set_charset(CHARSET_INFO *cs)
{ collation.collation= cs; }
void set_charset(Derivation dv)
{ collation.derivation= dv; }
void set_charset(CHARSET_INFO *cs, Derivation dv)
{ collation.collation= cs; collation.derivation= dv; }
void set_charset(Item &item)
{ collation= item.collation; }
void set_charset(DTCollation *collation_arg)
{
collation.collation= collation_arg->collation;
collation.derivation= collation_arg->derivation;
}
bool set_charset(CHARSET_INFO *cs1, enum coercion co1,
CHARSET_INFO *cs2, enum coercion co2);
bool set_charset(CHARSET_INFO *cs1, Derivation dv1,
CHARSET_INFO *cs2, Derivation dv2);
bool binary() const
{ return charset()->state & MY_CS_BINSORT ? 1 : 0 ; }
virtual void set_outer_resolving() {}
// Row emulation
......@@ -180,7 +233,7 @@ public:
Item_field(const char *db_par,const char *table_name_par,
const char *field_name_par)
:Item_ident(db_par,table_name_par,field_name_par),field(0),result_field(0)
{ coercibility= COER_IMPLICIT; }
{ set_charset(DERIVATION_IMPLICIT); }
// Constructor need to process subselect with temporary tables (see Item)
Item_field(THD *thd, Item_field &item);
Item_field(Field *field);
......@@ -381,19 +434,19 @@ class Item_string :public Item
{
public:
Item_string(const char *str,uint length,
CHARSET_INFO *cs, enum coercion coer= COER_COERCIBLE)
CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
{
set_charset(cs, dv);
str_value.set(str,length,cs);
coercibility= coer;
max_length=length;
set_name(str, length, cs);
decimals=NOT_FIXED_DEC;
}
Item_string(const char *name_par, const char *str, uint length,
CHARSET_INFO *cs, enum coercion coer= COER_COERCIBLE)
CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
{
set_charset(cs, dv);
str_value.set(str,length,cs);
coercibility= coer;
max_length=length;
set_name(name_par,0,cs);
decimals=NOT_FIXED_DEC;
......
......@@ -23,6 +23,15 @@
#include "mysql_priv.h"
#include <m_ctype.h>
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname)
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
c1.collation->name,c1.derivation_name(),
c2.collation->name,c2.derivation_name(),
fname);
}
Item_bool_func2* Item_bool_func2::eq_creator(Item *a, Item *b)
{
return new Item_func_eq(a, b);
......@@ -87,13 +96,13 @@ static bool convert_constant_item(Field *field, Item **item)
return 0;
}
bool Item_bool_func2::set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1,
CHARSET_INFO *cs2, enum coercion co2)
bool Item_bool_func2::set_cmp_charset(CHARSET_INFO *cs1, Derivation co1,
CHARSET_INFO *cs2, Derivation co2)
{
if (cs1 == &my_charset_bin || cs2 == &my_charset_bin)
{
cmp_charset= &my_charset_bin;
coercibility= co1 > co2 ? co1 : co2;
//coercibility= co1 > co2 ? co1 : co2;
return 0;
}
......@@ -106,42 +115,42 @@ bool Item_bool_func2::set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1,
if ((co1 <= co2) && (cs1==&my_charset_bin))
{
cmp_charset= cs1;
coercibility= co1;
//coercibility= co1;
}
else if ((co2 <= co1) && (cs2==&my_charset_bin))
{
cmp_charset= cs2;
coercibility= co2;
//coercibility= co2;
}
else
{
cmp_charset= 0;
coercibility= COER_NOCOLL;
//coercibility= DERIVATION_NOCOLL;
return 1;
}
}
else if (co1 < co2)
{
cmp_charset= cs1;
coercibility= co1;
//coercibility= co1;
}
else if (co2 < co1)
{
cmp_charset= cs2;
coercibility= co1;
//coercibility= co1;
}
else
{
if (cs1 == cs2)
{
cmp_charset= cs1;
coercibility= co1;
//coercibility= co1;
}
else
{
coercibility= COER_NOCOLL;
//coercibility= DERIVATION_NOCOLL;
cmp_charset= 0;
return (co1 == COER_EXPLICIT) ? 1 : 0;
return (co1 == DERIVATION_EXPLICIT) ? 1 : 0;
}
}
return 0;
......@@ -171,13 +180,13 @@ bool Item_bool_func2::fix_fields(THD *thd, struct st_table_list *tables,
uint strong= 0;
uint weak= 0;
if ((args[0]->coercibility < args[1]->coercibility) &&
if ((args[0]->derivation() < args[1]->derivation()) &&
!my_charset_same(args[0]->charset(), args[1]->charset()) &&
(args[0]->charset()->state & MY_CS_UNICODE))
{
weak= 1;
}
else if ((args[1]->coercibility < args[0]->coercibility) &&
else if ((args[1]->derivation() < args[0]->derivation()) &&
!my_charset_same(args[0]->charset(), args[1]->charset()) &&
(args[1]->charset()->state & MY_CS_UNICODE))
{
......@@ -194,26 +203,23 @@ bool Item_bool_func2::fix_fields(THD *thd, struct st_table_list *tables,
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(),
args[strong]->charset());
conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(),
args[weak]->coercibility);
args[weak]->derivation());
((Item_string*)conv)->str_value.copy();
}
else
{
conv= new Item_func_conv_charset(args[weak],args[strong]->charset());
conv->coercibility= args[weak]->coercibility;
//conv->coercibility= args[weak]->derivation();
}
args[weak]= conv ? conv : args[weak];
set_cmp_charset(args[0]->charset(), args[0]->coercibility,
args[1]->charset(), args[1]->coercibility);
set_cmp_charset(args[0]->charset(), args[0]->derivation(),
args[1]->charset(), args[1]->derivation());
}
}
if (!cmp_charset)
{
/* set_cmp_charset() failed */
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[1]->charset()->name,coercion_name(args[1]->coercibility),
func_name());
my_coll_agg_error(args[0]->collation, args[1]->collation, func_name());
return 1;
}
return 0;
......@@ -266,8 +272,8 @@ void Item_bool_func2::fix_length_and_dec()
We must set cmp_charset here as we may be called from for an automatic
generated item, like in natural join
*/
set_cmp_charset(args[0]->charset(), args[0]->coercibility,
args[1]->charset(), args[1]->coercibility);
set_cmp_charset(args[0]->charset(), args[0]->derivation(),
args[1]->charset(), args[1]->derivation());
}
......@@ -744,12 +750,9 @@ Item_func_ifnull::fix_length_and_dec()
args[1]->result_type())) !=
REAL_RESULT)
decimals= 0;
if (set_charset(args[0]->charset(),args[0]->coercibility,
args[1]->charset(),args[1]->coercibility))
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[1]->charset()->name,coercion_name(args[1]->coercibility),
func_name());
if (set_charset(args[0]->charset(),args[0]->derivation(),
args[1]->charset(),args[1]->derivation()))
my_coll_agg_error(args[0]->collation, args[1]->collation, func_name());
}
......@@ -825,13 +828,10 @@ Item_func_if::fix_length_and_dec()
else if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
{
cached_result_type = STRING_RESULT;
if (set_charset(args[1]->charset(), args[1]->coercibility,
args[2]->charset(), args[2]->coercibility))
if (set_charset(args[1]->charset(), args[1]->derivation(),
args[2]->charset(), args[2]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[1]->charset()->name,coercion_name(args[1]->coercibility),
func_name());
my_coll_agg_error(args[0]->collation, args[1]->collation, func_name());
return;
}
}
......
......@@ -123,8 +123,8 @@ public:
{
cmp.set_cmp_func(this, tmp_arg, tmp_arg+1);
}
bool set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1,
CHARSET_INFO *cs2, enum coercion co2);
bool set_cmp_charset(CHARSET_INFO *cs1, Derivation co1,
CHARSET_INFO *cs2, Derivation co2);
optimize_type select_optimize() const { return OPTIMIZE_OP; }
virtual enum Functype rev_functype() const { return UNKNOWN_FUNC; }
bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; }
......
......@@ -450,7 +450,7 @@ Item *create_func_version(void)
{
return new Item_string(NullS,server_version,
(uint) strlen(server_version),
system_charset_info, Item::COER_IMPLICIT);
system_charset_info, DERIVATION_IMPLICIT);
}
Item *create_func_weekday(Item* a)
......
......@@ -31,6 +31,14 @@
#include <zlib.h>
#endif
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname)
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
c1.collation->name,c1.derivation_name(),
c2.collation->name,c2.derivation_name(),
fname);
}
/* return TRUE if item is a constant */
bool
......@@ -859,14 +867,11 @@ void Item_func_min_max::fix_length_and_dec()
maybe_null=0;
cmp_type=item_cmp_type(cmp_type,args[i]->result_type());
if (i==0)
set_charset(args[i]->charset(), args[i]->coercibility);
else if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
set_charset(*args[i]);
else if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -1038,7 +1043,7 @@ longlong Item_func_coercibility::val_int()
return 0;
}
null_value= 0;
return (longlong) args[0]->coercibility;
return (longlong) args[0]->derivation();
}
longlong Item_func_locate::val_int()
......@@ -2000,7 +2005,7 @@ Item_func_set_user_var::fix_length_and_dec()
void Item_func_set_user_var::update_hash(void *ptr, uint length,
Item_result type,
CHARSET_INFO *cs,
enum coercion coercibility)
Derivation dv)
{
if ((null_value=args[0]->null_value))
{
......@@ -2009,8 +2014,7 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
my_free(entry->value,MYF(0));
entry->value=0;
entry->length=0;
entry->var_charset=cs;
entry->var_coercibility= coercibility;
collation.set(cs, dv);
}
else
{
......@@ -2041,8 +2045,7 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
memcpy(entry->value,ptr,length);
entry->length= length;
entry->type=type;
entry->var_charset=cs;
entry->var_coercibility= coercibility;
entry->collation.set(cs, dv);
}
return;
......@@ -2085,7 +2088,7 @@ Item_func_set_user_var::val()
{
double value=args[0]->val();
update_hash((void*) &value,sizeof(value), REAL_RESULT,
&my_charset_bin, COER_NOCOLL);
&my_charset_bin, DERIVATION_NONE);
return value;
}
......@@ -2094,7 +2097,7 @@ Item_func_set_user_var::val_int()
{
longlong value=args[0]->val_int();
update_hash((void*) &value, sizeof(longlong), INT_RESULT,
&my_charset_bin, COER_NOCOLL);
&my_charset_bin, DERIVATION_NONE);
return value;
}
......@@ -2103,10 +2106,10 @@ Item_func_set_user_var::val_str(String *str)
{
String *res=args[0]->val_str(str);
if (!res) // Null value
update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin, COER_NOCOLL);
update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin, DERIVATION_NONE);
else
update_hash((void*) res->ptr(), res->length(), STRING_RESULT,
res->charset(), args[0]->coercibility);
res->charset(), args[0]->derivation());
return res;
}
......@@ -2147,7 +2150,7 @@ Item_func_get_user_var::val_str(String *str)
str->set(*(longlong*) entry->value, &my_charset_bin);
break;
case STRING_RESULT:
if (str->copy(entry->value, entry->length, entry->var_charset))
if (str->copy(entry->value, entry->length, entry->collation.collation))
{
null_value=1;
return NULL;
......@@ -2236,7 +2239,7 @@ void Item_func_get_user_var::fix_length_and_dec()
ALIGN_SIZE(sizeof(BINLOG_USER_VAR_EVENT));
user_var_event->user_var_event= var_entry;
user_var_event->type= var_entry->type;
user_var_event->charset_number= var_entry->var_charset->number;
user_var_event->charset_number= var_entry->collation.collation->number;
if (!var_entry->value)
{
/* NULL value*/
......
......@@ -943,7 +943,7 @@ public:
longlong val_int();
String *val_str(String *str);
void update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, enum coercion coercibility);
CHARSET_INFO *cs, Derivation dv);
bool update();
enum Item_result result_type () const { return cached_result_type; }
bool fix_fields(THD *thd, struct st_table_list *tables, Item **ref);
......
......@@ -36,6 +36,14 @@
String empty_string("",default_charset_info);
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname)
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
c1.collation->name,c1.derivation_name(),
c2.collation->name,c2.derivation_name(),
fname);
}
uint nr_of_decimals(const char *str)
{
if ((str=strchr(str,'.')))
......@@ -316,17 +324,14 @@ void Item_func_concat::fix_length_and_dec()
bool first_coll= 1;
max_length=0;
set_charset(args[0]->charset(),args[0]->coercibility);
set_charset(*args[0]);
for (uint i=0 ; i < arg_count ; i++)
{
max_length+=args[i]->max_length;
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -622,18 +627,15 @@ void Item_func_concat_ws::split_sum_func(Item **ref_pointer_array,
void Item_func_concat_ws::fix_length_and_dec()
{
set_charset(separator->charset(),separator->coercibility);
set_charset(*separator);
max_length=separator->max_length*(arg_count-1);
for (uint i=0 ; i < arg_count ; i++)
{
max_length+=args[i]->max_length;
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -702,7 +704,7 @@ String *Item_func_reverse::val_str(String *str)
void Item_func_reverse::fix_length_and_dec()
{
set_charset(args[0]->charset(),args[0]->coercibility);
set_charset(*args[0]);
max_length = args[0]->max_length;
}
......@@ -826,17 +828,14 @@ void Item_func_replace::fix_length_and_dec()
max_length=MAX_BLOB_WIDTH;
maybe_null=1;
}
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
for (i=1; i<3; i++)
{
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -876,13 +875,10 @@ null:
void Item_func_insert::fix_length_and_dec()
{
if (set_charset(args[0]->charset(), args[0]->coercibility,
args[3]->charset(), args[3]->coercibility))
if (set_charset(args[0]->charset(), args[0]->derivation(),
args[3]->charset(), args[3]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[3]->charset()->name,coercion_name(args[3]->coercibility),
func_name());
my_coll_agg_error(args[0]->collation, args[3]->collation, func_name());
}
max_length=args[0]->max_length+args[3]->max_length;
if (max_length > MAX_BLOB_WIDTH)
......@@ -963,7 +959,7 @@ void Item_str_func::left_right_max_length()
void Item_func_left::fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
left_right_max_length();
}
......@@ -990,7 +986,7 @@ String *Item_func_right::val_str(String *str)
void Item_func_right::fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
left_right_max_length();
}
......@@ -1024,7 +1020,7 @@ void Item_func_substr::fix_length_and_dec()
{
max_length=args[0]->max_length;
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
if (args[1]->const_item())
{
int32 start=(int32) args[1]->val_int()-1;
......@@ -1320,18 +1316,15 @@ void Item_func_trim::fix_length_and_dec()
max_length= args[0]->max_length;
if (arg_count == 1)
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
remove.set_charset(charset());
remove.set_ascii(" ",1);
}
else
if (set_charset(args[1]->charset(), args[1]->coercibility,
args[0]->charset(), args[0]->coercibility))
if (set_charset(args[1]->charset(), args[1]->derivation(),
args[0]->charset(), args[0]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[1]->charset()->name,coercion_name(args[1]->coercibility),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
func_name());
my_coll_agg_error(args[1]->collation, args[0]->collation, func_name());
}
}
......@@ -1545,7 +1538,7 @@ String *Item_func_user::val_str(String *str)
void Item_func_soundex::fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
max_length=args[0]->max_length;
set_if_bigger(max_length,4);
}
......@@ -1675,16 +1668,13 @@ void Item_func_elt::fix_length_and_dec()
set_if_bigger(max_length,args[i]->max_length);
set_if_bigger(decimals,args[i]->decimals);
if (i == 0)
set_charset(args[i]->charset(),args[i]->coercibility);
set_charset(*args[0]);
else
{
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -1780,17 +1770,14 @@ void Item_func_make_set::split_sum_func(Item **ref_pointer_array,
void Item_func_make_set::fix_length_and_dec()
{
max_length=arg_count-1;
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
for (uint i=0 ; i < arg_count ; i++)
{
max_length+=args[i]->max_length;
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......@@ -1916,7 +1903,7 @@ inline String* alloc_buffer(String *res,String *str,String *tmp_value,
void Item_func_repeat::fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
if (args[1]->const_item())
{
max_length=(long) (args[0]->max_length * args[1]->val_int());
......@@ -1976,13 +1963,10 @@ err:
void Item_func_rpad::fix_length_and_dec()
{
if (set_charset(args[0]->charset(), args[0]->coercibility,
args[2]->charset(), args[2]->coercibility))
if (set_charset(args[0]->charset(), args[0]->derivation(),
args[2]->charset(), args[2]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[2]->charset()->name,coercion_name(args[2]->coercibility),
func_name());
my_coll_agg_error(args[0]->collation, args[2]->collation, func_name());
}
if (args[1]->const_item())
......@@ -2045,13 +2029,10 @@ String *Item_func_rpad::val_str(String *str)
void Item_func_lpad::fix_length_and_dec()
{
if (set_charset(args[0]->charset(), args[0]->coercibility,
args[2]->charset(), args[2]->coercibility))
if (set_charset(args[0]->charset(), args[0]->derivation(),
args[2]->charset(), args[2]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
args[0]->charset()->name,coercion_name(args[0]->coercibility),
args[2]->charset()->name,coercion_name(args[2]->coercibility),
func_name());
my_coll_agg_error(args[0]->collation, args[2]->collation, func_name());
}
if (args[1]->const_item())
......@@ -2173,7 +2154,7 @@ void Item_func_conv_charset::fix_length_and_dec()
{
set_charset(conv_charset);
max_length = args[0]->max_length*conv_charset->mbmaxlen;
set_charset(conv_charset, COER_IMPLICIT);
set_charset(conv_charset, DERIVATION_IMPLICIT);
}
......@@ -2277,7 +2258,7 @@ void Item_func_set_collation::fix_length_and_dec()
colname,args[0]->charset()->csname);
return;
}
set_charset(set_collation, COER_EXPLICIT);
set_charset(set_collation, DERIVATION_EXPLICIT);
max_length= args[0]->max_length;
}
......@@ -2468,16 +2449,13 @@ void Item_func_export_set::fix_length_and_dec()
uint sep_length=(arg_count > 3 ? args[3]->max_length : 1);
max_length=length*64+sep_length*63;
set_charset(args[1]->charset(), args[1]->coercibility);
set_charset(*args[1]);
for (i=2 ; i < 4 && i < arg_count ; i++)
{
if (set_charset(charset(), coercibility,
args[i]->charset(), args[i]->coercibility))
if (set_charset(charset(), derivation(),
args[i]->charset(), args[i]->derivation()))
{
my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0),
charset()->name,coercion_name(coercibility),
args[i]->charset()->name,coercion_name(args[i]->coercibility),
func_name());
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
}
......
......@@ -153,7 +153,7 @@ public:
Item_str_conv(Item *item) :Item_str_func(item) {}
void fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
max_length = args[0]->max_length;
}
};
......@@ -335,7 +335,7 @@ public:
class Item_func_database :public Item_str_func
{
public:
Item_func_database() { coercibility= COER_IMPLICIT; }
Item_func_database() { set_charset(DERIVATION_IMPLICIT); }
String *val_str(String *);
void fix_length_and_dec()
{
......@@ -348,7 +348,7 @@ public:
class Item_func_user :public Item_str_func
{
public:
Item_func_user() { coercibility= COER_IMPLICIT; }
Item_func_user() { set_charset(DERIVATION_IMPLICIT); }
String *val_str(String *);
void fix_length_and_dec()
{
......@@ -549,7 +549,7 @@ public:
const char *func_name() const { return "load_file"; }
void fix_length_and_dec()
{
set_charset(&my_charset_bin, COER_COERCIBLE);
set_charset(&my_charset_bin, DERIVATION_COERCIBLE);
maybe_null=1;
max_length=MAX_BLOB_WIDTH;
}
......@@ -586,7 +586,7 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
set_charset(args[0]->charset(), args[0]->coercibility);
set_charset(*args[0]);
max_length= args[0]->max_length * 2 + 2;
}
};
......
......@@ -57,7 +57,8 @@ Item_sum::Item_sum(THD *thd, Item_sum &item):
void Item_sum::mark_as_sum_func()
{
current_thd->lex.current_select->with_sum_func= with_sum_func= 1;
current_thd->lex.current_select->with_sum_func= 1;
with_sum_func= 1;
}
......
......@@ -2230,7 +2230,7 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
}
Item_func_set_user_var e(user_var_name, it);
e.fix_fields(thd, 0, 0);
e.update_hash(val, val_len, type, charset, Item::COER_NOCOLL);
e.update_hash(val, val_len, type, charset, DERIVATION_NONE);
free_root(&thd->mem_root,0);
rli->inc_event_relay_log_pos(get_event_len());
......
......@@ -2177,7 +2177,7 @@ extern "C" pthread_handler_decl(handle_slave_io,arg)
DBUG_ENTER("handle_slave_io");
#ifndef DBUG_OFF
slave_begin:
slave_begin:
#endif
DBUG_ASSERT(mi->inited);
mysql= NULL ;
......@@ -2218,7 +2218,7 @@ slave_begin:
if (!(mi->mysql = mysql = mysql_init(NULL)))
{
sql_print_error("Slave I/O thread: error in mc_mysql_init()");
sql_print_error("Slave I/O thread: error in mysql_init()");
goto err;
}
......@@ -2270,7 +2270,7 @@ dump");
goto err;
}
thd->proc_info = "Waiiting to reconnect after a failed dump request";
thd->proc_info = "Waiting to reconnect after a failed dump request";
end_server(mysql);
/*
First time retry immediately, assuming that we can recover
......@@ -3075,7 +3075,8 @@ replication resumed in log '%s' at position %s", mi->user,
static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
bool suppress_warnings)
{
return connect_to_master(thd, mysql, mi, 1, suppress_warnings);
DBUG_ENTER("safe_reconnect");
DBUG_RETURN(connect_to_master(thd, mysql, mi, 1, suppress_warnings));
}
......
......@@ -975,8 +975,7 @@ class user_var_entry
char *value;
ulong length, update_query_id, used_query_id;
Item_result type;
CHARSET_INFO *var_charset;
enum Item::coercion var_coercibility;
DTCollation collation;
};
/* Class for unique (removing of duplicates) */
......
......@@ -18,7 +18,7 @@
This files defines some MySQL C API functions that are server specific
*/
#include <mysql_priv.h>
#include "mysql_priv.h"
/*
Function called by my_net_init() to set some check variables
......
......@@ -22,6 +22,8 @@ struct st_find_field
Field *field;
};
static void free_select(SQL_SELECT *sel);
/* Used fields */
static struct st_find_field init_used_fields[]=
......@@ -62,6 +64,7 @@ enum enum_used_fields
help_relation_help_keyword_id
};
/*
Fill st_find_field structure with pointers to fields
......@@ -94,8 +97,8 @@ static bool init_fields(THD *thd, TABLE_LIST *tables,
DBUG_RETURN(0);
}
/*
/*
Returns variants of found topic for help (if it is just single topic,
returns description and example, or else returns only names..)
......@@ -135,7 +138,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count,
}
else
{
if (count==1)
if (count == 1)
names->push_back(name);
String *new_name= new String;
get_field(mem_root,find_fields[help_topic_name].field,new_name);
......@@ -557,7 +560,7 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol,
String **end= pointers + names->elements;
List_iterator<String> it(*names);
for ( pos= pointers; pos!=end; (*pos++= it++));
for (pos= pointers; pos!=end; (*pos++= it++));
qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp);
......@@ -627,6 +630,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
return prepare_simple_select(thd,cond,tables,table,error);
}
/*
Server-side function 'help'
......@@ -783,6 +787,21 @@ int mysqld_help(THD *thd, const char *mask)
res= 0;
send_eof(thd);
end:
free_select(select_topics_by_name);
free_select(select_keyword_by_name);
free_select(select_cat_by_name);
free_select(select_topics_by_cat);
free_select(select_cat_by_cat);
free_select(select_root_cats);
DBUG_RETURN(res);
}
static void free_select(SQL_SELECT *sel)
{
if (sel)
delete sel->quick;
}
......@@ -4142,10 +4142,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case STRING_RESULT:
if (item->max_length > 255)
new_field= new Field_blob(item->max_length,maybe_null,
item->name,table,item->str_value.charset());
item->name,table,item->charset());
else
new_field= new Field_string(item->max_length,maybe_null,
item->name,table,item->str_value.charset());
item->name,table,item->charset());
break;
case ROW_RESULT:
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment