Commit b91567cf authored by matthias@three.local.lan's avatar matthias@three.local.lan

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

into three.local.lan:/home/matthias/Arbeit/mysql-4.1/src
parents 621daba7 2083ecd1
......@@ -945,3 +945,4 @@ libmysqld/ha_example.cc
libmysqld/ha_tina.cc
analyse.test
client/mysqladmin.c
mysql-4.1.8-win-src.zip
......@@ -42,8 +42,8 @@ RSC=rc.exe
# PROP Output_Dir ".\debug"
# PROP Intermediate_Dir ".\debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "_DEBUG"
......@@ -52,8 +52,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 classic"
......@@ -77,8 +77,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
......@@ -102,8 +102,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ENDIF
......
......@@ -2,7 +2,7 @@
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mysql_test_run_new - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
......@@ -17,8 +17,8 @@ CFG=mysql_test_run_new - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
......@@ -33,51 +33,51 @@ RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Output_Dir ".\Debug"
# PROP BASE Intermediate_Dir ".\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Output_Dir ".\Debug"
# PROP Intermediate_Dir ".\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /win32
# ADD MTL /nologo /win32
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
!ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Output_Dir ".\Release"
# PROP BASE Intermediate_Dir ".\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX
# ADD BASE MTL /nologo /win32
# ADD MTL /nologo /win32
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
!ENDIF
......@@ -87,19 +87,19 @@ LINK32=link.exe
# Name "mysql_test_run_new - Win32 Release"
# Begin Source File
SOURCE=my_create_tables.c
SOURCE=.\my_create_tables.c
# End Source File
# Begin Source File
SOURCE=my_manage.c
SOURCE=.\my_manage.c
# End Source File
# Begin Source File
SOURCE=my_manage.h
SOURCE=.\my_manage.h
# End Source File
# Begin Source File
SOURCE=mysql_test_run_new.c
SOURCE=.\mysql_test_run_new.c
# End Source File
# End Target
# End Project
......
......@@ -824,11 +824,20 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libmysql
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
Begin Project Dependency
Project_Dep_Name regex
End Project Dependency
}}}
###############################################################################
Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4>
Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
Package=<5>
{{{
......@@ -836,6 +845,12 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name mysqltest
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysqladmin
End Project Dependency
}}}
###############################################################################
......
......@@ -227,7 +227,7 @@ typedef struct
int alloced;
} VAR;
#ifdef __NETWARE__
#if defined(__NETWARE__) || defined(__WIN__)
/*
Netware doesn't proved environment variable substitution that is done
by the shell in unix environments. We do this in the following function:
......@@ -4600,6 +4600,9 @@ static char *subst_env_var(const char *str)
*/
#undef popen /* Remove wrapper */
#ifdef __WIN__
#define popen _popen /* redefine for windows */
#endif
FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
{
......
......@@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */
#define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052
......@@ -78,7 +78,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
......@@ -137,7 +139,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
#else /* ENGLISH */
......@@ -194,7 +198,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
#endif
......
......@@ -2139,12 +2139,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt)
DESCRIPTION
This function should be used after mysql_stmt_execute().
You can safely check that prepared statement has a result set by calling
mysql_stmt_num_fields(): if number of fields is not zero, you can call
mysql_stmt_field_count(): if number of fields is not zero, you can call
this function to get fields metadata.
Next steps you may want to make:
- find out number of columns in result set by calling
mysql_num_fields(res) (the same value is returned by
mysql_stmt_num_fields)
mysql_stmt_field_count())
- fetch metadata for any column with mysql_fetch_field,
mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek.
- free returned MYSQL_RES structure with mysql_free_result.
......@@ -3882,11 +3882,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
if (!bind_count)
{
if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
{
set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
}
DBUG_RETURN(0);
int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ?
CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA;
set_stmt_error(stmt, errorcode, unknown_sqlstate);
DBUG_RETURN(1);
}
/*
......@@ -4278,7 +4277,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
row+= (stmt->field_count+9)/8; /* skip null bits */
bit= 4; /* first 2 bits are reserved */
/* Go throw all fields and calculate metadata */
/* Go through all fields and calculate metadata */
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
bind < end ;
bind++, field++)
......
......@@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
IO_CACHE *to_file,
char* key, uint sort_length,
uint count);
inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs);
static inline int
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs);
/*
Creates a index of sorted keys
......@@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
} /* write_keys */
inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
static inline int
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
{
int err;
uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs);
......
......@@ -39,7 +39,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I..
EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
dist-hook:
......
#include <stdio.h>
#include <errno.h>
#ifndef __WIN__
#include <dirent.h>
#endif
#include <string.h>
#ifdef __NETWARE__
#include <screen.h>
#include <proc.h>
#else
#include <sys/types.h>
#ifndef __WIN__
#include <sys/wait.h>
#include <unistd.h>
#else
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#endif
#endif
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include "my_manage.h"
/*
Synopsis:
This function testes a exist file
Arguments:
mdata: path to data
file_name: name of file
Output:
A zero value indicates that file is exist.
*/
bool test_sys_file(const char *mdata,const char *file_name)
{
struct stat file;
char path_file_name[PATH_MAX];
snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name);
return(stat(path_file_name,&file));
}
/*
Synopsis:
This function creates a file with sql requstes for creating
system data files.
Arguments:
mdata: path to data
output_file: file name for output file
test: to create system files with test data
Output:
A zero value indicates a success.
*/
bool create_system_files(const char *mdata,const char *output_file, bool test)
{
FILE *out;
out = fopen(output_file, "w+");
if (!out)
return 1;
if (test_sys_file(mdata,"mysql"))
{
fprintf(out,"CREATE DATABASE mysql;\n");
}
if (test && test_sys_file(mdata,"test"))
{
fprintf(out,"CREATE DATABASE test;\n");
}
fprintf(out,"USE mysql;\n");
if (test_sys_file(mdata,"mysql/db.frm"))
{
fprintf(out,
"CREATE TABLE db ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db,User),"
"KEY User (User))"
"comment='Database privileges';\n");
if (test)
{
fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'"
",'Y','Y','N','Y','Y','Y','Y','Y');\n");
fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'"
",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n");
}
}
if (test_sys_file(mdata,"mysql/host.frm"))
{
fprintf(out,
"CREATE TABLE host ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db))"
"comment='Host privileges;"
" Merged with database privileges';\n");
}
if (test_sys_file(mdata,"mysql/user.frm"))
{
#ifdef __WIN__
WSADATA wsa_data;
#endif
char hostname[FN_REFLEN];
#ifdef __WIN__
if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data))
return 1;
#endif
if (gethostname(hostname, FN_REFLEN))
return 1;
#ifdef __WIN__
WSACleanup( );
#endif
if (strchr(hostname, '.') == NULL)
strcat(hostname, "%");
fprintf(out,
"CREATE TABLE user ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Password char(41) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
"ssl_cipher BLOB NOT NULL,"
"x509_issuer BLOB NOT NULL,"
"x509_subject BLOB NOT NULL,"
"max_questions int(11) unsigned DEFAULT 0 NOT NULL,"
"max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
"max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
"PRIMARY KEY Host (Host,User)"
") comment='Users and global privileges';\n");
if (test)
{
fprintf(out,
"INSERT INTO user VALUES ('localhost','root',''"
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
",'Y','Y','Y','Y','Y','','','','',0,0,0);\n");
fprintf(out,
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','','','','',0,0,0);\n",hostname);
fprintf(out,
"REPLACE INTO user VALUES ('127.0.0.1','root','',"
"'Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
",'Y','','','','',0,0,0);\n");
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
}
else
{
fprintf(out,
"INSERT INTO user VALUES ('localhost','root','',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','','','','',0,0,0);\n");
#ifndef __WIN__
fprintf(out,
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
"'Y','Y','Y','Y','Y','Y'"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''"
",'','',0,0,0);\n",hostname);
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
#else
fprintf(out,
"INSERT INTO user VALUES ('localhost','','','Y','Y','Y'"
",'Y','Y','Y','Y','Y','Y'"
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','',"
"'','',0,0,0);\n");
#endif
}
}
if (test_sys_file(mdata,"mysql/func.frm"))
{
fprintf(out,
"CREATE TABLE func ("
"name char(64) binary DEFAULT '' NOT NULL,"
"ret tinyint(1) DEFAULT '0' NOT NULL,"
"dl char(128) DEFAULT '' NOT NULL,"
"type enum ('function','aggregate') NOT NULL,"
"PRIMARY KEY (name)"
") comment='User defined functions';\n");
}
if (test_sys_file(mdata,"mysql/tables_priv.frm"))
{
fprintf(out,
"CREATE TABLE tables_priv ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Table_name char(64) binary DEFAULT '' NOT NULL,"
"Grantor char(77) DEFAULT '' NOT NULL,"
"Timestamp timestamp(14),"
"Table_priv set('Select','Insert','Update','Delete',"
"'Create','Drop','Grant','References','Index','Alter')"
" DEFAULT '' NOT NULL,"
"Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name),"
"KEY Grantor (Grantor)"
") comment='Table privileges';\n");
}
if (test_sys_file(mdata,"mysql/columns_priv.frm"))
{
fprintf(out,
"CREATE TABLE columns_priv ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Table_name char(64) binary DEFAULT '' NOT NULL,"
"Column_name char(64) binary DEFAULT '' NOT NULL,"
"Timestamp timestamp(14),"
"Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
") comment='Column privileges';\n");
}
if (test_sys_file(mdata,"mysql/help_topic.frm"))
{
fprintf(out,
"CREATE TABLE help_topic ("
"help_topic_id int unsigned not null,"
"name varchar(64) not null,"
"help_category_id smallint unsigned not null,"
"description text not null,"
"example text not null,"
"url varchar(128) not null,"
"primary key (help_topic_id),"
"unique index (name)"
") comment='help topics';\n");
}
if (test_sys_file(mdata,"mysql/help_category.frm"))
{
fprintf(out,
"CREATE TABLE help_category ("
"help_category_id smallint unsigned not null,"
"name varchar(64) not null,"
"parent_category_id smallint unsigned null,"
"url varchar(128) not null,"
"primary key (help_category_id),"
"unique index (name)"
") comment='help categories';\n");
}
if (test_sys_file(mdata,"mysql/help_keyword.frm"))
{
fprintf(out,
"CREATE TABLE help_keyword ("
"help_keyword_id int unsigned not null,"
"name varchar(64) not null,"
"primary key (help_keyword_id),"
"unique index (name)"
") comment='help keywords';\n");
}
if (test_sys_file(mdata,"mysql/help_relation.frm"))
{
fprintf(out,
"CREATE TABLE help_relation ("
"help_topic_id int unsigned not null references help_topic,"
"help_keyword_id int unsigned not null references help_keyword,"
"primary key (help_keyword_id, help_topic_id)"
") comment='keyword-topic relation';\n");
}
if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_name ("
"Name char(64) NOT NULL,"
"Time_zone_id int unsigned NOT NULL,"
"PRIMARY KEY Name (Name)"
") DEFAULT CHARACTER SET latin1 "
"comment='Time zone names';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
"('MET', 1), ('UTC', 2), ('Universal', 2), "
"('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone.frm"))
{
fprintf(out,
"CREATE TABLE time_zone ("
"Time_zone_id int unsigned NOT NULL auto_increment,"
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY TzId (Time_zone_id)"
") DEFAULT CHARACTER SET latin1 "
"comment='Time zones';\n");
if (test)
{
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_transition.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_transition ("
"Time_zone_id int unsigned NOT NULL,"
"Transition_time bigint signed NOT NULL,"
"Transition_type_id int unsigned NOT NULL,"
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
") DEFAULT CHARACTER SET latin1 "
"comment='Time zone transitions';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_transition"
"(Time_zone_id, Transition_time, Transition_type_id)"
"VALUES"
" (1, -1693706400, 0) ,(1, -1680483600, 1)"
",(1, -1663455600, 2) ,(1, -1650150000, 3)"
",(1, -1632006000, 2) ,(1, -1618700400, 3)"
",(1, -938905200, 2) ,(1, -857257200, 3)"
",(1, -844556400, 2) ,(1, -828226800, 3)"
",(1, -812502000, 2) ,(1, -796777200, 3)"
",(1, 228877200, 2) ,(1, 243997200, 3)"
",(1, 260326800, 2) ,(1, 276051600, 3)"
",(1, 291776400, 2) ,(1, 307501200, 3)"
",(1, 323830800, 2) ,(1, 338950800, 3)"
",(1, 354675600, 2) ,(1, 370400400, 3)"
",(1, 386125200, 2) ,(1, 401850000, 3)"
",(1, 417574800, 2) ,(1, 433299600, 3)"
",(1, 449024400, 2) ,(1, 465354000, 3)"
",(1, 481078800, 2) ,(1, 496803600, 3)"
",(1, 512528400, 2) ,(1, 528253200, 3)"
",(1, 543978000, 2) ,(1, 559702800, 3)"
",(1, 575427600, 2) ,(1, 591152400, 3)"
",(1, 606877200, 2) ,(1, 622602000, 3)"
",(1, 638326800, 2) ,(1, 654656400, 3)"
",(1, 670381200, 2) ,(1, 686106000, 3)"
",(1, 701830800, 2) ,(1, 717555600, 3)"
",(1, 733280400, 2) ,(1, 749005200, 3)"
",(1, 764730000, 2) ,(1, 780454800, 3)"
",(1, 796179600, 2) ,(1, 811904400, 3)"
",(1, 828234000, 2) ,(1, 846378000, 3)"
",(1, 859683600, 2) ,(1, 877827600, 3)"
",(1, 891133200, 2) ,(1, 909277200, 3)"
",(1, 922582800, 2) ,(1, 941331600, 3)"
",(1, 954032400, 2) ,(1, 972781200, 3)"
",(1, 985482000, 2) ,(1, 1004230800, 3)"
",(1, 1017536400, 2) ,(1, 1035680400, 3)"
",(1, 1048986000, 2) ,(1, 1067130000, 3)"
",(1, 1080435600, 2) ,(1, 1099184400, 3)"
",(1, 1111885200, 2) ,(1, 1130634000, 3)"
",(1, 1143334800, 2) ,(1, 1162083600, 3)"
",(1, 1174784400, 2) ,(1, 1193533200, 3)"
",(1, 1206838800, 2) ,(1, 1224982800, 3)"
",(1, 1238288400, 2) ,(1, 1256432400, 3)"
",(1, 1269738000, 2) ,(1, 1288486800, 3)"
",(1, 1301187600, 2) ,(1, 1319936400, 3)"
",(1, 1332637200, 2) ,(1, 1351386000, 3)"
",(1, 1364691600, 2) ,(1, 1382835600, 3)"
",(1, 1396141200, 2) ,(1, 1414285200, 3)"
",(1, 1427590800, 2) ,(1, 1445734800, 3)"
",(1, 1459040400, 2) ,(1, 1477789200, 3)"
",(1, 1490490000, 2) ,(1, 1509238800, 3)"
",(1, 1521939600, 2) ,(1, 1540688400, 3)"
",(1, 1553994000, 2) ,(1, 1572138000, 3)"
",(1, 1585443600, 2) ,(1, 1603587600, 3)"
",(1, 1616893200, 2) ,(1, 1635642000, 3)"
",(1, 1648342800, 2) ,(1, 1667091600, 3)"
",(1, 1679792400, 2) ,(1, 1698541200, 3)"
",(1, 1711846800, 2) ,(1, 1729990800, 3)"
",(1, 1743296400, 2) ,(1, 1761440400, 3)"
",(1, 1774746000, 2) ,(1, 1792890000, 3)"
",(1, 1806195600, 2) ,(1, 1824944400, 3)"
",(1, 1837645200, 2) ,(1, 1856394000, 3)"
",(1, 1869094800, 2) ,(1, 1887843600, 3)"
",(1, 1901149200, 2) ,(1, 1919293200, 3)"
",(1, 1932598800, 2) ,(1, 1950742800, 3)"
",(1, 1964048400, 2) ,(1, 1982797200, 3)"
",(1, 1995498000, 2) ,(1, 2014246800, 3)"
",(1, 2026947600, 2) ,(1, 2045696400, 3)"
",(1, 2058397200, 2) ,(1, 2077146000, 3)"
",(1, 2090451600, 2) ,(1, 2108595600, 3)"
",(1, 2121901200, 2) ,(1, 2140045200, 3)"
",(3, -1688265000, 2) ,(3, -1656819048, 1)"
",(3, -1641353448, 2) ,(3, -1627965048, 3)"
",(3, -1618716648, 1) ,(3, -1596429048, 3)"
",(3, -1593829848, 5) ,(3, -1589860800, 4)"
",(3, -1542427200, 5) ,(3, -1539493200, 6)"
",(3, -1525323600, 5) ,(3, -1522728000, 4)"
",(3, -1491188400, 7) ,(3, -1247536800, 4)"
",(3, 354920400, 5) ,(3, 370728000, 4)"
",(3, 386456400, 5) ,(3, 402264000, 4)"
",(3, 417992400, 5) ,(3, 433800000, 4)"
",(3, 449614800, 5) ,(3, 465346800, 8)"
",(3, 481071600, 9) ,(3, 496796400, 8)"
",(3, 512521200, 9) ,(3, 528246000, 8)"
",(3, 543970800, 9) ,(3, 559695600, 8)"
",(3, 575420400, 9) ,(3, 591145200, 8)"
",(3, 606870000, 9) ,(3, 622594800, 8)"
",(3, 638319600, 9) ,(3, 654649200, 8)"
",(3, 670374000, 10) ,(3, 686102400, 11)"
",(3, 695779200, 8) ,(3, 701812800, 5)"
",(3, 717534000, 4) ,(3, 733273200, 9)"
",(3, 748998000, 8) ,(3, 764722800, 9)"
",(3, 780447600, 8) ,(3, 796172400, 9)"
",(3, 811897200, 8) ,(3, 828226800, 9)"
",(3, 846370800, 8) ,(3, 859676400, 9)"
",(3, 877820400, 8) ,(3, 891126000, 9)"
",(3, 909270000, 8) ,(3, 922575600, 9)"
",(3, 941324400, 8) ,(3, 954025200, 9)"
",(3, 972774000, 8) ,(3, 985474800, 9)"
",(3, 1004223600, 8) ,(3, 1017529200, 9)"
",(3, 1035673200, 8) ,(3, 1048978800, 9)"
",(3, 1067122800, 8) ,(3, 1080428400, 9)"
",(3, 1099177200, 8) ,(3, 1111878000, 9)"
",(3, 1130626800, 8) ,(3, 1143327600, 9)"
",(3, 1162076400, 8) ,(3, 1174777200, 9)"
",(3, 1193526000, 8) ,(3, 1206831600, 9)"
",(3, 1224975600, 8) ,(3, 1238281200, 9)"
",(3, 1256425200, 8) ,(3, 1269730800, 9)"
",(3, 1288479600, 8) ,(3, 1301180400, 9)"
",(3, 1319929200, 8) ,(3, 1332630000, 9)"
",(3, 1351378800, 8) ,(3, 1364684400, 9)"
",(3, 1382828400, 8) ,(3, 1396134000, 9)"
",(3, 1414278000, 8) ,(3, 1427583600, 9)"
",(3, 1445727600, 8) ,(3, 1459033200, 9)"
",(3, 1477782000, 8) ,(3, 1490482800, 9)"
",(3, 1509231600, 8) ,(3, 1521932400, 9)"
",(3, 1540681200, 8) ,(3, 1553986800, 9)"
",(3, 1572130800, 8) ,(3, 1585436400, 9)"
",(3, 1603580400, 8) ,(3, 1616886000, 9)"
",(3, 1635634800, 8) ,(3, 1648335600, 9)"
",(3, 1667084400, 8) ,(3, 1679785200, 9)"
",(3, 1698534000, 8) ,(3, 1711839600, 9)"
",(3, 1729983600, 8) ,(3, 1743289200, 9)"
",(3, 1761433200, 8) ,(3, 1774738800, 9)"
",(3, 1792882800, 8) ,(3, 1806188400, 9)"
",(3, 1824937200, 8) ,(3, 1837638000, 9)"
",(3, 1856386800, 8) ,(3, 1869087600, 9)"
",(3, 1887836400, 8) ,(3, 1901142000, 9)"
",(3, 1919286000, 8) ,(3, 1932591600, 9)"
",(3, 1950735600, 8) ,(3, 1964041200, 9)"
",(3, 1982790000, 8) ,(3, 1995490800, 9)"
",(3, 2014239600, 8) ,(3, 2026940400, 9)"
",(3, 2045689200, 8) ,(3, 2058390000, 9)"
",(3, 2077138800, 8) ,(3, 2090444400, 9)"
",(3, 2108588400, 8) ,(3, 2121894000, 9)"
",(3, 2140038000, 8)"
",(4, -1688265000, 2) ,(4, -1656819048, 1)"
",(4, -1641353448, 2) ,(4, -1627965048, 3)"
",(4, -1618716648, 1) ,(4, -1596429048, 3)"
",(4, -1593829848, 5) ,(4, -1589860800, 4)"
",(4, -1542427200, 5) ,(4, -1539493200, 6)"
",(4, -1525323600, 5) ,(4, -1522728000, 4)"
",(4, -1491188400, 7) ,(4, -1247536800, 4)"
",(4, 354920409, 5) ,(4, 370728010, 4)"
",(4, 386456410, 5) ,(4, 402264011, 4)"
",(4, 417992411, 5) ,(4, 433800012, 4)"
",(4, 449614812, 5) ,(4, 465346812, 8)"
",(4, 481071612, 9) ,(4, 496796413, 8)"
",(4, 512521213, 9) ,(4, 528246013, 8)"
",(4, 543970813, 9) ,(4, 559695613, 8)"
",(4, 575420414, 9) ,(4, 591145214, 8)"
",(4, 606870014, 9) ,(4, 622594814, 8)"
",(4, 638319615, 9) ,(4, 654649215, 8)"
",(4, 670374016, 10) ,(4, 686102416, 11)"
",(4, 695779216, 8) ,(4, 701812816, 5)"
",(4, 717534017, 4) ,(4, 733273217, 9)"
",(4, 748998018, 8) ,(4, 764722818, 9)"
",(4, 780447619, 8) ,(4, 796172419, 9)"
",(4, 811897219, 8) ,(4, 828226820, 9)"
",(4, 846370820, 8) ,(4, 859676420, 9)"
",(4, 877820421, 8) ,(4, 891126021, 9)"
",(4, 909270021, 8) ,(4, 922575622, 9)"
",(4, 941324422, 8) ,(4, 954025222, 9)"
",(4, 972774022, 8) ,(4, 985474822, 9)"
",(4, 1004223622, 8) ,(4, 1017529222, 9)"
",(4, 1035673222, 8) ,(4, 1048978822, 9)"
",(4, 1067122822, 8) ,(4, 1080428422, 9)"
",(4, 1099177222, 8) ,(4, 1111878022, 9)"
",(4, 1130626822, 8) ,(4, 1143327622, 9)"
",(4, 1162076422, 8) ,(4, 1174777222, 9)"
",(4, 1193526022, 8) ,(4, 1206831622, 9)"
",(4, 1224975622, 8) ,(4, 1238281222, 9)"
",(4, 1256425222, 8) ,(4, 1269730822, 9)"
",(4, 1288479622, 8) ,(4, 1301180422, 9)"
",(4, 1319929222, 8) ,(4, 1332630022, 9)"
",(4, 1351378822, 8) ,(4, 1364684422, 9)"
",(4, 1382828422, 8) ,(4, 1396134022, 9)"
",(4, 1414278022, 8) ,(4, 1427583622, 9)"
",(4, 1445727622, 8) ,(4, 1459033222, 9)"
",(4, 1477782022, 8) ,(4, 1490482822, 9)"
",(4, 1509231622, 8) ,(4, 1521932422, 9)"
",(4, 1540681222, 8) ,(4, 1553986822, 9)"
",(4, 1572130822, 8) ,(4, 1585436422, 9)"
",(4, 1603580422, 8) ,(4, 1616886022, 9)"
",(4, 1635634822, 8) ,(4, 1648335622, 9)"
",(4, 1667084422, 8) ,(4, 1679785222, 9)"
",(4, 1698534022, 8) ,(4, 1711839622, 9)"
",(4, 1729983622, 8) ,(4, 1743289222, 9)"
",(4, 1761433222, 8) ,(4, 1774738822, 9)"
",(4, 1792882822, 8) ,(4, 1806188422, 9)"
",(4, 1824937222, 8) ,(4, 1837638022, 9)"
",(4, 1856386822, 8) ,(4, 1869087622, 9)"
",(4, 1887836422, 8) ,(4, 1901142022, 9)"
",(4, 1919286022, 8) ,(4, 1932591622, 9)"
",(4, 1950735622, 8) ,(4, 1964041222, 9)"
",(4, 1982790022, 8) ,(4, 1995490822, 9)"
",(4, 2014239622, 8) ,(4, 2026940422, 9)"
",(4, 2045689222, 8) ,(4, 2058390022, 9)"
",(4, 2077138822, 8) ,(4, 2090444422, 9)"
",(4, 2108588422, 8) ,(4, 2121894022, 9)"
",(4, 2140038022, 8);\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_transition_type ("
"Time_zone_id int unsigned NOT NULL,"
"Transition_type_id int unsigned NOT NULL,"
"Offset int signed DEFAULT 0 NOT NULL,"
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
"Abbreviation char(8) DEFAULT '' NOT NULL,"
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
") DEFAULT CHARACTER SET latin1 "
"comment='Time zone transition types';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_transition_type (Time_zone_id,"
"Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
"(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
",(2, 0, 0, 0, 'UTC')"
",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_leap_second ("
"Transition_time bigint signed NOT NULL,"
"Correction int signed NOT NULL,"
"PRIMARY KEY TranTime (Transition_time)"
") DEFAULT CHARACTER SET latin1 "
"comment='Leap seconds information for time zones';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_leap_second "
"(Transition_time, Correction) VALUES "
"(78796800, 1) ,(94694401, 2) ,(126230402, 3)"
",(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
",(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
",(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
",(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
",(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
",(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
",(915148821, 22);\n");
}
}
return fclose(out);
}
......@@ -333,7 +333,6 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
PROCESS_INFORMATION process_information;
DWORD exit_code;
char win_args[1024]= "";
char command_line[1024]= "";
/* Skip the first parameter */
for (i= 1; i < al->argc; i++)
......@@ -724,7 +723,7 @@ int removef(const char *format, ...)
va_end(ap);
return remove(path);
#eldef __WIN__
#elif __WIN__
{
va_list ap;
char path[FN_REFLEN];
......
......@@ -52,6 +52,8 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...);
#define TRY_MAX 5
#ifdef __WIN__
#define PATH_MAX _MAX_PATH
#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0
#define MASTER_PID 1
......@@ -130,4 +132,6 @@ int removef(const char *, ...);
void get_basedir(char *, char *);
void remove_empty_file(const char *file_name);
bool create_system_files(const char *mdata,const char *output_file, bool test);
#endif /* _MY_MANAGE */
......@@ -267,6 +267,8 @@ void install_db(char *datadir)
snprintf(output, FN_REFLEN, "%s/install.out", datadir);
snprintf(error, FN_REFLEN, "%s/install.err", datadir);
if (create_system_files(datadir,input, TRUE))
die("Unable to create init_db.sql.");
/* args */
init_args(&al);
add_arg(&al, mysqld_file);
......@@ -307,9 +309,6 @@ void mysql_install_db()
/* var directory */
snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir);
/* clean up old direcotry */
del_tree(temp);
/* create var directory */
#ifndef __WIN__
mkdir(temp, S_IRWXU);
......@@ -1435,6 +1434,17 @@ void setup(char *file __attribute__((unused)))
}
/*
Compare names of testes for right order
*/
#ifdef __WIN__
int compare( const void *arg1, const void *arg2 )
{
return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
}
#endif
/******************************************************************************
main()
......
......@@ -2115,9 +2115,7 @@ GovernmentForm char(45) NOT NULL default '',
HeadOfState char(60) default NULL,
Capital int(11) default NULL,
Code2 char(2) NOT NULL default ''
) TYPE=MyISAM;
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes franaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
......
......@@ -1731,9 +1731,9 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
select * from t1;
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 a a 254 3 1 Y 384 0 8
def test t1 t1 b b 254 9 0 Y 2176 0 8
def test t1 t1 c c 254 3 0 Y 384 0 8
def test t1 t1 a a 254 1 1 Y 384 0 8
def test t1 t1 b b 254 3 0 Y 2176 0 8
def test t1 t1 c c 254 1 0 Y 384 0 8
a b c
Y NULL NULL
drop table t1;
......
......@@ -14,7 +14,7 @@ insert delayed into t1 set a = 4;
insert delayed into t1 set a = 5, tmsp = 19711006010203;
insert delayed into t1 (a, tmsp) values (6, 19711006010203);
insert delayed into t1 (a, tmsp) values (7, NULL);
--sleep 1
--sleep 2
insert into t1 set a = 8,tmsp=19711006010203;
select * from t1 where tmsp=0;
select * from t1 where tmsp=19711006010203;
......
......@@ -1378,7 +1378,7 @@ CREATE TABLE t1 (
HeadOfState char(60) default NULL,
Capital int(11) default NULL,
Code2 char(2) NOT NULL default ''
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes franaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
......
......@@ -146,7 +146,7 @@ void hash_reset(HASH *hash)
handle inline functions that are not defined as native types
*/
inline char*
static inline char*
hash_key(HASH *hash,const byte *record,uint *length,my_bool first)
{
if (hash->get_key)
......
......@@ -189,7 +189,10 @@ copy_dir_files()
mkdir $BASE/$arg
fi
for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \
README INSTALL* LICENSE
README INSTALL* LICENSE *.inc *.test *.result \
*.pem Moscow_leap des_key_file *.dat *.000001 \
*.require *.opt
do
if [ -f $i ]
then
......@@ -247,7 +250,7 @@ done
# Input directories to be copied recursively
#
for i in bdb innobase
for i in bdb innobase mysql-test
do
copy_dir_dirs $i
done
......
......@@ -765,7 +765,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
Item_string("",0, cs ? cs : &my_charset_bin)
{ name=(char*) header; max_length=length;}
{ name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
void make_field(Send_field *field);
};
......@@ -983,9 +983,9 @@ class Item_null_helper :public Item_ref_null_helper
public:
Item_null_helper(Item_in_subselect* master, Item *item,
const char *table_name_par, const char *field_name_par)
:Item_ref_null_helper(master, &store, table_name_par, field_name_par),
:Item_ref_null_helper(master, &item, table_name_par, field_name_par),
store(item)
{}
{ ref= &store; }
void print(String *str);
};
......
......@@ -549,10 +549,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
if (item->collation.collation == &my_charset_bin || thd_charset == NULL)
{
/* No conversion */
int2store(pos, field.charsetnr);
int4store(pos+2, field.length);
}
else
{
/* With conversion */
int2store(pos, thd_charset->number);
int4store(pos+2, field.length);
uint char_len= field.length / item->collation.collation->mbmaxlen;
int4store(pos+2, char_len * thd_charset->mbmaxlen);
}
pos[6]= field.type;
int2store(pos+7,field.flags);
pos[9]= (char) field.decimals;
......
......@@ -1101,7 +1101,8 @@ static void test_prepare_simple()
mysql_stmt_close(stmt);
/* update */
strmov(query, "UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?");
strmov(query, "UPDATE test_prepare_simple SET id=? "
"WHERE id=? AND CONVERT(name USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -1129,7 +1130,8 @@ static void test_prepare_simple()
mysql_stmt_close(stmt);
/* select */
strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? AND name= ?");
strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? "
"AND CONVERT(name USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -1158,7 +1160,7 @@ static void test_prepare_field_result()
rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, "
"var_c varchar(50), ts_c timestamp(14), "
"char_c char(3), date_c date, extra tinyint)");
"char_c char(4), date_c date, extra tinyint)");
myquery(rc);
/* insert */
......@@ -1184,8 +1186,8 @@ static void test_prepare_field_result()
"t1", "test_prepare_field_result", current_db, 10, 0);
verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP,
"t1", "test_prepare_field_result", current_db, 19, 0);
verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_STRING,
"t1", "test_prepare_field_result", current_db, 3, 0);
verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_VAR_STRING,
"t1", "test_prepare_field_result", current_db, 4, 0);
verify_field_count(result, 5);
mysql_free_result(result);
......@@ -1921,7 +1923,8 @@ static void test_select()
rc= mysql_commit(mysql);
myquery(rc);
strmov(query, "SELECT * FROM test_select WHERE id= ? AND name=?");
strmov(query, "SELECT * FROM test_select WHERE id= ? "
"AND CONVERT(name USING utf8) =?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -1981,7 +1984,8 @@ static void test_ps_conj_select()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')");
myquery(rc);
strmov(query, "select id1, value1 from t1 where id1= ? or value1= ?");
strmov(query, "select id1, value1 from t1 where id1= ? or "
"CONVERT(value1 USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \
"(\"abx\", 1, 2, 3, 2003-08-30)");
myquery(rc);
strmov(query, "SELECT * FROM test_select WHERE session_id= ?");
strmov(query, "SELECT * FROM test_select WHERE "
"CONVERT(session_id USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -2898,7 +2903,8 @@ static void test_simple_delete()
myquery(rc);
/* insert by prepare */
strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100");
strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND "
"CONVERT(col2 USING utf8)= ? AND col3= 100");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
......@@ -4866,7 +4872,8 @@ static void test_multi_stmt()
/* alter the table schema now */
stmt1= mysql_simple_prepare(mysql, "DELETE FROM test_multi_table "
"WHERE id= ? AND name=?");
"WHERE id= ? AND "
"CONVERT(name USING utf8)=?");
check_stmt(stmt1);
verify_param_count(stmt1, 2);
......@@ -5629,9 +5636,6 @@ static void test_subselect()
rc= mysql_stmt_bind_param(stmt, bind);
check_execute(stmt, rc);
rc= mysql_stmt_bind_result(stmt, bind);
check_execute(stmt, rc);
id= 2;
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
......@@ -5975,7 +5979,7 @@ static void test_pure_coverage()
check_execute(stmt, rc);
rc= mysql_stmt_bind_result(stmt, (MYSQL_BIND*)0);
check_execute(stmt, rc);
DIE_UNLESS(rc == 1);
mysql_stmt_close(stmt);
......@@ -6632,7 +6636,7 @@ static void test_field_misc()
"@@table_type", "", /* field and its org name */
MYSQL_TYPE_STRING, /* field type */
"", "", /* table and its org name */
"", type_length*3, 0); /* db name, length */
"", type_length, 0); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
......
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