1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge with 4.0 to get fixes for netware

This commit is contained in:
monty@mysql.com
2004-06-02 00:09:14 +03:00
23 changed files with 298 additions and 32 deletions

View File

@ -0,0 +1,9 @@
LIBRARY MYUDF
DESCRIPTION 'MySQL Sample for UDF'
VERSION 1.0
EXPORTS
metaphon
myfunc_double
myfunc_int
sequence
avgcost

View File

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="udf_example" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=udf_example - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "udf_example.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "udf_example.mak" CFG="udf_example - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "udf_example - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "udf_example - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "udf_example - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UDF_EXAMPLE_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UDF_EXAMPLE_EXPORTS" /D "HAVE_DLOPEN" /YX /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"
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 /nologo /dll /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 ..\..\lib\opt\strings.lib /nologo /dll /machine:I386 /out:"Release/myudf.dll"
!ELSEIF "$(CFG)" == "udf_example - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UDF_EXAMPLE_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UDF_EXAMPLE_EXPORTS" /D "HAVE_DLOPEN" /YX /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"
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 /nologo /dll /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 ..\..\lib\debug\strings.lib /nologo /dll /debug /machine:I386 /out:"Debug/myudf.dll" /pdbtype:sept
!ENDIF
# Begin Target
# Name "udf_example - Win32 Release"
# Name "udf_example - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\udf_example.cpp
# End Source File
# Begin Source File
SOURCE=.\udf_example.def
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "udf_example"=.\udf_example.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -187,7 +187,7 @@ typedef struct
*/ */
static char *subst_env_var(const char *cmd); static char *subst_env_var(const char *cmd);
static int my_popen(const char *cmd, const char *mode); static FILE *my_popen(const char *cmd, const char *mode);
#define popen(A,B) my_popen((A),(B)) #define popen(A,B) my_popen((A),(B))
#endif /* __NETWARE__ */ #endif /* __NETWARE__ */
@ -3710,6 +3710,7 @@ static void get_replace_column(struct st_query *q)
static char *subst_env_var(const char *str) static char *subst_env_var(const char *str)
{ {
char *result; char *result;
char *pos;
result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE)); result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE));
while (*str) while (*str)
@ -3729,7 +3730,7 @@ static char *subst_env_var(const char *str)
*str && !isspace(*str) && *str != '\\' && *str != '/' && *str && !isspace(*str) && *str != '\\' && *str != '/' &&
*str != '$'; *str != '$';
str++) str++)
*env_pos++ *str; *env_pos++= *str;
*env_pos= 0; *env_pos= 0;
if (!(subst= getenv(env_var))) if (!(subst= getenv(env_var)))
@ -3772,11 +3773,11 @@ static char *subst_env_var(const char *str)
#undef popen /* Remove wrapper */ #undef popen /* Remove wrapper */
int my_popen(const char *cmd, const char *mode __attribute__((unused)) t) FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
{ {
char *subst_cmd; char *subst_cmd;
int res_file; FILE *res_file;
subst_cmd= subst_env_var(cmd); subst_cmd= subst_env_var(cmd);
res_file= popen(subst_cmd, "r0"); res_file= popen(subst_cmd, "r0");
my_free(subst_cmd, MYF(0)); my_free(subst_cmd, MYF(0));

View File

@ -767,7 +767,14 @@ AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init)) AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init))
# For compress in zlib # For compress in zlib
MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib) case $SYSTEM_TYPE in
*netware*)
AC_DEFINE(HAVE_COMPRESS)
;;
*)
MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
;;
esac
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check for TCP wrapper support # Check for TCP wrapper support

View File

