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
64530251
Commit
64530251
authored
Dec 04, 2007
by
tsmith@ramayana.hindu.god
Browse files
Options
Browse Files
Download
Plain Diff
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1
into ramayana.hindu.god:/home/tsmith/m/bk/maint/41
parents
ca95af01
173c2bb0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
23 deletions
+83
-23
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+8
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+5
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+12
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+9
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+26
-23
sql/set_var.cc
sql/set_var.cc
+22
-0
sql/set_var.h
sql/set_var.h
+1
-0
No files found.
mysql-test/r/ctype_ucs.result
View file @
64530251
...
...
@@ -803,6 +803,14 @@ quote(name)
????????
????????????????
drop table bug20536;
set names ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
set names ucs2 collate ucs2_bin;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
set character_set_client= ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
set character_set_client= concat('ucs', substr('2', 1));
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES('abcd');
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
...
...
mysql-test/r/ps.result
View file @
64530251
...
...
@@ -1109,4 +1109,9 @@ a
13
DEALLOCATE PREPARE st1;
DROP TABLE t1;
create table t1 (a int, b tinyint);
prepare st1 from 'update t1 set b= (str_to_date(a, a))';
execute st1;
deallocate prepare st1;
drop table t1;
End of 4.1 tests.
mysql-test/t/ctype_ucs.test
View file @
64530251
...
...
@@ -535,6 +535,18 @@ select quote(name) from bug20536;
drop
table
bug20536
;
#
# Bug #31615: crash after set names ucs2 collate xxx
#
--
error
1231
set
names
ucs2
;
--
error
1231
set
names
ucs2
collate
ucs2_bin
;
--
error
1231
set
character_set_client
=
ucs2
;
--
error
1231
set
character_set_client
=
concat
(
'ucs'
,
substr
(
'2'
,
1
));
#
# BUG#31159 - fulltext search on ucs2 column crashes server
#
...
...
mysql-test/t/ps.test
View file @
64530251
...
...
@@ -1146,4 +1146,13 @@ EXECUTE st1;
DEALLOCATE
PREPARE
st1
;
DROP
TABLE
t1
;
#
# Bug #32137: prepared statement crash with str_to_date in update clause
#
create
table
t1
(
a
int
,
b
tinyint
);
prepare
st1
from
'update t1 set b= (str_to_date(a, a))'
;
execute
st1
;
deallocate
prepare
st1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
.
sql/item_timefunc.cc
View file @
64530251
...
...
@@ -2958,39 +2958,42 @@ Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg)
void
Item_func_str_to_date
::
fix_length_and_dec
()
{
char
format_buff
[
64
];
String
format_str
(
format_buff
,
sizeof
(
format_buff
),
&
my_charset_bin
);
String
*
format
;
maybe_null
=
1
;
decimals
=
0
;
cached_field_type
=
MYSQL_TYPE_STRING
;
max_length
=
MAX_DATETIME_FULL_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
cached_timestamp_type
=
MYSQL_TIMESTAMP_NONE
;
format
=
args
[
1
]
->
val_str
(
&
format_str
);
if
(
!
args
[
1
]
->
null_value
&&
(
const_item
=
args
[
1
]
->
const_item
()))
if
((
const_item
=
args
[
1
]
->
const_item
()))
{
cached_format_type
=
get_date_time_result_type
(
format
->
ptr
(),
format
->
length
());
switch
(
cached_format_type
)
{
case
DATE_ONLY
:
cached_timestamp_type
=
MYSQL_TIMESTAMP_DATE
;
cached_field_type
=
MYSQL_TYPE_DATE
;
max_length
=
MAX_DATE_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
break
;
case
TIME_ONLY
:
case
TIME_MICROSECOND
:
cached_timestamp_type
=
MYSQL_TIMESTAMP_TIME
;
cached_field_type
=
MYSQL_TYPE_TIME
;
max_length
=
MAX_TIME_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
break
;
default:
cached_timestamp_type
=
MYSQL_TIMESTAMP_DATETIME
;
cached_field_type
=
MYSQL_TYPE_DATETIME
;
break
;
char
format_buff
[
64
];
String
format_str
(
format_buff
,
sizeof
(
format_buff
),
&
my_charset_bin
);
String
*
format
=
args
[
1
]
->
val_str
(
&
format_str
);
if
(
!
args
[
1
]
->
null_value
)
{
cached_format_type
=
get_date_time_result_type
(
format
->
ptr
(),
format
->
length
());
switch
(
cached_format_type
)
{
case
DATE_ONLY
:
cached_timestamp_type
=
MYSQL_TIMESTAMP_DATE
;
cached_field_type
=
MYSQL_TYPE_DATE
;
max_length
=
MAX_DATE_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
break
;
case
TIME_ONLY
:
case
TIME_MICROSECOND
:
cached_timestamp_type
=
MYSQL_TIMESTAMP_TIME
;
cached_field_type
=
MYSQL_TYPE_TIME
;
max_length
=
MAX_TIME_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
break
;
default:
cached_timestamp_type
=
MYSQL_TIMESTAMP_DATETIME
;
cached_field_type
=
MYSQL_TYPE_DATETIME
;
break
;
}
}
}
}
bool
Item_func_str_to_date
::
get_date
(
TIME
*
ltime
,
uint
fuzzy_date
)
{
DATE_TIME_FORMAT
date_time_format
;
...
...
sql/set_var.cc
View file @
64530251
...
...
@@ -1992,6 +1992,21 @@ void sys_var_character_set_client::set_default(THD *thd, enum_var_type type)
}
bool
sys_var_character_set_client
::
check
(
THD
*
thd
,
set_var
*
var
)
{
if
(
sys_var_character_set
::
check
(
thd
,
var
))
return
1
;
/* Currently, UCS-2 cannot be used as a client character set */
if
(
var
->
save_result
.
charset
->
mbminlen
>
1
)
{
my_error
(
ER_WRONG_VALUE_FOR_VAR
,
MYF
(
0
),
name
,
var
->
save_result
.
charset
->
csname
);
return
1
;
}
return
0
;
}
CHARSET_INFO
**
sys_var_character_set_results
::
ci_ptr
(
THD
*
thd
,
enum_var_type
type
)
{
...
...
@@ -2355,6 +2370,13 @@ bool sys_var_key_cache_long::update(THD *thd, set_var *var)
int
set_var_collation_client
::
check
(
THD
*
thd
)
{
/* Currently, UCS-2 cannot be used as a client character set */
if
(
character_set_client
->
mbminlen
>
1
)
{
my_error
(
ER_WRONG_VALUE_FOR_VAR
,
MYF
(
0
),
"character_set_client"
,
character_set_client
->
csname
);
return
1
;
}
return
0
;
}
...
...
sql/set_var.h
View file @
64530251
...
...
@@ -578,6 +578,7 @@ class sys_var_character_set_client :public sys_var_character_set
sys_var_character_set
(
name_arg
)
{}
void
set_default
(
THD
*
thd
,
enum_var_type
type
);
CHARSET_INFO
**
ci_ptr
(
THD
*
thd
,
enum_var_type
type
);
bool
check
(
THD
*
thd
,
set_var
*
var
);
};
class
sys_var_character_set_results
:
public
sys_var_character_set
...
...
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