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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d553728b
Commit
d553728b
authored
Nov 22, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/bkroot/mysql-5.0-rpl
into mysql.com:/home/bk/MERGE/mysql-5.0-merge
parents
fe652465
3fee8832
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
231 additions
and
149 deletions
+231
-149
mysql-test/r/ctype_cp932_binlog.result
mysql-test/r/ctype_cp932_binlog.result
+3
-3
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+23
-1
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+72
-72
mysql-test/r/rpl_charset_sjis.result
mysql-test/r/rpl_charset_sjis.result
+26
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+20
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+19
-19
mysql-test/t/rpl_charset_sjis.test
mysql-test/t/rpl_charset_sjis.test
+25
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+36
-48
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/sp_head.cc
sql/sp_head.cc
+6
-5
No files found.
mysql-test/r/ctype_cp932_binlog.result
View file @
d553728b
...
@@ -41,6 +41,6 @@ IN ind DECIMAL(10,2))
...
@@ -41,6 +41,6 @@ IN ind DECIMAL(10,2))
BEGIN
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
END
master-bin.000001 801 Query 1 10
06 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1'Foo\'s a Bar'
), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 801 Query 1 10
17 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172
), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 10
06 Query 1 1092
use `test`; DROP PROCEDURE bug18293
master-bin.000001 10
17 Query 1 1103
use `test`; DROP PROCEDURE bug18293
master-bin.000001 1
092 Query 1 1168
use `test`; DROP TABLE t4
master-bin.000001 1
103 Query 1 1179
use `test`; DROP TABLE t4
mysql-test/r/ctype_utf8.result
View file @
d553728b
...
@@ -124,12 +124,34 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
...
@@ -124,12 +124,34 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` var
binary(10)
default NULL
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` var
char(10) character set utf8
default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
2004-01-19
2004-01-19
drop table t1;
drop table t1;
set names utf8;
set LC_TIME_NAMES='fr_FR';
create table t1 (s1 char(20) character set latin1);
insert into t1 values (date_format('2004-02-02','%M'));
select hex(s1) from t1;
hex(s1)
66E97672696572
drop table t1;
create table t1 (s1 char(20) character set koi8r);
set LC_TIME_NAMES='ru_RU';
insert into t1 values (date_format('2004-02-02','%M'));
insert into t1 values (date_format('2004-02-02','%b'));
insert into t1 values (date_format('2004-02-02','%W'));
insert into t1 values (date_format('2004-02-02','%a'));
select hex(s1), s1 from t1;
hex(s1) s1
E6C5D7D2C1CCD1 Февраля
E6C5D7 Фев
F0CFCEC5C4C5CCD8CEC9CB Понедельник
F0CEC4 Пнд
drop table t1;
set LC_TIME_NAMES='en_US';
set names koi8r;
set names koi8r;
create table t1 (s1 char(1) character set utf8);
create table t1 (s1 char(1) character set utf8);
insert into t1 values (_koi8r'');
insert into t1 values (_koi8r'');
...
...
mysql-test/r/mysqldump.result
View file @
d553728b
...
@@ -1786,6 +1786,78 @@ CREATE TABLE `t1` (
...
@@ -1786,6 +1786,78 @@ CREATE TABLE `t1` (
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
drop table t1;
#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` INT,
`c"d` INT,
`e``f` INT,
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
"a b" int(11) NOT NULL default '0',
"c""d" int(11) NOT NULL default '0',
"e`f" int(11) NOT NULL default '0',
PRIMARY KEY ("a b","c""d","e`f")
);
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
INSERT INTO "t1" VALUES (815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL default '0',
`c"d` int(11) NOT NULL default '0',
`e``f` int(11) NOT NULL default '0',
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE `t1`;
End of 4.1 tests
End of 4.1 tests
#
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
...
@@ -3124,78 +3196,6 @@ drop user myDB_User;
...
@@ -3124,78 +3196,6 @@ drop user myDB_User;
drop database mysqldump_myDB;
drop database mysqldump_myDB;
use test;
use test;
#
#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` INT,
`c"d` INT,
`e``f` INT,
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
"a b" int(11) NOT NULL default '0',
"c""d" int(11) NOT NULL default '0',
"e`f" int(11) NOT NULL default '0',
PRIMARY KEY ("a b","c""d","e`f")
);
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
INSERT INTO "t1" VALUES (815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL default '0',
`c"d` int(11) NOT NULL default '0',
`e``f` int(11) NOT NULL default '0',
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE `t1`;
#
# Bug #19745: mysqldump --xml produces invalid xml
# Bug #19745: mysqldump --xml produces invalid xml
#
#
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
...
...
mysql-test/r/rpl_charset_sjis.result
0 → 100644
View file @
d553728b
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;
drop table if exists t1;
drop procedure if exists p1;
create table t1 (a varchar(255) character set sjis);
create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a);
SET NAMES binary;
CALL p1 ('–\\');
select "--- on master ---";
--- on master ---
--- on master ---
select hex(a) from t1 ;
hex(a)
965C
select "--- on slave ---";
--- on slave ---
--- on slave ---
select hex(a) from t1;
hex(a)
965C
drop table t1;
drop procedure p1;
mysql-test/t/ctype_utf8.test
View file @
d553728b
...
@@ -93,6 +93,26 @@ show create table t1;
...
@@ -93,6 +93,26 @@ show create table t1;
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug#22646 LC_TIME_NAMES: Assignment to non-UTF8 target fails
#
set
names
utf8
;
set
LC_TIME_NAMES
=
'fr_FR'
;
create
table
t1
(
s1
char
(
20
)
character
set
latin1
);
insert
into
t1
values
(
date_format
(
'2004-02-02'
,
'%M'
));
select
hex
(
s1
)
from
t1
;
drop
table
t1
;
create
table
t1
(
s1
char
(
20
)
character
set
koi8r
);
set
LC_TIME_NAMES
=
'ru_RU'
;
insert
into
t1
values
(
date_format
(
'2004-02-02'
,
'%M'
));
insert
into
t1
values
(
date_format
(
'2004-02-02'
,
'%b'
));
insert
into
t1
values
(
date_format
(
'2004-02-02'
,
'%W'
));
insert
into
t1
values
(
date_format
(
'2004-02-02'
,
'%a'
));
select
hex
(
s1
),
s1
from
t1
;
drop
table
t1
;
set
LC_TIME_NAMES
=
'en_US'
;
#
#
# Bug #2366 Wrong utf8 behaviour when data is truncated
# Bug #2366 Wrong utf8 behaviour when data is truncated
#
#
...
...
mysql-test/t/mysqldump.test
View file @
d553728b
...
@@ -713,6 +713,25 @@ create table t1 (a int);
...
@@ -713,6 +713,25 @@ create table t1 (a int);
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
force
test
t1
--
where
=
'xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
2
>&
1
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
force
test
t1
--
where
=
'xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
2
>&
1
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# BUG#13926: --order-by-primary fails if PKEY contains quote character
--
echo
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
`t1`
;
CREATE
TABLE
`t1`
(
`a b`
INT
,
`c"d`
INT
,
`e``f`
INT
,
PRIMARY
KEY
(
`a b`
,
`c"d`
,
`e``f`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
insert
into
t1
values
(
0815
,
4711
,
2006
);
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
compatible
=
ansi
--
order
-
by
-
primary
test
t1
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
order
-
by
-
primary
test
t1
DROP
TABLE
`t1`
;
--
enable_warnings
--
echo
End
of
4.1
tests
--
echo
End
of
4.1
tests
--
echo
#
--
echo
#
...
@@ -1393,25 +1412,6 @@ drop user myDB_User;
...
@@ -1393,25 +1412,6 @@ drop user myDB_User;
drop
database
mysqldump_myDB
;
drop
database
mysqldump_myDB
;
use
test
;
use
test
;
--
echo
#
--
echo
# BUG#13926: --order-by-primary fails if PKEY contains quote character
--
echo
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
`t1`
;
CREATE
TABLE
`t1`
(
`a b`
INT
,
`c"d`
INT
,
`e``f`
INT
,
PRIMARY
KEY
(
`a b`
,
`c"d`
,
`e``f`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
insert
into
t1
values
(
0815
,
4711
,
2006
);
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
compatible
=
ansi
--
order
-
by
-
primary
test
t1
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
order
-
by
-
primary
test
t1
DROP
TABLE
`t1`
;
--
enable_warnings
--
echo
#
--
echo
#
--
echo
# Bug #19745: mysqldump --xml produces invalid xml
--
echo
# Bug #19745: mysqldump --xml produces invalid xml
--
echo
#
--
echo
#
...
...
mysql-test/t/rpl_charset_sjis.test
0 → 100644
View file @
d553728b
source
include
/
have_sjis
.
inc
;
source
include
/
master
-
slave
.
inc
;
--
disable_warnings
drop
table
if
exists
t1
;
drop
procedure
if
exists
p1
;
--
enable_warnings
create
table
t1
(
a
varchar
(
255
)
character
set
sjis
);
create
procedure
p1
(
in
a
varchar
(
255
)
character
set
sjis
)
insert
into
t1
values
(
a
);
SET
NAMES
binary
;
CALL
p1
(
'\\'
);
select
"--- on master ---"
;
select
hex
(
a
)
from
t1
;
sync_slave_with_master
;
connection
slave
;
select
"--- on slave ---"
;
select
hex
(
a
)
from
t1
;
connection
master
;
drop
table
t1
;
drop
procedure
p1
;
sync_slave_with_master
;
connection
master
;
# End of 5.0 tests
sql/item_timefunc.cc
View file @
d553728b
...
@@ -609,16 +609,10 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
...
@@ -609,16 +609,10 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
uint
weekday
;
uint
weekday
;
ulong
length
;
ulong
length
;
const
char
*
ptr
,
*
end
;
const
char
*
ptr
,
*
end
;
MY_LOCALE
*
locale
;
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
char
buf
[
STRING_BUFFER_USUAL_SIZE
];
MY_LOCALE
*
locale
=
thd
->
variables
.
lc_time_names
;
String
tmp
(
buf
,
sizeof
(
buf
),
thd
->
variables
.
character_set_results
);
uint
errors
=
0
;
tmp
.
length
(
0
);
str
->
length
(
0
);
str
->
length
(
0
);
str
->
set_charset
(
&
my_charset_bin
);
locale
=
thd
->
variables
.
lc_time_names
;
if
(
l_time
->
neg
)
if
(
l_time
->
neg
)
str
->
append
(
'-'
);
str
->
append
(
'-'
);
...
@@ -634,38 +628,34 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
...
@@ -634,38 +628,34 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
case
'M'
:
case
'M'
:
if
(
!
l_time
->
month
)
if
(
!
l_time
->
month
)
return
1
;
return
1
;
tmp
.
copy
(
locale
->
month_names
->
type_names
[
l_time
->
month
-
1
],
str
->
append
(
locale
->
month_names
->
type_names
[
l_time
->
month
-
1
],
strlen
(
locale
->
month_names
->
type_names
[
l_time
->
month
-
1
]),
strlen
(
locale
->
month_names
->
type_names
[
l_time
->
month
-
1
]),
system_charset_info
,
tmp
.
charset
(),
&
errors
);
system_charset_info
);
str
->
append
(
tmp
.
ptr
(),
tmp
.
length
());
break
;
break
;
case
'b'
:
case
'b'
:
if
(
!
l_time
->
month
)
if
(
!
l_time
->
month
)
return
1
;
return
1
;
tmp
.
copy
(
locale
->
ab_month_names
->
type_names
[
l_time
->
month
-
1
],
str
->
append
(
locale
->
ab_month_names
->
type_names
[
l_time
->
month
-
1
],
strlen
(
locale
->
ab_month_names
->
type_names
[
l_time
->
month
-
1
]),
strlen
(
locale
->
ab_month_names
->
type_names
[
l_time
->
month
-
1
]),
system_charset_info
,
tmp
.
charset
(),
&
errors
);
system_charset_info
);
str
->
append
(
tmp
.
ptr
(),
tmp
.
length
());
break
;
break
;
case
'W'
:
case
'W'
:
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
return
1
;
return
1
;
weekday
=
calc_weekday
(
calc_daynr
(
l_time
->
year
,
l_time
->
month
,
weekday
=
calc_weekday
(
calc_daynr
(
l_time
->
year
,
l_time
->
month
,
l_time
->
day
),
0
);
l_time
->
day
),
0
);
tmp
.
copy
(
locale
->
day_names
->
type_names
[
weekday
],
str
->
append
(
locale
->
day_names
->
type_names
[
weekday
],
strlen
(
locale
->
day_names
->
type_names
[
weekday
]),
strlen
(
locale
->
day_names
->
type_names
[
weekday
]),
system_charset_info
,
tmp
.
charset
(),
&
errors
);
system_charset_info
);
str
->
append
(
tmp
.
ptr
(),
tmp
.
length
());
break
;
break
;
case
'a'
:
case
'a'
:
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
return
1
;
return
1
;
weekday
=
calc_weekday
(
calc_daynr
(
l_time
->
year
,
l_time
->
month
,
weekday
=
calc_weekday
(
calc_daynr
(
l_time
->
year
,
l_time
->
month
,
l_time
->
day
),
0
);
l_time
->
day
),
0
);
tmp
.
copy
(
locale
->
ab_day_names
->
type_names
[
weekday
],
str
->
append
(
locale
->
ab_day_names
->
type_names
[
weekday
],
strlen
(
locale
->
ab_day_names
->
type_names
[
weekday
]),
strlen
(
locale
->
ab_day_names
->
type_names
[
weekday
]),
system_charset_info
,
tmp
.
charset
(),
&
errors
);
system_charset_info
);
str
->
append
(
tmp
.
ptr
(),
tmp
.
length
());
break
;
break
;
case
'D'
:
case
'D'
:
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
if
(
type
==
MYSQL_TIMESTAMP_TIME
)
...
@@ -1721,6 +1711,7 @@ longlong Item_func_sec_to_time::val_int()
...
@@ -1721,6 +1711,7 @@ longlong Item_func_sec_to_time::val_int()
void
Item_func_date_format
::
fix_length_and_dec
()
void
Item_func_date_format
::
fix_length_and_dec
()
{
{
THD
*
thd
=
current_thd
;
/*
/*
Must use this_item() in case it's a local SP variable
Must use this_item() in case it's a local SP variable
(for ->max_length and ->str_value)
(for ->max_length and ->str_value)
...
@@ -1728,22 +1719,18 @@ void Item_func_date_format::fix_length_and_dec()
...
@@ -1728,22 +1719,18 @@ void Item_func_date_format::fix_length_and_dec()
Item
*
arg1
=
args
[
1
]
->
this_item
();
Item
*
arg1
=
args
[
1
]
->
this_item
();
decimals
=
0
;
decimals
=
0
;
collation
.
set
(
&
my_charset_bi
n
);
collation
.
set
(
thd
->
variables
.
collation_connectio
n
);
if
(
arg1
->
type
()
==
STRING_ITEM
)
if
(
arg1
->
type
()
==
STRING_ITEM
)
{
// Optimize the normal case
{
// Optimize the normal case
fixed_length
=
1
;
fixed_length
=
1
;
max_length
=
format_length
(
&
arg1
->
str_value
)
*
/*
collation
.
collation
->
mbmaxlen
;
The result is a binary string (no reason to use collation->mbmaxlen
This is becasue make_date_time() only returns binary strings
*/
max_length
=
format_length
(
&
arg1
->
str_value
);
}
}
else
else
{
{
fixed_length
=
0
;
fixed_length
=
0
;
/* The result is a binary string (no reason to use collation->mbmaxlen */
max_length
=
min
(
arg1
->
max_length
,
MAX_BLOB_WIDTH
)
*
10
*
max_length
=
min
(
arg1
->
max_length
,
MAX_BLOB_WIDTH
)
*
10
;
collation
.
collation
->
mbmaxlen
;
set_if_smaller
(
max_length
,
MAX_BLOB_WIDTH
);
set_if_smaller
(
max_length
,
MAX_BLOB_WIDTH
);
}
}
maybe_null
=
1
;
// If wrong date
maybe_null
=
1
;
// If wrong date
...
@@ -1888,6 +1875,7 @@ String *Item_func_date_format::val_str(String *str)
...
@@ -1888,6 +1875,7 @@ String *Item_func_date_format::val_str(String *str)
date_time_format
.
format
.
length
=
format
->
length
();
date_time_format
.
format
.
length
=
format
->
length
();
/* Create the result string */
/* Create the result string */
str
->
set_charset
(
collation
.
collation
);
if
(
!
make_date_time
(
&
date_time_format
,
&
l_time
,
if
(
!
make_date_time
(
&
date_time_format
,
&
l_time
,
is_time_format
?
MYSQL_TIMESTAMP_TIME
:
is_time_format
?
MYSQL_TIMESTAMP_TIME
:
MYSQL_TIMESTAMP_DATE
,
MYSQL_TIMESTAMP_DATE
,
...
...
sql/log_event.cc
View file @
d553728b
...
@@ -261,7 +261,7 @@ append_query_string(CHARSET_INFO *csinfo,
...
@@ -261,7 +261,7 @@ append_query_string(CHARSET_INFO *csinfo,
else
else
{
{
*
ptr
++=
'\''
;
*
ptr
++=
'\''
;
ptr
+=
escape_string_for_mysql
(
from
->
charset
()
,
ptr
,
0
,
ptr
+=
escape_string_for_mysql
(
csinfo
,
ptr
,
0
,
from
->
ptr
(),
from
->
length
());
from
->
ptr
(),
from
->
length
());
*
ptr
++=
'\''
;
*
ptr
++=
'\''
;
}
}
...
...
sql/sp_head.cc
View file @
d553728b
...
@@ -93,7 +93,7 @@ sp_map_item_type(enum enum_field_types type)
...
@@ -93,7 +93,7 @@ sp_map_item_type(enum enum_field_types type)
*/
*/
static
String
*
static
String
*
sp_get_item_value
(
Item
*
item
,
String
*
str
)
sp_get_item_value
(
THD
*
thd
,
Item
*
item
,
String
*
str
)
{
{
Item_result
result_type
=
item
->
result_type
();
Item_result
result_type
=
item
->
result_type
();
...
@@ -113,15 +113,16 @@ sp_get_item_value(Item *item, String *str)
...
@@ -113,15 +113,16 @@ sp_get_item_value(Item *item, String *str)
{
{
char
buf_holder
[
STRING_BUFFER_USUAL_SIZE
];
char
buf_holder
[
STRING_BUFFER_USUAL_SIZE
];
String
buf
(
buf_holder
,
sizeof
(
buf_holder
),
result
->
charset
());
String
buf
(
buf_holder
,
sizeof
(
buf_holder
),
result
->
charset
());
CHARSET_INFO
*
cs
=
thd
->
variables
.
character_set_client
;
/* We must reset length of the buffer, because of String specificity. */
/* We must reset length of the buffer, because of String specificity. */
buf
.
length
(
0
);
buf
.
length
(
0
);
buf
.
append
(
'_'
);
buf
.
append
(
'_'
);
buf
.
append
(
result
->
charset
()
->
csname
);
buf
.
append
(
result
->
charset
()
->
csname
);
if
(
result
->
charset
()
->
escape_with_backslash_is_dangerous
)
if
(
cs
->
escape_with_backslash_is_dangerous
)
buf
.
append
(
' '
);
buf
.
append
(
' '
);
append_query_string
(
result
->
charset
()
,
result
,
&
buf
);
append_query_string
(
cs
,
result
,
&
buf
);
str
->
copy
(
buf
);
str
->
copy
(
buf
);
return
str
;
return
str
;
...
@@ -862,7 +863,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
...
@@ -862,7 +863,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
val
=
(
*
splocal
)
->
this_item
();
val
=
(
*
splocal
)
->
this_item
();
DBUG_PRINT
(
"info"
,
(
"print %p"
,
val
));
DBUG_PRINT
(
"info"
,
(
"print %p"
,
val
));
str_value
=
sp_get_item_value
(
val
,
&
str_value_holder
);
str_value
=
sp_get_item_value
(
thd
,
val
,
&
str_value_holder
);
if
(
str_value
)
if
(
str_value
)
res
|=
qbuf
.
append
(
*
str_value
);
res
|=
qbuf
.
append
(
*
str_value
);
else
else
...
@@ -1456,7 +1457,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
...
@@ -1456,7 +1457,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
if
(
arg_no
)
if
(
arg_no
)
binlog_buf
.
append
(
','
);
binlog_buf
.
append
(
','
);
str_value
=
sp_get_item_value
(
nctx
->
get_item
(
arg_no
),
str_value
=
sp_get_item_value
(
thd
,
nctx
->
get_item
(
arg_no
),
&
str_value_holder
);
&
str_value_holder
);
if
(
str_value
)
if
(
str_value
)
...
...
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