Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9bedb0f2
Commit
9bedb0f2
authored
Feb 01, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
parents
6ece0347
f2639d38
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
348 additions
and
40 deletions
+348
-40
client/mysql.cc
client/mysql.cc
+6
-6
client/mysqldump.c
client/mysqldump.c
+2
-2
config/ac-macros/character_sets.m4
config/ac-macros/character_sets.m4
+17
-0
extra/perror.c
extra/perror.c
+12
-1
mysql-test/include/have_cp932.inc
mysql-test/include/have_cp932.inc
+4
-0
mysql-test/include/have_eucjpms.inc
mysql-test/include/have_eucjpms.inc
+4
-0
mysql-test/r/client_xml.result
mysql-test/r/client_xml.result
+74
-0
mysql-test/r/compare.result
mysql-test/r/compare.result
+3
-0
mysql-test/r/have_cp932.require
mysql-test/r/have_cp932.require
+2
-0
mysql-test/r/have_eucjpms.require
mysql-test/r/have_eucjpms.require
+2
-0
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+19
-19
mysql-test/r/rpl_multi_update2.result
mysql-test/r/rpl_multi_update2.result
+42
-0
mysql-test/t/client_xml.test
mysql-test/t/client_xml.test
+18
-0
mysql-test/t/compare.test
mysql-test/t/compare.test
+3
-0
mysql-test/t/ctype_cp932.test
mysql-test/t/ctype_cp932.test
+2
-0
mysql-test/t/ctype_eucjpms.test
mysql-test/t/ctype_eucjpms.test
+3
-0
mysql-test/t/rpl_multi_update2-slave.opt
mysql-test/t/rpl_multi_update2-slave.opt
+1
-0
mysql-test/t/rpl_multi_update2.test
mysql-test/t/rpl_multi_update2.test
+33
-0
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+10
-4
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_cache.cc
sql/sql_cache.cc
+4
-0
sql/sql_parse.cc
sql/sql_parse.cc
+83
-3
sql/sql_table.cc
sql/sql_table.cc
+2
-4
strings/ctype-simple.c
strings/ctype-simple.c
+1
-1
No files found.
client/mysql.cc
View file @
9bedb0f2
...
@@ -155,6 +155,8 @@ static char mysql_charsets_dir[FN_REFLEN+1];
...
@@ -155,6 +155,8 @@ static char mysql_charsets_dir[FN_REFLEN+1];
static
const
char
*
xmlmeta
[]
=
{
static
const
char
*
xmlmeta
[]
=
{
"&"
,
"&"
,
"&"
,
"&"
,
"<"
,
"<"
,
"<"
,
"<"
,
">"
,
">"
,
"
\"
"
,
"""
,
0
,
0
0
,
0
};
};
static
const
char
*
day_names
[]
=
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
static
const
char
*
day_names
[]
=
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
...
@@ -2126,13 +2128,11 @@ print_table_data_xml(MYSQL_RES *result)
...
@@ -2126,13 +2128,11 @@ print_table_data_xml(MYSQL_RES *result)
(
void
)
tee_fputs
(
"
\n
<row>
\n
"
,
PAGER
);
(
void
)
tee_fputs
(
"
\n
<row>
\n
"
,
PAGER
);
for
(
uint
i
=
0
;
i
<
mysql_num_fields
(
result
);
i
++
)
for
(
uint
i
=
0
;
i
<
mysql_num_fields
(
result
);
i
++
)
{
{
tee_fprintf
(
PAGER
,
"
\t
<
%s>"
,
(
fields
[
i
].
name
?
tee_fprintf
(
PAGER
,
"
\t
<
field name=
\"
"
);
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
xmlencode_print
(
fields
[
i
].
name
,
strlen
(
fields
[
i
].
name
));
" "
)
:
"NULL"
)
);
tee_fprintf
(
PAGER
,
"
\"
>"
);
xmlencode_print
(
cur
[
i
],
lengths
[
i
]);
xmlencode_print
(
cur
[
i
],
lengths
[
i
]);
tee_fprintf
(
PAGER
,
"</%s>
\n
"
,
(
fields
[
i
].
name
?
tee_fprintf
(
PAGER
,
"</field>
\n
"
);
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
" "
)
:
"NULL"
));
}
}
(
void
)
tee_fputs
(
" </row>
\n
"
,
PAGER
);
(
void
)
tee_fputs
(
" </row>
\n
"
,
PAGER
);
}
}
...
...
client/mysqldump.c
View file @
9bedb0f2
...
@@ -493,7 +493,7 @@ static void write_header(FILE *sql_file, char *db_name)
...
@@ -493,7 +493,7 @@ static void write_header(FILE *sql_file, char *db_name)
"
);
"
);
}
}
fprintf
(
sql_file
,
fprintf
(
sql_file
,
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
\"
%s%s%s
\"
*/;
\n
"
,
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'%s%s%s'
*/;
\n
"
,
path
?
""
:
"NO_AUTO_VALUE_ON_ZERO"
,
compatible_mode_normal_str
[
0
]
==
0
?
""
:
","
,
path
?
""
:
"NO_AUTO_VALUE_ON_ZERO"
,
compatible_mode_normal_str
[
0
]
==
0
?
""
:
","
,
compatible_mode_normal_str
);
compatible_mode_normal_str
);
check_io
(
sql_file
);
check_io
(
sql_file
);
...
@@ -867,7 +867,7 @@ static int dbConnect(char *host, char *user,char *passwd)
...
@@ -867,7 +867,7 @@ static int dbConnect(char *host, char *user,char *passwd)
cannot reconnect.
cannot reconnect.
*/
*/
sock
->
reconnect
=
0
;
sock
->
reconnect
=
0
;
sprintf
(
buff
,
"/*!40100 SET @@SQL_MODE=
\"
%s
\"
*/"
,
sprintf
(
buff
,
"/*!40100 SET @@SQL_MODE=
'%s'
*/"
,
compatible_mode_normal_str
);
compatible_mode_normal_str
);
if
(
mysql_query_with_error_report
(
sock
,
0
,
buff
))
if
(
mysql_query_with_error_report
(
sock
,
0
,
buff
))
{
{
...
...
config/ac-macros/character_sets.m4
View file @
9bedb0f2
...
@@ -405,3 +405,20 @@ AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
...
@@ -405,3 +405,20 @@ AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
[Define the default charset name])
[Define the default charset name])
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"],
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"],
[Define the default charset name])
[Define the default charset name])
# Shall we build the UCA-based Unicode collations
AC_ARG_WITH(uca,
[ --without-uca Skip building of the national Unicode collations.],
[with_uca=$withval],
[with_uca=yes]
)
AC_MSG_CHECKING([whether to compile national Unicode collations])
if test "$with_uca" = "yes"
then
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations])
else
AC_MSG_RESULT(no)
fi
extra/perror.c
View file @
9bedb0f2
...
@@ -189,6 +189,7 @@ int main(int argc,char *argv[])
...
@@ -189,6 +189,7 @@ int main(int argc,char *argv[])
{
{
int
error
,
code
,
found
;
int
error
,
code
,
found
;
const
char
*
msg
;
const
char
*
msg
;
char
*
unknown_error
=
0
;
MY_INIT
(
argv
[
0
]);
MY_INIT
(
argv
[
0
]);
if
(
get_options
(
&
argc
,
&
argv
))
if
(
get_options
(
&
argc
,
&
argv
))
...
@@ -217,7 +218,12 @@ int main(int argc,char *argv[])
...
@@ -217,7 +218,12 @@ int main(int argc,char *argv[])
string 'Unknown Error'. To avoid printing it we try to find the
string 'Unknown Error'. To avoid printing it we try to find the
error string by asking for an impossible big error message.
error string by asking for an impossible big error message.
*/
*/
const
char
*
unknown_error
=
strerror
(
10000
);
msg
=
strerror
(
10000
);
/* allocate a buffer for unknown_error since strerror always returns the same pointer
on some platforms such as Windows */
unknown_error
=
malloc
(
strlen
(
msg
)
+
1
);
strcpy
(
unknown_error
,
msg
);
for
(
;
argc
--
>
0
;
argv
++
)
for
(
;
argc
--
>
0
;
argv
++
)
{
{
...
@@ -267,6 +273,11 @@ int main(int argc,char *argv[])
...
@@ -267,6 +273,11 @@ int main(int argc,char *argv[])
}
}
}
}
}
}
/* if we allocated a buffer for unknown_error, free it now */
if
(
unknown_error
)
free
(
unknown_error
);
exit
(
error
);
exit
(
error
);
return
error
;
return
error
;
}
}
mysql-test/include/have_cp932.inc
0 → 100644
View file @
9bedb0f2
--
require
r
/
have_cp932
.
require
disable_query_log
;
show
collation
like
"cp932_japanese_ci"
;
enable_query_log
;
mysql-test/include/have_eucjpms.inc
0 → 100644
View file @
9bedb0f2
--
require
r
/
have_eucjpms
.
require
disable_query_log
;
show
collation
like
"eucjpms_japanese_ci"
;
enable_query_log
;
mysql-test/r/client_xml.result
0 → 100644
View file @
9bedb0f2
create table t1 (
`a&b` int,
`a<b` int,
`a>b` text
);
insert into t1 values (1, 2, 'a&b a<b a>b');
<?xml version="1.0"?>
<resultset statement="select * from t1
">
<row>
<field name="a&b">1</field>
<field name="a<b">2</field>
<field name="a>b">a&b a<b a>b</field>
</row>
</resultset>
<?xml version="1.0"?>
<mysqldump>
<database name="test">
<table_structure name="t1">
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a<b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a>b" Type="text" Null="YES" Key="" Extra="" />
</table_structure>
<table_data name="t1">
<row>
<field name="a&b">1</field>
<field name="a<b">2</field>
<field name="a>b">a&b a<b a>b</field>
</row>
</table_data>
</database>
</mysqldump>
<?xml version="1.0"?>
<resultset statement="select count(*) from t1
">
<row>
<field name="count(*)">1</field>
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="select 1 < 2 from dual
">
<row>
<field name="1 < 2">1</field>
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="select 1 > 2 from dual
">
<row>
<field name="1 > 2">0</field>
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="select 1 & 3 from dual
">
<row>
<field name="1 & 3">1</field>
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="select null from dual
">
<row>
<field name="NULL">NULL</field>
</row>
</resultset>
drop table t1;
mysql-test/r/compare.result
View file @
9bedb0f2
...
@@ -36,3 +36,6 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
...
@@ -36,3 +36,6 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
6109 -1 -1
6109 -1 -1
61 0 0
61 0 0
DROP TABLE t1;
DROP TABLE t1;
SELECT CHAR(31) = '', '' = CHAR(31);
CHAR(31) = '' '' = CHAR(31)
0 0
mysql-test/r/have_cp932.require
0 → 100644
View file @
9bedb0f2
Collation Charset Id Default Compiled Sortlen
cp932_japanese_ci cp932 95 Yes Yes 1
mysql-test/r/have_eucjpms.require
0 → 100644
View file @
9bedb0f2
Collation Charset Id Default Compiled Sortlen
eucjpms_japanese_ci eucjpms 97 Yes Yes 1
mysql-test/r/mysqldump.result
View file @
9bedb0f2
...
@@ -63,7 +63,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
...
@@ -63,7 +63,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` decimal(10,5) default NULL,
`a` decimal(10,5) default NULL,
...
@@ -86,7 +86,7 @@ UNLOCK TABLES;
...
@@ -86,7 +86,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` decimal(10,5) default NULL,
`a` decimal(10,5) default NULL,
`b` float default NULL
`b` float default NULL
...
@@ -152,7 +152,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
...
@@ -152,7 +152,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` varchar(255) default NULL
`a` varchar(255) default NULL
...
@@ -178,7 +178,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM;
...
@@ -178,7 +178,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t1 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL40"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL40'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -197,7 +197,7 @@ UNLOCK TABLES;
...
@@ -197,7 +197,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL323"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL323'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -228,7 +228,7 @@ create table t1(a int);
...
@@ -228,7 +228,7 @@ create table t1(a int);
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -249,7 +249,7 @@ UNLOCK TABLES;
...
@@ -249,7 +249,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,ANSI"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,ANSI'
*/;
DROP TABLE IF EXISTS "t1";
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
CREATE TABLE "t1" (
"a" int(11) default NULL
"a" int(11) default NULL
...
@@ -273,7 +273,7 @@ set global sql_mode='ANSI_QUOTES';
...
@@ -273,7 +273,7 @@ set global sql_mode='ANSI_QUOTES';
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -294,7 +294,7 @@ UNLOCK TABLES;
...
@@ -294,7 +294,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,ANSI"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,ANSI'
*/;
DROP TABLE IF EXISTS "t1";
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
CREATE TABLE "t1" (
"a" int(11) default NULL
"a" int(11) default NULL
...
@@ -319,7 +319,7 @@ insert into t1 values (1),(2),(3);
...
@@ -319,7 +319,7 @@ insert into t1 values (1),(2),(3);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
""
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
''
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -344,7 +344,7 @@ create view v1 as select * from t1;
...
@@ -344,7 +344,7 @@ create view v1 as select * from t1;
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` int(11) default NULL
`a` int(11) default NULL
...
@@ -375,7 +375,7 @@ drop table t1;
...
@@ -375,7 +375,7 @@ drop table t1;
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
...
@@ -396,7 +396,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
...
@@ -396,7 +396,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
...
@@ -419,7 +419,7 @@ INSERT INTO t1 VALUES (_latin1 '
...
@@ -419,7 +419,7 @@ INSERT INTO t1 VALUES (_latin1 '
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` char(10) default NULL
`a` char(10) default NULL
...
@@ -441,7 +441,7 @@ UNLOCK TABLES;
...
@@ -441,7 +441,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL323"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL323'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` char(10) default NULL
`a` char(10) default NULL
...
@@ -460,7 +460,7 @@ UNLOCK TABLES;
...
@@ -460,7 +460,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL323"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL323'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` char(10) default NULL
`a` char(10) default NULL
...
@@ -479,7 +479,7 @@ UNLOCK TABLES;
...
@@ -479,7 +479,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL323"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL323'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` char(10) default NULL
`a` char(10) default NULL
...
@@ -498,7 +498,7 @@ UNLOCK TABLES;
...
@@ -498,7 +498,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO,MYSQL323"
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
'NO_AUTO_VALUE_ON_ZERO,MYSQL323'
*/;
DROP TABLE IF EXISTS `t1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
CREATE TABLE `t1` (
`a` char(10) default NULL
`a` char(10) default NULL
...
@@ -527,7 +527,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
...
@@ -527,7 +527,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!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'
*/;
DROP TABLE IF EXISTS `t2`;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
CREATE TABLE `t2` (
`a` int(11) default NULL
`a` int(11) default NULL
...
...
mysql-test/r/rpl_multi_update2.result
0 → 100644
View file @
9bedb0f2
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=MyISAM;
CREATE TABLE t2 (
a int unsigned not null auto_increment primary key,
b int unsigned
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1;
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
SELECT * FROM t1 ORDER BY a;
a b
1 0
2 0
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
SELECT * FROM t1 ORDER BY a;
a b
1 4
2 5
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
SELECT * FROM t1 ORDER BY a;
a b
1 4
2 5
SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
mysql-test/t/client_xml.test
0 → 100644
View file @
9bedb0f2
# Test of the xml output of the 'mysql' and 'mysqldump' clients -- makes
# sure that basic encoding issues are handled properly
create
table
t1
(
`a&b`
int
,
`a<b`
int
,
`a>b`
text
);
insert
into
t1
values
(
1
,
2
,
'a&b a<b a>b'
);
--
exec
$MYSQL
--
xml
test
-
e
'select * from t1'
--
exec
$MYSQL_DUMP
--
xml
--
skip
-
create
test
--
exec
$MYSQL
--
xml
test
-
e
'select count(*) from t1'
--
exec
$MYSQL
--
xml
test
-
e
'select 1 < 2 from dual'
--
exec
$MYSQL
--
xml
test
-
e
'select 1 > 2 from dual'
--
exec
$MYSQL
--
xml
test
-
e
'select 1 & 3 from dual'
--
exec
$MYSQL
--
xml
test
-
e
'select null from dual'
drop
table
t1
;
mysql-test/t/compare.test
View file @
9bedb0f2
...
@@ -30,3 +30,6 @@ CREATE TABLE t1 (a char(10) not null);
...
@@ -30,3 +30,6 @@ CREATE TABLE t1 (a char(10) not null);
INSERT
INTO
t1
VALUES
(
'a'
),(
'a\0'
),(
'a\t'
),(
'a '
);
INSERT
INTO
t1
VALUES
(
'a'
),(
'a\0'
),(
'a\t'
),(
'a '
);
SELECT
hex
(
a
),
STRCMP
(
a
,
'a'
),
STRCMP
(
a
,
'a '
)
FROM
t1
;
SELECT
hex
(
a
),
STRCMP
(
a
,
'a'
),
STRCMP
(
a
,
'a '
)
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# Bug #8134: Comparison against CHAR(31) at end of string
SELECT
CHAR
(
31
)
=
''
,
''
=
CHAR
(
31
);
mysql-test/t/ctype_cp932.test
View file @
9bedb0f2
--
source
include
/
have_cp932
.
inc
--
character_set
cp932
--
character_set
cp932
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
...
...
mysql-test/t/ctype_eucjpms.test
View file @
9bedb0f2
--
source
include
/
have_eucjpms
.
inc
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
drop
table
if
exists
t2
;
drop
table
if
exists
t2
;
...
...
mysql-test/t/rpl_multi_update2-slave.opt
0 → 100644
View file @
9bedb0f2
--replicate-ignore-table=nothing.sensible
mysql-test/t/rpl_multi_update2.test
0 → 100644
View file @
9bedb0f2
# Let's verify that multi-update is not always skipped by slave if
# some replicate-* rules exist.
# (BUG#7011)
source
include
/
master
-
slave
.
inc
;
CREATE
TABLE
t1
(
a
int
unsigned
not
null
auto_increment
primary
key
,
b
int
unsigned
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t2
(
a
int
unsigned
not
null
auto_increment
primary
key
,
b
int
unsigned
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
NULL
,
0
);
INSERT
INTO
t1
SELECT
NULL
,
0
FROM
t1
;
INSERT
INTO
t2
VALUES
(
NULL
,
0
),
(
NULL
,
1
);
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
UPDATE
t1
,
t2
SET
t1
.
b
=
(
t2
.
b
+
4
)
WHERE
t1
.
a
=
t2
.
a
;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
save_master_pos
;
connection
slave
;
sync_with_master
;
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
*
FROM
t2
ORDER
BY
a
;
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
View file @
9bedb0f2
...
@@ -219,6 +219,7 @@ AsyncFile::run()
...
@@ -219,6 +219,7 @@ AsyncFile::run()
rmrfReq
(
request
,
(
char
*
)
theFileName
.
c_str
(),
request
->
par
.
rmrf
.
own_directory
);
rmrfReq
(
request
,
(
char
*
)
theFileName
.
c_str
(),
request
->
par
.
rmrf
.
own_directory
);
break
;
break
;
case
Request
:
:
end
:
case
Request
:
:
end
:
if
(
theFd
>
0
)
closeReq
(
request
);
closeReq
(
request
);
endReq
();
endReq
();
return
;
return
;
...
@@ -239,6 +240,7 @@ void AsyncFile::openReq(Request* request)
...
@@ -239,6 +240,7 @@ void AsyncFile::openReq(Request* request)
{
{
m_openedWithSync
=
false
;
m_openedWithSync
=
false
;
m_syncFrequency
=
0
;
m_syncFrequency
=
0
;
m_syncCount
=
0
;
// for open.flags, see signal FSOPENREQ
// for open.flags, see signal FSOPENREQ
#ifdef NDB_WIN32
#ifdef NDB_WIN32
...
@@ -329,7 +331,6 @@ void AsyncFile::openReq(Request* request)
...
@@ -329,7 +331,6 @@ void AsyncFile::openReq(Request* request)
} else {
} else {
#endif
#endif
m_openedWithSync
=
false
;
m_openedWithSync
=
false
;
m_syncCount
=
0
;
m_syncFrequency
=
Global_syncFreq
;
m_syncFrequency
=
Global_syncFreq
;
#if 0
#if 0
}
}
...
@@ -656,6 +657,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset,
...
@@ -656,6 +657,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset,
}
}
#endif
#endif
m_syncCount
+=
bytes_written
;
buf
+=
bytes_written
;
buf
+=
bytes_written
;
size
-=
bytes_written
;
size
-=
bytes_written
;
offset
+=
bytes_written
;
offset
+=
bytes_written
;
...
@@ -682,6 +684,10 @@ AsyncFile::closeReq(Request * request)
...
@@ -682,6 +684,10 @@ AsyncFile::closeReq(Request * request)
hFile
=
INVALID_HANDLE_VALUE
;
hFile
=
INVALID_HANDLE_VALUE
;
#else
#else
if
(
-
1
==
::
close
(
theFd
))
{
if
(
-
1
==
::
close
(
theFd
))
{
#ifndef DBUG_OFF
if
(
theFd
==
-
1
)
abort
();
#endif
request
->
error
=
errno
;
request
->
error
=
errno
;
}
}
theFd
=
-
1
;
theFd
=
-
1
;
...
@@ -700,7 +706,8 @@ bool AsyncFile::isOpen(){
...
@@ -700,7 +706,8 @@ bool AsyncFile::isOpen(){
void
void
AsyncFile
::
syncReq
(
Request
*
request
)
AsyncFile
::
syncReq
(
Request
*
request
)
{
{
if
(
m_openedWithSync
){
if
(
m_openedWithSync
||
m_syncCount
==
0
){
return
;
return
;
}
}
#ifdef NDB_WIN32
#ifdef NDB_WIN32
...
@@ -756,7 +763,6 @@ AsyncFile::appendReq(Request * request){
...
@@ -756,7 +763,6 @@ AsyncFile::appendReq(Request * request){
if
(
m_syncFrequency
!=
0
&&
m_syncCount
>
m_syncFrequency
){
if
(
m_syncFrequency
!=
0
&&
m_syncCount
>
m_syncFrequency
){
syncReq
(
request
);
syncReq
(
request
);
request
->
error
=
0
;
}
}
}
}
...
...
sql/mysql_priv.h
View file @
9bedb0f2
...
@@ -446,6 +446,7 @@ Item *negate_expression(THD *thd, Item *expr);
...
@@ -446,6 +446,7 @@ Item *negate_expression(THD *thd, Item *expr);
struct
Query_cache_query_flags
struct
Query_cache_query_flags
{
{
unsigned
int
client_long_flag
:
1
;
unsigned
int
client_long_flag
:
1
;
unsigned
int
client_protocol_41
:
1
;
uint
character_set_client_num
;
uint
character_set_client_num
;
uint
character_set_results_num
;
uint
character_set_results_num
;
uint
collation_connection_num
;
uint
collation_connection_num
;
...
...
sql/sql_cache.cc
View file @
9bedb0f2
...
@@ -777,6 +777,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
...
@@ -777,6 +777,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
bzero
(
&
flags
,
QUERY_CACHE_FLAGS_SIZE
);
bzero
(
&
flags
,
QUERY_CACHE_FLAGS_SIZE
);
flags
.
client_long_flag
=
(
thd
->
client_capabilities
&
CLIENT_LONG_FLAG
?
flags
.
client_long_flag
=
(
thd
->
client_capabilities
&
CLIENT_LONG_FLAG
?
1
:
0
);
1
:
0
);
flags
.
client_protocol_41
=
(
thd
->
client_capabilities
&
CLIENT_PROTOCOL_41
?
1
:
0
);
flags
.
character_set_client_num
=
flags
.
character_set_client_num
=
thd
->
variables
.
character_set_client
->
number
;
thd
->
variables
.
character_set_client
->
number
;
flags
.
character_set_results_num
=
flags
.
character_set_results_num
=
...
@@ -974,6 +976,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
...
@@ -974,6 +976,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
bzero
(
&
flags
,
QUERY_CACHE_FLAGS_SIZE
);
bzero
(
&
flags
,
QUERY_CACHE_FLAGS_SIZE
);
flags
.
client_long_flag
=
(
thd
->
client_capabilities
&
CLIENT_LONG_FLAG
?
flags
.
client_long_flag
=
(
thd
->
client_capabilities
&
CLIENT_LONG_FLAG
?
1
:
0
);
1
:
0
);
flags
.
client_protocol_41
=
(
thd
->
client_capabilities
&
CLIENT_PROTOCOL_41
?
1
:
0
);
flags
.
character_set_client_num
=
thd
->
variables
.
character_set_client
->
number
;
flags
.
character_set_client_num
=
thd
->
variables
.
character_set_client
->
number
;
flags
.
character_set_results_num
=
flags
.
character_set_results_num
=
(
thd
->
variables
.
character_set_results
?
(
thd
->
variables
.
character_set_results
?
...
...
sql/sql_parse.cc
View file @
9bedb0f2
...
@@ -65,6 +65,7 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
...
@@ -65,6 +65,7 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
#endif
#endif
static
void
decrease_user_connections
(
USER_CONN
*
uc
);
static
void
decrease_user_connections
(
USER_CONN
*
uc
);
static
bool
check_db_used
(
THD
*
thd
,
TABLE_LIST
*
tables
);
static
bool
check_db_used
(
THD
*
thd
,
TABLE_LIST
*
tables
);
static
bool
check_multi_update_lock
(
THD
*
thd
);
static
void
remove_escape
(
char
*
name
);
static
void
remove_escape
(
char
*
name
);
static
void
refresh_status
(
void
);
static
void
refresh_status
(
void
);
static
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
static
bool
append_file_to_dir
(
THD
*
thd
,
const
char
**
filename_ptr
,
...
@@ -2077,6 +2078,8 @@ mysql_execute_command(THD *thd)
...
@@ -2077,6 +2078,8 @@ mysql_execute_command(THD *thd)
LEX
*
lex
=
thd
->
lex
;
LEX
*
lex
=
thd
->
lex
;
/* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */
/* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */
SELECT_LEX
*
select_lex
=
&
lex
->
select_lex
;
SELECT_LEX
*
select_lex
=
&
lex
->
select_lex
;
bool
slave_fake_lock
=
0
;
MYSQL_LOCK
*
fake_prev_lock
=
0
;
/* first table of first SELECT_LEX */
/* first table of first SELECT_LEX */
TABLE_LIST
*
first_table
=
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
;
TABLE_LIST
*
first_table
=
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
;
/* list of all tables in query */
/* list of all tables in query */
...
@@ -2123,6 +2126,22 @@ mysql_execute_command(THD *thd)
...
@@ -2123,6 +2126,22 @@ mysql_execute_command(THD *thd)
#ifdef HAVE_REPLICATION
#ifdef HAVE_REPLICATION
if
(
thd
->
slave_thread
)
if
(
thd
->
slave_thread
)
{
{
if
(
lex
->
sql_command
==
SQLCOM_UPDATE_MULTI
)
{
DBUG_PRINT
(
"info"
,(
"need faked locked tables"
));
if
(
check_multi_update_lock
(
thd
))
goto
error
;
/* Fix for replication, the tables are opened and locked,
now we pretend that we have performed a LOCK TABLES action */
fake_prev_lock
=
thd
->
locked_tables
;
if
(
thd
->
lock
)
thd
->
locked_tables
=
thd
->
lock
;
thd
->
lock
=
0
;
slave_fake_lock
=
1
;
}
/*
/*
Skip if we are in the slave thread, some table rules have been
Skip if we are in the slave thread, some table rules have been
given and the table list says the query should not be replicated
given and the table list says the query should not be replicated
...
@@ -4129,11 +4148,22 @@ mysql_execute_command(THD *thd)
...
@@ -4129,11 +4148,22 @@ mysql_execute_command(THD *thd)
default:
default:
thd
->
row_count_func
=
-
1
;
thd
->
row_count_func
=
-
1
;
}
}
goto
cleanup
;
DBUG_RETURN
(
res
||
thd
->
net
.
report_error
);
error:
error:
DBUG_RETURN
(
TRUE
);
res
=
1
;
cleanup:
if
(
unlikely
(
slave_fake_lock
))
{
DBUG_PRINT
(
"info"
,(
"undoing faked lock"
));
thd
->
lock
=
thd
->
locked_tables
;
thd
->
locked_tables
=
fake_prev_lock
;
if
(
thd
->
lock
==
thd
->
locked_tables
)
thd
->
lock
=
0
;
}
DBUG_RETURN
(
res
||
thd
->
net
.
report_error
);
}
}
...
@@ -5941,6 +5971,56 @@ bool check_simple_select()
...
@@ -5941,6 +5971,56 @@ bool check_simple_select()
return
0
;
return
0
;
}
}
/*
Setup locking for multi-table updates. Used by the replication slave.
Replication slave SQL thread examines (all_tables_not_ok()) the
locking state of referenced tables to determine if the query has to
be executed or ignored. Since in multi-table update, the
'default' lock is read-only, this lock is corrected early enough by
calling this function, before the slave decides to execute/ignore.
SYNOPSIS
check_multi_update_lock()
thd Current thread
RETURN VALUES
0 ok
1 error
*/
static
bool
check_multi_update_lock
(
THD
*
thd
)
{
bool
res
=
1
;
LEX
*
lex
=
thd
->
lex
;
TABLE_LIST
*
table
,
*
tables
=
lex
->
query_tables
;
DBUG_ENTER
(
"check_multi_update_lock"
);
if
(
check_db_used
(
thd
,
tables
))
goto
error
;
/*
Ensure that we have UPDATE or SELECT privilege for each table
The exact privilege is checked in mysql_multi_update()
*/
for
(
table
=
tables
;
table
;
table
=
table
->
next_local
)
{
TABLE_LIST
*
save
=
table
->
next_local
;
table
->
next_local
=
0
;
if
((
check_access
(
thd
,
UPDATE_ACL
,
table
->
db
,
&
table
->
grant
.
privilege
,
0
,
1
)
||
(
grant_option
&&
check_grant
(
thd
,
UPDATE_ACL
,
table
,
0
,
1
,
1
)))
&&
check_one_table_access
(
thd
,
SELECT_ACL
,
table
))
goto
error
;
table
->
next_local
=
save
;
}
if
(
mysql_multi_update_prepare
(
thd
))
goto
error
;
res
=
0
;
error:
DBUG_RETURN
(
res
);
}
Comp_creator
*
comp_eq_creator
(
bool
invert
)
Comp_creator
*
comp_eq_creator
(
bool
invert
)
{
{
...
...
sql/sql_table.cc
View file @
9bedb0f2
...
@@ -2394,8 +2394,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
...
@@ -2394,8 +2394,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
strxmov
(
src_path
,
(
*
tmp_table
)
->
s
->
path
,
reg_ext
,
NullS
);
strxmov
(
src_path
,
(
*
tmp_table
)
->
s
->
path
,
reg_ext
,
NullS
);
else
else
{
{
strxmov
(
src_path
,
mysql_data_home
,
"/"
,
src_db
,
"/"
,
src_table
,
fn_format
(
src_path
,
src_table
,
src_db
,
reg_ext
,
MYF
(
MY_UNPACK_FILENAME
));
reg_ext
,
NullS
);
if
(
access
(
src_path
,
F_OK
))
if
(
access
(
src_path
,
F_OK
))
{
{
my_error
(
ER_BAD_TABLE_ERROR
,
MYF
(
0
),
src_table
);
my_error
(
ER_BAD_TABLE_ERROR
,
MYF
(
0
),
src_table
);
...
@@ -2422,8 +2421,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
...
@@ -2422,8 +2421,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
}
}
else
else
{
{
strxmov
(
dst_path
,
mysql_data_home
,
"/"
,
db
,
"/"
,
table_name
,
fn_format
(
dst_path
,
table_name
,
db
,
reg_ext
,
MYF
(
MY_UNPACK_FILENAME
));
reg_ext
,
NullS
);
if
(
!
access
(
dst_path
,
F_OK
))
if
(
!
access
(
dst_path
,
F_OK
))
goto
table_exists
;
goto
table_exists
;
}
}
...
...
strings/ctype-simple.c
View file @
9bedb0f2
...
@@ -174,7 +174,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length,
...
@@ -174,7 +174,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length,
/* put shorter key in s */
/* put shorter key in s */
a_length
=
b_length
;
a_length
=
b_length
;
a
=
b
;
a
=
b
;
swap
=
-
1
;
/* swap sign of result */
swap
=
-
1
^
1
;
/* swap sign of result */
res
=
-
res
;
res
=
-
res
;
}
}
for
(
end
=
a
+
a_length
-
length
;
a
<
end
;
a
++
)
for
(
end
=
a
+
a_length
-
length
;
a
<
end
;
a
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment