Commit da7aa6bc authored by Andrei Elkin's avatar Andrei Elkin

merging from 5.0-bt rep to a local branch

parents 162eca37 c71004dc
...@@ -2832,7 +2832,7 @@ com_charset(String *buffer __attribute__((unused)), char *line) ...@@ -2832,7 +2832,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
param= get_arg(buff, 0); param= get_arg(buff, 0);
if (!param || !*param) if (!param || !*param)
{ {
return put_info("Usage: \\C char_setname | charset charset_name", return put_info("Usage: \\C charset_name | charset charset_name",
INFO_ERROR, 0); INFO_ERROR, 0);
} }
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME)); new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));
......
...@@ -1129,7 +1129,8 @@ static int connect_to_db(char *host, char *user,char *passwd) ...@@ -1129,7 +1129,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
DB_error(&mysql_connection, "when trying to connect"); DB_error(&mysql_connection, "when trying to connect");
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (mysql_get_server_version(&mysql_connection) < 40100) if ((mysql_get_server_version(&mysql_connection) < 40100) ||
(opt_compatible_mode & 3))
{ {
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */ /* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
opt_set_charset= 0; opt_set_charset= 0;
...@@ -1857,11 +1858,11 @@ static uint get_table_structure(char *table, char *db, char *table_type, ...@@ -1857,11 +1858,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
row= mysql_fetch_row(result); row= mysql_fetch_row(result);
fprintf(sql_file, fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
"SET @saved_cs_client = @@character_set_client;\n" "/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
"SET character_set_client = utf8;\n" "/*!40101 SET character_set_client = utf8 */;\n"
"%s;\n" "%s;\n"
"SET character_set_client = @saved_cs_client;\n", "/*!40101 SET character_set_client = @saved_cs_client */;\n",
row[1]); row[1]);
check_io(sql_file); check_io(sql_file);
......
...@@ -825,7 +825,7 @@ AC_TYPE_SIZE_T ...@@ -825,7 +825,7 @@ AC_TYPE_SIZE_T
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
memory.h pwd.h select.h \ memory.h pwd.h select.h \
stdlib.h stddef.h \ stdlib.h stddef.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
...@@ -2060,7 +2060,7 @@ AC_FUNC_UTIME_NULL ...@@ -2060,7 +2060,7 @@ AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \ fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \ getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \ localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
......
...@@ -97,6 +97,17 @@ static HA_ERRORS ha_errlist[]= ...@@ -97,6 +97,17 @@ static HA_ERRORS ha_errlist[]=
{ 150,"Foreign key constraint is incorrectly formed"}, { 150,"Foreign key constraint is incorrectly formed"},
{ 151,"Cannot add a child row"}, { 151,"Cannot add a child row"},
{ 152,"Cannot delete a parent row"}, { 152,"Cannot delete a parent row"},
{ 153,"No savepoint with that name"},
{ 154,"Non unique key block size"},
{ 155,"The table does not exist in engine"},
{ 156,"The table existed in storage engine"},
{ 157,"Could not connect to storage engine"},
{ 158,"NULLs are not supported in spatial index"},
{ 159,"The table changed in storage engine"},
{ 160,"The table changed in storage engine"},
{ 161,"The table is not writable"},
{ 162,"Failed to get the next autoinc value"},
{ 163,"Failed to set the row autoinc value"},
{ -30999, "DB_INCOMPLETE: Sync didn't finish"}, { -30999, "DB_INCOMPLETE: Sync didn't finish"},
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"}, { -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
{ -30997, "DB_KEYEXIST: The key/data pair already exists"}, { -30997, "DB_KEYEXIST: The key/data pair already exists"},
......
...@@ -31,7 +31,6 @@ functions */ ...@@ -31,7 +31,6 @@ functions */
#include <sys/locking.h> #include <sys/locking.h>
#include <windows.h> #include <windows.h>
#include <math.h> /* Because of rint() */
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#include <malloc.h> #include <malloc.h>
...@@ -223,13 +222,6 @@ typedef uint rf_SetTimer; ...@@ -223,13 +222,6 @@ typedef uint rf_SetTimer;
#define inline __inline #define inline __inline
#endif /* __cplusplus */ #endif /* __cplusplus */
inline double rint(double nr)
{
double f = floor(nr);
double c = ceil(nr);
return (((c-nr) >= (nr-f)) ? f :c);
}
#ifdef _WIN64 #ifdef _WIN64
#define ulonglong2double(A) ((double) (ulonglong) (A)) #define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A))
...@@ -281,7 +273,6 @@ inline ulonglong double2ulonglong(double d) ...@@ -281,7 +273,6 @@ inline ulonglong double2ulonglong(double d)
#define HAVE_FLOAT_H #define HAVE_FLOAT_H
#define HAVE_LIMITS_H #define HAVE_LIMITS_H
#define HAVE_STDDEF_H #define HAVE_STDDEF_H
#define HAVE_RINT /* defined in this file */
#define NO_FCNTL_NONBLOCK /* No FCNTL */ #define NO_FCNTL_NONBLOCK /* No FCNTL */
#define HAVE_ALLOCA #define HAVE_ALLOCA
#define HAVE_STRPBRK #define HAVE_STRPBRK
......
...@@ -377,6 +377,7 @@ enum ha_base_keytype { ...@@ -377,6 +377,7 @@ enum ha_base_keytype {
#define HA_ERR_TABLE_READONLY 161 /* The table is not writable */ #define HA_ERR_TABLE_READONLY 161 /* The table is not writable */
#define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */ #define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */
#define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */ #define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */
/* You must also add numbers and description to extra/perror.c ! */
#define HA_ERR_LAST 163 /*Copy last error nr.*/ #define HA_ERR_LAST 163 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */ /* Add error numbers before HA_ERR_LAST and change it accordingly. */
......
...@@ -484,8 +484,39 @@ typedef unsigned short ushort; ...@@ -484,8 +484,39 @@ typedef unsigned short ushort;
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#ifndef HAVE_RINT #ifndef HAVE_RINT
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5)) /**
#endif All integers up to this number can be represented exactly as double precision
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
*/
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
/**
rint(3) implementation for platforms that do not have it.
Always rounds to the nearest integer with ties being rounded to the nearest
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
Unlike this implementation, hardware will also honor the FPU rounding mode.
*/
static inline double rint(double x)
{
double f, i;
f = modf(x, &i);
/*
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
no need to check it.
*/
if (x > 0.0)
i += (double) ((f > 0.5) || (f == 0.5 &&
i <= (double) MAX_EXACT_INTEGER &&
(longlong) i % 2));
else
i -= (double) ((f < -0.5) || (f == -0.5 &&
i >= (double) -MAX_EXACT_INTEGER &&
(longlong) i % 2));
return i;
}
#endif /* HAVE_RINT */
/* Define some general constants */ /* Define some general constants */
#ifndef TRUE #ifndef TRUE
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
# By JBM 2006-02-16 So that the code is not repeated # # By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. # # in test cases and can be reused. #
###################################################### ######################################################
# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
# 'grep' call
# This test is disabled on Windows via the next line until the above bug is
# resolved
--source include/not_windows.inc
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it... # there is no neat way to find the backupid, this is a hack to find it...
......
...@@ -360,4 +360,34 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; ...@@ -360,4 +360,34 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
a DIV 2 a DIV 2
0 0
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (-1.1), (1.1),
(-1.5), (1.5),
(-1.9), (1.9),
(-2.1), (2.1),
(-2.5), (2.5),
(-2.9), (2.9),
# Check numbers with absolute values > 2^53 - 1
# (see comments for MAX_EXACT_INTEGER)
(-1e16 - 0.5), (1e16 + 0.5),
(-1e16 - 1.5), (1e16 + 1.5);
SELECT a, ROUND(a) FROM t1;
a ROUND(a)
-1.1 -1
1.1 1
-1.5 -2
1.5 2
-1.9 -2
1.9 2
-2.1 -2
2.1 2
-2.5 -2
2.5 2
-2.9 -3
2.9 3
-1e+16 -10000000000000000
1e+16 10000000000000000
-1e+16 -10000000000000002
1e+16 10000000000000002
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
...@@ -353,7 +353,14 @@ flush logs; ...@@ -353,7 +353,14 @@ flush logs;
INSERT INTO t1 VALUES ('0123456789'); INSERT INTO t1 VALUES ('0123456789');
flush logs; flush logs;
DROP TABLE t1; DROP TABLE t1;
# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED We expect this value to be 1
The bug being tested was that 'Query' lines were not preceded by '#'
If the line is in the table, it had to have been preceded by a '#'
SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
BUG#28293_expect_1
1
DROP TABLE patch;
flush logs; flush logs;
create table t1(a int); create table t1(a int);
insert into t1 values(connection_id()); insert into t1 values(connection_id());
......
...@@ -93,73 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l ...@@ -93,73 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`; USE `test`;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`; DROP TABLE IF EXISTS `t2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`; DROP TABLE IF EXISTS `t3`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` ( CREATE TABLE `t3` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */; /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`; DROP TABLE IF EXISTS `t4`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` ( CREATE TABLE `t4` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */; /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`; DROP TABLE IF EXISTS `t5`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t5` ( CREATE TABLE `t5` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */; /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`; DROP TABLE IF EXISTS `t6`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t6` ( CREATE TABLE `t6` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
...@@ -190,73 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l ...@@ -190,73 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`; USE `test`;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`; DROP TABLE IF EXISTS `t2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`; DROP TABLE IF EXISTS `t3`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` ( CREATE TABLE `t3` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */; /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`; DROP TABLE IF EXISTS `t4`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` ( CREATE TABLE `t4` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */; /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`; DROP TABLE IF EXISTS `t5`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t5` ( CREATE TABLE `t5` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */; /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`; DROP TABLE IF EXISTS `t6`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t6` ( CREATE TABLE `t6` (
`id` int(8) default NULL, `id` int(8) default NULL,
`name` varchar(32) default NULL `name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
......
This diff is collapsed.
...@@ -210,7 +210,6 @@ source database ...@@ -210,7 +210,6 @@ source database
"MySQL: The world's most popular ;open source database" "MySQL: The world's most popular ;open source database"
echo message echo message echo message echo message
mysqltest: At line 1: command "false" failed
mysqltest: At line 1: Missing argument in exec mysqltest: At line 1: Missing argument in exec
MySQL MySQL
"MySQL" "MySQL"
...@@ -378,7 +377,6 @@ mysqltest: At line 1: The argument to dec must be a variable (start with $) ...@@ -378,7 +377,6 @@ mysqltest: At line 1: The argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: system command 'false' failed
system command 'NonExistsinfComamdn 2> /dev/null' failed system command 'NonExistsinfComamdn 2> /dev/null' failed
test test
test2 test2
......
...@@ -77,12 +77,12 @@ INSERT INTO t1 VALUES (1), (2); ...@@ -77,12 +77,12 @@ INSERT INTO t1 VALUES (1), (2);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
...@@ -111,12 +111,12 @@ UNLOCK TABLES; ...@@ -111,12 +111,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
...@@ -145,12 +145,12 @@ UNLOCK TABLES; ...@@ -145,12 +145,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
......
...@@ -13,9 +13,7 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost; ...@@ -13,9 +13,7 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
---> connection: wl2818_definer_con ---> connection: wl2818_definer_con
CREATE TABLE t1(num_value INT); CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT); CREATE TABLE t2(user_str TEXT);
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
---> patching t1.TRG... ---> patching t1.TRG...
......
...@@ -229,5 +229,25 @@ INSERT INTO t1 VALUES ('a'); ...@@ -229,5 +229,25 @@ INSERT INTO t1 VALUES ('a');
SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #15936: "round" differs on Windows to Unix
#
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (-1.1), (1.1),
(-1.5), (1.5),
(-1.9), (1.9),
(-2.1), (2.1),
(-2.5), (2.5),
(-2.9), (2.9),
# Check numbers with absolute values > 2^53 - 1
# (see comments for MAX_EXACT_INTEGER)
(-1e16 - 0.5), (1e16 + 0.5),
(-1e16 - 1.5), (1e16 + 1.5);
SELECT a, ROUND(a) FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests --echo End of 5.0 tests
# We are using .opt file since we need small binlog size # We are using .opt file since we need small binlog size
-- source include/have_log_bin.inc -- source include/have_log_bin.inc
# we need this for getting fixed timestamps inside of this test # we need this for getting fixed timestamps inside of this test
...@@ -174,7 +173,8 @@ delimiter ;// ...@@ -174,7 +173,8 @@ delimiter ;//
flush logs; flush logs;
call p1(); call p1();
drop procedure p1; drop procedure p1;
--error 1305 --error ER_SP_DOES_NOT_EXIST
call p1(); call p1();
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007 --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007
...@@ -226,7 +226,26 @@ flush logs; ...@@ -226,7 +226,26 @@ flush logs;
INSERT INTO t1 VALUES ('0123456789'); INSERT INTO t1 VALUES ('0123456789');
flush logs; flush logs;
DROP TABLE t1; DROP TABLE t1;
--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
# We create a table, patch, and load the output into it
# By using LINES STARTING BY '#' + SELECT WHERE a LIKE 'Query'
# We can easily see if a 'Query' line is missing the '#' character
# as described in the original bug
--disable_query_log
CREATE TABLE patch (a blob);
--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat
eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat'
INTO TABLE patch FIELDS TERMINATED by '' LINES STARTING BY '#';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat
--enable_query_log
--echo We expect this value to be 1
--echo The bug being tested was that 'Query' lines were not preceded by '#'
--echo If the line is in the table, it had to have been preceded by a '#'
--echo
SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
DROP TABLE patch;
# #
# Bug #29928: incorrect connection_id() restoring from mysqlbinlog out # Bug #29928: incorrect connection_id() restoring from mysqlbinlog out
......
...@@ -1650,6 +1650,24 @@ DROP TABLE t1,t2; ...@@ -1650,6 +1650,24 @@ DROP TABLE t1,t2;
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT; SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
--echo #
--echo # Bug#33550 mysqldump 4.0 compatibility broken
--echo #
SET NAMES utf8;
CREATE TABLE `straße` ( f1 INT );
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
DROP TABLE `straße`;
CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
--error 2
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`;
SET NAMES latin1;
--echo # --echo #
--echo # End of 5.0 tests --echo # End of 5.0 tests
--echo # --echo #
......
...@@ -62,7 +62,8 @@ select otto from (select 1 as otto) as t1; ...@@ -62,7 +62,8 @@ select otto from (select 1 as otto) as t1;
--exec echo "select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1 --exec echo "select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# expectation = response # expectation = response
--error 1054 --error ER_BAD_FIELD_ERROR
select friedrich from (select 1 as otto) as t1; select friedrich from (select 1 as otto) as t1;
# The following unmasked unsuccessful statement must give # The following unmasked unsuccessful statement must give
...@@ -131,14 +132,16 @@ eval select $mysql_errno as "after_successful_stmt_errno" ; ...@@ -131,14 +132,16 @@ eval select $mysql_errno as "after_successful_stmt_errno" ;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# check mysql_errno = 1064 after statement with wrong syntax # check mysql_errno = 1064 after statement with wrong syntax
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
eval select $mysql_errno as "after_wrong_syntax_errno" ; eval select $mysql_errno as "after_wrong_syntax_errno" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# check if let $my_var= 'abc' ; affects $mysql_errno # check if let $my_var= 'abc' ; affects $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
let $my_var= 'abc' ; let $my_var= 'abc' ;
eval select $mysql_errno as "after_let_var_equal_value" ; eval select $mysql_errno as "after_let_var_equal_value" ;
...@@ -146,7 +149,8 @@ eval select $mysql_errno as "after_let_var_equal_value" ; ...@@ -146,7 +149,8 @@ eval select $mysql_errno as "after_let_var_equal_value" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# check if set @my_var= 'abc' ; affects $mysql_errno # check if set @my_var= 'abc' ; affects $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
set @my_var= 'abc' ; set @my_var= 'abc' ;
eval select $mysql_errno as "after_set_var_equal_value" ; eval select $mysql_errno as "after_set_var_equal_value" ;
...@@ -155,7 +159,8 @@ eval select $mysql_errno as "after_set_var_equal_value" ; ...@@ -155,7 +159,8 @@ eval select $mysql_errno as "after_set_var_equal_value" ;
# check if the setting of --disable-warnings itself affects $mysql_errno # check if the setting of --disable-warnings itself affects $mysql_errno
# (May be --<whatever> modifies $mysql_errno.) # (May be --<whatever> modifies $mysql_errno.)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--disable_warnings --disable_warnings
eval select $mysql_errno as "after_disable_warnings_command" ; eval select $mysql_errno as "after_disable_warnings_command" ;
...@@ -166,7 +171,8 @@ eval select $mysql_errno as "after_disable_warnings_command" ; ...@@ -166,7 +171,8 @@ eval select $mysql_errno as "after_disable_warnings_command" ;
# (May be disabled warnings affect $mysql_errno.) # (May be disabled warnings affect $mysql_errno.)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
drop table if exists t1 ; drop table if exists t1 ;
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
drop table if exists t1 ; drop table if exists t1 ;
eval select $mysql_errno as "after_disable_warnings" ; eval select $mysql_errno as "after_disable_warnings" ;
...@@ -175,21 +181,26 @@ eval select $mysql_errno as "after_disable_warnings" ; ...@@ -175,21 +181,26 @@ eval select $mysql_errno as "after_disable_warnings" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# check if masked errors affect $mysql_errno # check if masked errors affect $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1146 --error ER_NO_SUCH_TABLE
select 3 from t1 ; select 3 from t1 ;
eval select $mysql_errno as "after_minus_masked" ; eval select $mysql_errno as "after_minus_masked" ;
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1146 --error ER_NO_SUCH_TABLE
select 3 from t1 ; select 3 from t1 ;
eval select $mysql_errno as "after_!_masked" ; eval select $mysql_errno as "after_!_masked" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Will manipulations of $mysql_errno be possible and visible ? # Will manipulations of $mysql_errno be possible and visible ?
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
let $mysql_errno= -1; let $mysql_errno= -1;
eval select $mysql_errno as "after_let_errno_equal_value" ; eval select $mysql_errno as "after_let_errno_equal_value" ;
...@@ -198,50 +209,61 @@ eval select $mysql_errno as "after_let_errno_equal_value" ; ...@@ -198,50 +209,61 @@ eval select $mysql_errno as "after_let_errno_equal_value" ;
# How affect actions on prepared statements $mysql_errno ? # How affect actions on prepared statements $mysql_errno ?
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# failing prepare # failing prepare
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1146 --error ER_NO_SUCH_TABLE
prepare stmt from "select 3 from t1" ; prepare stmt from "select 3 from t1" ;
eval select $mysql_errno as "after_failing_prepare" ; eval select $mysql_errno as "after_failing_prepare" ;
create table t1 ( f1 char(10)); create table t1 ( f1 char(10));
# successful prepare # successful prepare
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
prepare stmt from "select 3 from t1" ; prepare stmt from "select 3 from t1" ;
eval select $mysql_errno as "after_successful_prepare" ; eval select $mysql_errno as "after_successful_prepare" ;
# successful execute # successful execute
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
execute stmt; execute stmt;
eval select $mysql_errno as "after_successful_execute" ; eval select $mysql_errno as "after_successful_execute" ;
# failing execute (table has been dropped) # failing execute (table has been dropped)
drop table t1; drop table t1;
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1146 --error ER_NO_SUCH_TABLE
execute stmt; execute stmt;
eval select $mysql_errno as "after_failing_execute" ; eval select $mysql_errno as "after_failing_execute" ;
# failing execute (unknown statement) # failing execute (unknown statement)
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1243 --error ER_UNKNOWN_STMT_HANDLER
execute __stmt_; execute __stmt_;
eval select $mysql_errno as "after_failing_execute" ; eval select $mysql_errno as "after_failing_execute" ;
# successful deallocate # successful deallocate
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
deallocate prepare stmt; deallocate prepare stmt;
eval select $mysql_errno as "after_successful_deallocate" ; eval select $mysql_errno as "after_successful_deallocate" ;
# failing deallocate ( statement handle does not exist ) # failing deallocate ( statement handle does not exist )
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--error 1243 --error ER_UNKNOWN_STMT_HANDLER
deallocate prepare __stmt_; deallocate prepare __stmt_;
eval select $mysql_errno as "after_failing_deallocate" ; eval select $mysql_errno as "after_failing_deallocate" ;
...@@ -266,7 +288,8 @@ eval select $mysql_errno as "after_failing_deallocate" ; ...@@ -266,7 +288,8 @@ eval select $mysql_errno as "after_failing_deallocate" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Switch off the abort on error and check the effect on $mysql_errno # Switch off the abort on error and check the effect on $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--disable_abort_on_error --disable_abort_on_error
eval select $mysql_errno as "after_--disable_abort_on_error" ; eval select $mysql_errno as "after_--disable_abort_on_error" ;
...@@ -280,9 +303,11 @@ select 3 from t1 ; ...@@ -280,9 +303,11 @@ select 3 from t1 ;
# masked failing statements # masked failing statements
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# expected error = response # expected error = response
--error 1146 --error ER_NO_SUCH_TABLE
select 3 from t1 ; select 3 from t1 ;
--error 1146 --error ER_NO_SUCH_TABLE
select 3 from t1 ; select 3 from t1 ;
eval select $mysql_errno as "after_!errno_masked_error" ; eval select $mysql_errno as "after_!errno_masked_error" ;
# expected error <> response # expected error <> response
...@@ -296,7 +321,8 @@ eval select $mysql_errno as "after_!errno_masked_error" ; ...@@ -296,7 +321,8 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno # Switch the abort on error on and check the effect on $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error ER_PARSE_ERROR
garbage ; garbage ;
--enable_abort_on_error --enable_abort_on_error
eval select $mysql_errno as "after_--enable_abort_on_error" ; eval select $mysql_errno as "after_--enable_abort_on_error" ;
...@@ -305,7 +331,8 @@ eval select $mysql_errno as "after_--enable_abort_on_error" ; ...@@ -305,7 +331,8 @@ eval select $mysql_errno as "after_--enable_abort_on_error" ;
# masked failing statements # masked failing statements
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# expected error = response # expected error = response
--error 1146 --error ER_NO_SUCH_TABLE
select 3 from t1 ; select 3 from t1 ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -568,9 +595,6 @@ echo ; ...@@ -568,9 +595,6 @@ echo ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Illegal use of exec # Illegal use of exec
--error 1
--exec echo "--exec false" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1 --exec echo "--exec " | $MYSQL_TEST 2>&1
...@@ -951,8 +975,6 @@ system echo "hej" > /dev/null; ...@@ -951,8 +975,6 @@ system echo "hej" > /dev/null;
--exec echo "system;" | $MYSQL_TEST 2>&1 --exec echo "system;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "system false;" | $MYSQL_TEST 2>&1
--disable_abort_on_error --disable_abort_on_error
system NonExistsinfComamdn 2> /dev/null; system NonExistsinfComamdn 2> /dev/null;
...@@ -1370,7 +1392,8 @@ connection default; ...@@ -1370,7 +1392,8 @@ connection default;
let $num= 2; let $num= 2;
while ($num) while ($num)
{ {
--error 1064 --error ER_PARSE_ERROR
failing_statement; failing_statement;
dec $num; dec $num;
...@@ -1429,7 +1452,7 @@ select "this will be executed"; ...@@ -1429,7 +1452,7 @@ select "this will be executed";
# #
# Test zero length result file. Should not pass # Test zero length result file. Should not pass
# #
--exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result --exec echo '' > $MYSQLTEST_VARDIR/tmp/zero_length_file.result
--exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql --exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql
--error 1 --error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1 --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1
...@@ -1482,7 +1505,8 @@ drop table t1; ...@@ -1482,7 +1505,8 @@ drop table t1;
--error 1 --error 1
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1 --exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
# The .out file should be non existent # The .out file should be non existent
--exec test ! -s $MYSQLTEST_VARDIR/tmp/bug11731.out --error 1
--file_exists $MYSQLTEST_VARDIR/tmp/bug11731.out
drop table t1; drop table t1;
...@@ -1503,7 +1527,7 @@ drop table t1; ...@@ -1503,7 +1527,7 @@ drop table t1;
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1 --exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
# The .out file should exist # The .out file should exist
--exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out --file_exists $MYSQLTEST_VARDIR/tmp/bug11731.out
drop table t1; drop table t1;
remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out; remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out;
remove_file $MYSQLTEST_VARDIR/log/bug11731.log; remove_file $MYSQLTEST_VARDIR/log/bug11731.log;
...@@ -1515,14 +1539,17 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql; ...@@ -1515,14 +1539,17 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql;
# It should be possible to use the command "query" to force mysqltest to # It should be possible to use the command "query" to force mysqltest to
# send the command to the server although it's a builtin mysqltest command. # send the command to the server although it's a builtin mysqltest command.
--error 1064 --error ER_PARSE_ERROR
query sleep; query sleep;
--error 1064 --error ER_PARSE_ERROR
--query sleep --query sleep
# Just an empty query command # Just an empty query command
--error 1065 --error ER_EMPTY_QUERY
query ; query ;
# test for replace_regex # test for replace_regex
...@@ -1915,7 +1942,8 @@ eval $my_stmt; ...@@ -1915,7 +1942,8 @@ eval $my_stmt;
# 8. Ensure that "sorted_result " does not change the semantics of # 8. Ensure that "sorted_result " does not change the semantics of
# "--error ...." or the protocol output after such an expected failure # "--error ...." or the protocol output after such an expected failure
--sorted_result --sorted_result
--error 1146 --error ER_NO_SUCH_TABLE
SELECT '2' as "my_col1",2 as "my_col2" SELECT '2' as "my_col1",2 as "my_col2"
UNION UNION
SELECT '1',1 from t2; SELECT '1',1 from t2;
......
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
# Bug#41308: Test main.ndb_autodiscover.test doesn't work on Windows due
# to 'grep' calls
# Test is currently disabled on Windows via the next line until this bug
# can be resolved.
--source include/not_windows.inc
--disable_warnings --disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--enable_warnings --enable_warnings
......
...@@ -293,7 +293,8 @@ STOP SLAVE; ...@@ -293,7 +293,8 @@ STOP SLAVE;
connection master; connection master;
FLUSH LOGS; FLUSH LOGS;
exec cp $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLTEST_VARDIR/log/master-bin.000001; --remove_file $MYSQLTEST_VARDIR/log/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLTEST_VARDIR/log/master-bin.000001
# Make the slave to replay the new binlog. # Make the slave to replay the new binlog.
......
...@@ -50,9 +50,7 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost; ...@@ -50,9 +50,7 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
CREATE TABLE t1(num_value INT); CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT); CREATE TABLE t2(user_str TEXT);
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
# #
# Remove definers from TRG file. # Remove definers from TRG file.
...@@ -61,8 +59,24 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 ...@@ -61,8 +59,24 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
--echo --echo
--echo ---> patching t1.TRG... --echo ---> patching t1.TRG...
--exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG # Here we remove definers. This is somewhat complex than the original test
--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG # Previously, the test only used grep -v 'definers=' t1.TRG, but grep is not
# portable and we have to load the file into a table, exclude the definers line,
# then load the data to an outfile to accomplish the same effect
--disable_query_log
--connection default
CREATE TABLE patch (a blob);
eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG' INTO TABLE patch;
# remove original t1.TRG file so SELECT INTO OUTFILE won't fail
--remove_file $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
eval SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE
'$MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG'
FROM patch;
DROP TABLE patch;
--connection wl2818_definer_con
--enable_query_log
# #
# Create a new trigger. # Create a new trigger.
......
...@@ -17,9 +17,9 @@ my %opt = ( ...@@ -17,9 +17,9 @@ my %opt = (
); );
GetOptions(\%opt, GetOptions(\%opt,
'verbose|v+',# verbose 'v|verbose+',# verbose
'help+', # write usage info 'help+', # write usage info
'debug|d+', # debug 'd|debug+', # debug
's=s', # what to sort by (t, at, l, al, r, ar etc) 's=s', # what to sort by (t, at, l, al, r, ar etc)
'r!', # reverse the sort order (largest last instead of first) 'r!', # reverse the sort order (largest last instead of first)
't=i', # just show the top n queries 't=i', # just show the top n queries
......
...@@ -3731,7 +3731,6 @@ convert_search_mode_to_innobase( ...@@ -3731,7 +3731,6 @@ convert_search_mode_to_innobase(
case HA_READ_MBR_WITHIN: case HA_READ_MBR_WITHIN:
case HA_READ_MBR_DISJOINT: case HA_READ_MBR_DISJOINT:
case HA_READ_MBR_EQUAL: case HA_READ_MBR_EQUAL:
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
return(PAGE_CUR_UNSUPP); return(PAGE_CUR_UNSUPP);
/* do not use "default:" in order to produce a gcc warning: /* do not use "default:" in order to produce a gcc warning:
enumeration value '...' not handled in switch enumeration value '...' not handled in switch
...@@ -5212,7 +5211,7 @@ ha_innobase::records_in_range( ...@@ -5212,7 +5211,7 @@ ha_innobase::records_in_range(
mode2); mode2);
} else { } else {
n_rows = 0; n_rows = HA_POS_ERROR;
} }
dtuple_free_for_mysql(heap1); dtuple_free_for_mysql(heap1);
......
...@@ -186,39 +186,44 @@ int initgroups(const char *,unsigned int); ...@@ -186,39 +186,44 @@ int initgroups(const char *,unsigned int);
#ifdef HAVE_FP_EXCEPT // Fix type conflict #ifdef HAVE_FP_EXCEPT // Fix type conflict
typedef fp_except fp_except_t; typedef fp_except fp_except_t;
#endif #endif
#endif /* __FreeBSD__ && HAVE_IEEEFP_H */
#ifdef HAVE_FENV_H
#include <fenv.h>
#endif
#ifdef HAVE_SYS_FPU_H
/* for IRIX to use set_fpc_csr() */
#include <sys/fpu.h>
#endif
inline void setup_fpu()
{
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
/* We can't handle floating point exceptions with threads, so disable /* We can't handle floating point exceptions with threads, so disable
this on freebsd this on freebsd
Don't fall for overflow, underflow,divide-by-zero or loss of precision
*/ */
inline void set_proper_floating_point_mode()
{
/* Don't fall for overflow, underflow,divide-by-zero or loss of precision */
#if defined(__i386__) #if defined(__i386__)
fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ | fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP)); FP_X_IMP));
#else #else
fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ | fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP)); FP_X_IMP));
#endif #endif /* __i386__ */
} #endif /* __FreeBSD__ && HAVE_IEEEFP_H */
#elif defined(__sgi)
/* for IRIX to use set_fpc_csr() */
#include <sys/fpu.h>
inline void set_proper_floating_point_mode() #ifdef HAVE_FESETROUND
{ /* Set FPU rounding mode to "round-to-nearest" */
fesetround(FE_TONEAREST);
#endif /* HAVE_FESETROUND */
#if defined(__sgi) && defined(HAVE_SYS_FPU_H)
/* Enable denormalized DOUBLE values support for IRIX */ /* Enable denormalized DOUBLE values support for IRIX */
{
union fpc_csr n; union fpc_csr n;
n.fc_word = get_fpc_csr(); n.fc_word = get_fpc_csr();
n.fc_struct.flush = 0; n.fc_struct.flush = 0;
set_fpc_csr(n.fc_word); set_fpc_csr(n.fc_word);
} #endif
} }
#else
#define set_proper_floating_point_mode()
#endif /* __FreeBSD__ && HAVE_IEEEFP_H */
} /* cplusplus */ } /* cplusplus */
...@@ -3279,7 +3284,7 @@ static int init_server_components() ...@@ -3279,7 +3284,7 @@ static int init_server_components()
query_cache_init(); query_cache_init();
query_cache_resize(query_cache_size); query_cache_resize(query_cache_size);
randominit(&sql_rand,(ulong) server_start_time,(ulong) server_start_time/2); randominit(&sql_rand,(ulong) server_start_time,(ulong) server_start_time/2);
set_proper_floating_point_mode(); setup_fpu();
init_thr_lock(); init_thr_lock();
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
init_slave_list(); init_slave_list();
......
...@@ -151,6 +151,9 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables) ...@@ -151,6 +151,9 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
} }
VOID(pthread_mutex_unlock(&LOCK_open)); VOID(pthread_mutex_unlock(&LOCK_open));
} }
/* Mark table as closed, ready for re-open if necessary. */
tables->table= NULL;
} }
/* /*
...@@ -168,8 +171,7 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables) ...@@ -168,8 +171,7 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
'reopen' is set when a handler table is to be re-opened. In this case, 'reopen' is set when a handler table is to be re-opened. In this case,
'tables' is the pointer to the hashed TABLE_LIST object which has been 'tables' is the pointer to the hashed TABLE_LIST object which has been
saved on the original open. saved on the original open.
'reopen' is also used to suppress the sending of an 'ok' message or 'reopen' is also used to suppress the sending of an 'ok' message.
error messages.
RETURN RETURN
FALSE OK FALSE OK
...@@ -205,7 +207,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) ...@@ -205,7 +207,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
strlen(tables->alias) + 1)) strlen(tables->alias) + 1))
{ {
DBUG_PRINT("info",("duplicate '%s'", tables->alias)); DBUG_PRINT("info",("duplicate '%s'", tables->alias));
if (! reopen)
my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias); my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias);
goto err; goto err;
} }
...@@ -251,7 +252,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) ...@@ -251,7 +252,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
/* There can be only one table in '*tables'. */ /* There can be only one table in '*tables'. */
if (! (tables->table->file->table_flags() & HA_CAN_SQL_HANDLER)) if (! (tables->table->file->table_flags() & HA_CAN_SQL_HANDLER))
{ {
if (! reopen)
my_error(ER_ILLEGAL_HA, MYF(0), tables->alias); my_error(ER_ILLEGAL_HA, MYF(0), tables->alias);
goto err; goto err;
} }
...@@ -464,8 +464,7 @@ retry: ...@@ -464,8 +464,7 @@ retry:
if (need_reopen) if (need_reopen)
{ {
mysql_ha_close_table(thd, tables); mysql_ha_close_table(thd, hash_tables);
hash_tables->table= NULL;
/* /*
The lock might have been aborted, we need to manually reset The lock might have been aborted, we need to manually reset
thd->some_tables_deleted because handler's tables are closed thd->some_tables_deleted because handler's tables are closed
......
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