@ -336,7 +336,7 @@ typedef struct st_mysql_parameters
int STDCALL mysql_server_init(int argc, char **argv, char **groups); int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void); void STDCALL mysql_server_end(void);
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(); MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
/* /*
Set up and bring down a thread; these function should be called Set up and bring down a thread; these function should be called

View File

@ -681,7 +681,7 @@ dict_init(void)
rw_lock_create(&dict_operation_lock); rw_lock_create(&dict_operation_lock);
rw_lock_set_level(&dict_operation_lock, SYNC_DICT_OPERATION); rw_lock_set_level(&dict_operation_lock, SYNC_DICT_OPERATION);
dict_foreign_err_file = tmpfile(); dict_foreign_err_file = os_file_create_tmpfile();
mutex_create(&dict_foreign_err_mutex); mutex_create(&dict_foreign_err_mutex);
mutex_set_level(&dict_foreign_err_mutex, SYNC_ANY_LATCH); mutex_set_level(&dict_foreign_err_mutex, SYNC_ANY_LATCH);
} }

View File

@ -169,6 +169,13 @@ void
os_io_init_simple(void); os_io_init_simple(void);
/*===================*/ /*===================*/
/*************************************************************************** /***************************************************************************
Creates a temporary file. In case of error, causes abnormal termination. */
FILE*
os_file_create_tmpfile(void);
/*========================*/
/* out: temporary file handle (never NULL) */
/***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned directory named by the dirname argument. The directory stream is positioned
at the first entry. In both Unix and Windows we automatically skip the '.' at the first entry. In both Unix and Windows we automatically skip the '.'

View File

@ -558,6 +558,9 @@ struct row_prebuilt_struct {
dtuple_t* clust_ref; /* prebuilt dtuple used in dtuple_t* clust_ref; /* prebuilt dtuple used in
sel/upd/del */ sel/upd/del */
ulint select_lock_type;/* LOCK_NONE, LOCK_S, or LOCK_X */ ulint select_lock_type;/* LOCK_NONE, LOCK_S, or LOCK_X */
ulint stored_select_lock_type;/* inside LOCK TABLES, either
LOCK_S or LOCK_X depending on the lock
type */
ulint mysql_row_len; /* length in bytes of a row in the ulint mysql_row_len; /* length in bytes of a row in the
MySQL format */ MySQL format */
ulint n_rows_fetched; /* number of rows fetched after ulint n_rows_fetched; /* number of rows fetched after

View File

@ -510,7 +510,7 @@ lock_sys_create(
/* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */ /* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */
lock_latest_err_file = tmpfile(); lock_latest_err_file = os_file_create_tmpfile();
} }
/************************************************************************* /*************************************************************************

View File

@ -311,14 +311,11 @@ os_file_handle_error(
/*=================*/ /*=================*/
/* out: TRUE if we should retry the /* out: TRUE if we should retry the
operation */ operation */
os_file_t file, /* in: file pointer */
const char* name, /* in: name of a file or NULL */ const char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */ const char* operation)/* in: operation */
{ {
ulint err; ulint err;
UT_NOT_USED(file);
err = os_file_get_last_error(FALSE); err = os_file_get_last_error(FALSE);
if (err == OS_FILE_DISK_FULL) { if (err == OS_FILE_DISK_FULL) {
@ -481,6 +478,25 @@ os_io_init_simple(void)
} }
} }
/***************************************************************************
Creates a temporary file. In case of error, causes abnormal termination. */
FILE*
os_file_create_tmpfile(void)
/*========================*/
/* out: temporary file handle (never NULL) */
{
FILE* file = tmpfile();
if (file == NULL) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: unable to create temporary file\n",
stderr);
os_file_handle_error(NULL, "tmpfile");
ut_error;
}
return(file);
}
/*************************************************************************** /***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned directory named by the dirname argument. The directory stream is positioned
@ -809,7 +825,7 @@ try_again:
if (file == INVALID_HANDLE_VALUE) { if (file == INVALID_HANDLE_VALUE) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name, retry = os_file_handle_error(name,
create_mode == OS_FILE_OPEN ? create_mode == OS_FILE_OPEN ?
"open" : "create"); "open" : "create");
if (retry) { if (retry) {
@ -859,7 +875,7 @@ try_again:
if (file == -1) { if (file == -1) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name, retry = os_file_handle_error(name,
create_mode == OS_FILE_OPEN ? create_mode == OS_FILE_OPEN ?
"open" : "create"); "open" : "create");
if (retry) { if (retry) {
@ -1101,7 +1117,7 @@ try_again:
if (file == INVALID_HANDLE_VALUE) { if (file == INVALID_HANDLE_VALUE) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name, retry = os_file_handle_error(name,
create_mode == OS_FILE_CREATE ? create_mode == OS_FILE_CREATE ?
"create" : "open"); "create" : "open");
if (retry) { if (retry) {
@ -1186,7 +1202,7 @@ try_again:
if (file == -1) { if (file == -1) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name, retry = os_file_handle_error(name,
create_mode == OS_FILE_CREATE ? create_mode == OS_FILE_CREATE ?
"create" : "open"); "create" : "open");
if (retry) { if (retry) {
@ -1389,7 +1405,7 @@ os_file_close(
return(TRUE); return(TRUE);
} }
os_file_handle_error(file, NULL, "close"); os_file_handle_error(NULL, "close");
return(FALSE); return(FALSE);
#else #else
@ -1398,7 +1414,7 @@ os_file_close(
ret = close(file); ret = close(file);
if (ret == -1) { if (ret == -1) {
os_file_handle_error(file, NULL, "close"); os_file_handle_error(NULL, "close");
return(FALSE); return(FALSE);
} }
@ -1651,7 +1667,7 @@ os_file_flush(
return(TRUE); return(TRUE);
} }
os_file_handle_error(file, NULL, "flush"); os_file_handle_error(NULL, "flush");
/* It is a fatal error if a file flush does not succeed, because then /* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */ the database can get corrupt on disk */
@ -1686,7 +1702,7 @@ os_file_flush(
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: the OS said file flush did not succeed\n"); " InnoDB: Error: the OS said file flush did not succeed\n");
os_file_handle_error(file, NULL, "flush"); os_file_handle_error(NULL, "flush");
/* It is a fatal error if a file flush does not succeed, because then /* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */ the database can get corrupt on disk */
@ -1946,7 +1962,7 @@ try_again:
#ifdef __WIN__ #ifdef __WIN__
error_handling: error_handling:
#endif #endif
retry = os_file_handle_error(file, NULL, "read"); retry = os_file_handle_error(NULL, "read");
if (retry) { if (retry) {
goto try_again; goto try_again;
@ -3157,7 +3173,7 @@ try_again:
os_aio_array_free_slot(array, slot); os_aio_array_free_slot(array, slot);
retry = os_file_handle_error(file, name, retry = os_file_handle_error(name,
type == OS_FILE_READ ? "aio read" : "aio write"); type == OS_FILE_READ ? "aio read" : "aio write");
if (retry) { if (retry) {
@ -3257,7 +3273,7 @@ os_aio_windows_handle(
ut_a(TRUE == os_file_flush(slot->file)); ut_a(TRUE == os_file_flush(slot->file));
} }
} else { } else {
os_file_handle_error(slot->file, slot->name, "Windows aio"); os_file_handle_error(slot->name, "Windows aio");
ret_val = FALSE; ret_val = FALSE;
} }

View File

@ -397,6 +397,7 @@ row_create_prebuilt(
prebuilt->clust_pcur = btr_pcur_create_for_mysql(); prebuilt->clust_pcur = btr_pcur_create_for_mysql();
prebuilt->select_lock_type = LOCK_NONE; prebuilt->select_lock_type = LOCK_NONE;
prebuilt->stored_select_lock_type = 99999999;
prebuilt->sel_graph = NULL; prebuilt->sel_graph = NULL;

View File

@ -186,7 +186,7 @@ void STDCALL mysql_server_end()
static MYSQL_PARAMETERS mysql_internal_parameters= static MYSQL_PARAMETERS mysql_internal_parameters=
{&max_allowed_packet, &net_buffer_length}; {&max_allowed_packet, &net_buffer_length};
MYSQL_PARAMETERS *STDCALL mysql_get_parameters() MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)
{ {
return &mysql_internal_parameters; return &mysql_internal_parameters;
} }

View File

@ -12,7 +12,7 @@ conflict with it.
All tests must pass. If one or more of them fail on your system, please All tests must pass. If one or more of them fail on your system, please
read the following manual section of how to report the problem: read the following manual section of how to report the problem:
http://www.mysql.com/doc/M/y/MySQL_test_suite.html http://dev.mysql.com/doc/mysql/en/MySQL_test_suite.html
You can create your own test cases. To create a test case: You can create your own test cases. To create a test case:

View File

@ -226,3 +226,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) ) OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) ); OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1; drop table t1;
CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
INSERT INTO t1 VALUES ('1'), ('2'), ('3');
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
a
2
SELECT FOUND_ROWS();
FOUND_ROWS()
1
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (2);
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
a
SELECT FOUND_ROWS();
FOUND_ROWS()
0
DROP TABLE t1;

View File

@ -137,3 +137,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) ); OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1; drop table t1;
#
# Bug #3738: we have a ref key
#
CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
INSERT INTO t1 VALUES ('1'), ('2'), ('3');
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
SELECT FOUND_ROWS();
DROP TABLE t1;
#
# Bug #3845: group by, having and empty result
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (2);
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
SELECT FOUND_ROWS();
DROP TABLE t1;

View File

@ -4657,6 +4657,39 @@ ha_innobase::start_stmt(
prepared for an update of a row */ prepared for an update of a row */
prebuilt->select_lock_type = LOCK_X; prebuilt->select_lock_type = LOCK_X;
} else {
/* When we first come here after LOCK TABLES,
select_lock_type is set to LOCK_S or LOCK_X. Store the value
in case we run also consistent reads and need to restore the
value later. */
if (prebuilt->select_lock_type != LOCK_NONE) {
prebuilt->stored_select_lock_type =
prebuilt->select_lock_type;
}
if (prebuilt->stored_select_lock_type != LOCK_S
&& prebuilt->stored_select_lock_type != LOCK_X) {
fprintf(stderr,
"InnoDB: Error: select_lock_type is %lu inside ::start_stmt()!\n",
prebuilt->stored_select_lock_type);
ut_error;
}
if (thd->lex.sql_command == SQLCOM_SELECT
&& thd->lex.lock_option == TL_READ) {
/* For other than temporary tables, we obtain
no lock for consistent read (plain SELECT) */
prebuilt->select_lock_type = LOCK_NONE;
} else {
/* Not a consistent read: restore the
select_lock_type value */
prebuilt->select_lock_type =
prebuilt->stored_select_lock_type;
}
} }
/* Set the MySQL flag to mark that there is an active transaction */ /* Set the MySQL flag to mark that there is an active transaction */

