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
570e20bc
Commit
570e20bc
authored
Oct 21, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge polly.(none):/home/kaa/src/opt/bug28550/my50-bug28550
into polly.(none):/home/kaa/src/opt/mysql-5.0-opt
parents
b6b71948
0ca57427
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
2 deletions
+38
-2
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+11
-1
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+12
-0
sql/item.cc
sql/item.cc
+13
-0
sql/item.h
sql/item.h
+1
-0
sql/item_strfunc.h
sql/item_strfunc.h
+1
-1
No files found.
mysql-test/r/func_str.result
View file @
570e20bc
...
...
@@ -726,7 +726,7 @@ t1 CREATE TABLE `t1` (
`oct(130)` varchar(64) NOT NULL default '',
`conv(130,16,10)` varchar(64) NOT NULL default '',
`hex(130)` varchar(6) NOT NULL default '',
`char(130)` varbinary(
1
) NOT NULL default '',
`char(130)` varbinary(
4
) NOT NULL default '',
`format(130,10)` varchar(4) NOT NULL default '',
`left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
`right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
...
...
@@ -2153,4 +2153,14 @@ SUBSTR(a,1,len)
ba
DROP TABLE t1;
CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
SELECT HEX(c1) from t1;
HEX(c1)
414243
DROP TABLE t1;
CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
SELECT HEX(c1) from v1;
HEX(c1)
414243
DROP VIEW v1;
End of 5.0 tests
mysql-test/t/func_str.test
View file @
570e20bc
...
...
@@ -1124,4 +1124,16 @@ SELECT SUBSTR(a,1,len) FROM t1;
DROP
TABLE
t1
;
#
# Bug #28850: Potential bugs related to the return type of the CHAR function
#
CREATE
TABLE
t1
AS
SELECT
CHAR
(
0x414243
)
as
c1
;
SELECT
HEX
(
c1
)
from
t1
;
DROP
TABLE
t1
;
CREATE
VIEW
v1
AS
SELECT
CHAR
(
0x414243
)
as
c1
;
SELECT
HEX
(
c1
)
from
v1
;
DROP
VIEW
v1
;
--
echo
End
of
5.0
tests
sql/item.cc
View file @
570e20bc
...
...
@@ -4807,6 +4807,19 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions)
}
void
Item_hex_string
::
print
(
String
*
str
)
{
char
*
end
=
(
char
*
)
str_value
.
ptr
()
+
str_value
.
length
(),
*
ptr
=
end
-
min
(
str_value
.
length
(),
sizeof
(
longlong
));
str
->
append
(
"0x"
);
for
(;
ptr
!=
end
;
ptr
++
)
{
str
->
append
(
_dig_vec_lower
[((
uchar
)
*
ptr
)
>>
4
]);
str
->
append
(
_dig_vec_lower
[((
uchar
)
*
ptr
)
&
0x0F
]);
}
}
bool
Item_hex_string
::
eq
(
const
Item
*
arg
,
bool
binary_cmp
)
const
{
if
(
arg
->
basic_const_item
()
&&
arg
->
type
()
==
type
())
...
...
sql/item.h
View file @
570e20bc
...
...
@@ -1858,6 +1858,7 @@ class Item_hex_string: public Item
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_VARCHAR
;
}
// to prevent drop fixed flag (no need parent cleanup call)
void
cleanup
()
{}
void
print
(
String
*
str
);
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
virtual
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
};
...
...
sql/item_strfunc.h
View file @
570e20bc
...
...
@@ -534,7 +534,7 @@ class Item_func_char :public Item_str_func
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
max_length
=
arg_count
*
collation
.
collation
->
mbmaxlen
;
max_length
=
arg_count
*
4
;
}
const
char
*
func_name
()
const
{
return
"char"
;
}
};
...
...
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