View File

@ -4449,11 +4449,11 @@ replicating a LOAD DATA INFILE command.",
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-warnings", 'W', "Log some not critical warnings to the log file.", {"log-warnings", 'W', "Log some not critical warnings to the log file.",
(gptr*) &global_system_variables.log_warnings, (gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0, (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0}, 0, 0, 0},
{"warnings", 'W', "Deprecated ; Use --log-warnings instead.", {"warnings", 'W', "Deprecated ; Use --log-warnings instead.",
(gptr*) &global_system_variables.log_warnings, (gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0, (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0}, 0, 0, 0},
{ "back_log", OPT_BACK_LOG, { "back_log", OPT_BACK_LOG,
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.", "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
@ -5474,6 +5474,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'V': case 'V':
print_version(); print_version();
exit(0); exit(0);
case 'W':
if (!argument)
global_system_variables.log_warnings++;
else if (argument == disabled_my_option)
global_system_variables.log_warnings= 0L;
else
global_system_variables.log_warnings= atoi(argument);
break;
case 'T': case 'T':
test_flags= argument ? (uint) atoi(argument) : 0; test_flags= argument ? (uint) atoi(argument) : 0;
test_flags&= ~TEST_NO_THREADS; test_flags&= ~TEST_NO_THREADS;

View File

@ -182,7 +182,7 @@ sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold",
param_age_threshold)); param_age_threshold));
sys_var_bool_ptr sys_local_infile("local_infile", sys_var_bool_ptr sys_local_infile("local_infile",
&opt_local_infile); &opt_local_infile);
sys_var_thd_bool sys_log_warnings("log_warnings", &SV::log_warnings); sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
sys_var_thd_ulong sys_long_query_time("long_query_time", sys_var_thd_ulong sys_long_query_time("long_query_time",
&SV::long_query_time); &SV::long_query_time);
sys_var_thd_bool sys_low_priority_updates("low_priority_updates", sys_var_thd_bool sys_low_priority_updates("low_priority_updates",

View File

@ -941,7 +941,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
*/ */
ulong acl_get(const char *host, const char *ip, ulong acl_get(const char *host, const char *ip,
const char *user, const char *db, my_bool db_is_pattern) const char *user, const char *db, my_bool db_is_pattern)
{ {
ulong host_access,db_access; ulong host_access,db_access;
uint i,key_length; uint i,key_length;

View File

@ -383,6 +383,7 @@ struct system_variables
ulong query_prealloc_size; ulong query_prealloc_size;
ulong trans_alloc_block_size; ulong trans_alloc_block_size;
ulong trans_prealloc_size; ulong trans_prealloc_size;
ulong log_warnings;
ulong group_concat_max_len; ulong group_concat_max_len;
/* /*
In slave thread we need to know in behalf of which In slave thread we need to know in behalf of which
@ -390,7 +391,6 @@ struct system_variables
*/ */
ulong pseudo_thread_id; ulong pseudo_thread_id;
my_bool log_warnings;
my_bool low_priority_updates; my_bool low_priority_updates;
my_bool new_mode; my_bool new_mode;
my_bool query_cache_wlock_invalidate; my_bool query_cache_wlock_invalidate;

View File

@ -1021,7 +1021,7 @@ pthread_handler_decl(handle_one_connection,arg)
free_root(&thd->mem_root,MYF(0)); free_root(&thd->mem_root,MYF(0));
if (net->error && net->vio != 0 && net->report_error) if (net->error && net->vio != 0 && net->report_error)
{ {
if (!thd->killed && thd->variables.log_warnings) if (!thd->killed && thd->variables.log_warnings > 1)
sql_print_error(ER(ER_NEW_ABORTING_CONNECTION), sql_print_error(ER(ER_NEW_ABORTING_CONNECTION),
thd->thread_id,(thd->db ? thd->db : "unconnected"), thd->thread_id,(thd->db ? thd->db : "unconnected"),
thd->user ? thd->user : "unauthenticated", thd->user ? thd->user : "unauthenticated",

View File

@ -6369,7 +6369,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group
&& !join->send_group_parts && !join->having && !jt->select_cond && && !join->send_group_parts && !join->having && !jt->select_cond &&
!(jt->select && jt->select->quick) && !(jt->select && jt->select->quick) &&
!(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT)) !(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT) &&
(jt->ref.key < 0))
{ {
/* Join over all rows in table; Return number of found rows */ /* Join over all rows in table; Return number of found rows */
TABLE *table=jt->table; TABLE *table=jt->table;
@ -6462,7 +6463,11 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (error > 0) if (error > 0)
DBUG_RETURN(-1); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */
if (end_of_records) if (end_of_records)
{
if (!error)
join->send_records++;
DBUG_RETURN(0); DBUG_RETURN(0);
}
if (join->send_records >= join->unit->select_limit_cnt && if (join->send_records >= join->unit->select_limit_cnt &&
join->do_send_rows) join->do_send_rows)
{ {