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
63da0750
Commit
63da0750
authored
Nov 12, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 4.1 to get latest fix to client_test.c
parents
e0f1e6af
dc667223
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
296 deletions
+32
-296
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+4
-280
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+11
-3
tests/client_test.c
tests/client_test.c
+11
-13
No files found.
mysql-test/r/func_str.result
View file @
63da0750
This diff is collapsed.
Click to expand it.
mysql-test/t/func_str.test
View file @
63da0750
...
@@ -82,6 +82,12 @@ select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), un
...
@@ -82,6 +82,12 @@ select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), un
select
hex
(
unhex
(
"1"
)),
hex
(
unhex
(
"12"
)),
hex
(
unhex
(
"123"
)),
hex
(
unhex
(
"1234"
)),
hex
(
unhex
(
"12345"
)),
hex
(
unhex
(
"123456"
));
select
hex
(
unhex
(
"1"
)),
hex
(
unhex
(
"12"
)),
hex
(
unhex
(
"123"
)),
hex
(
unhex
(
"1234"
)),
hex
(
unhex
(
"12345"
)),
hex
(
unhex
(
"123456"
));
select
length
(
unhex
(
md5
(
"abrakadabra"
)));
select
length
(
unhex
(
md5
(
"abrakadabra"
)));
#
# Bug #6564: QUOTE(NULL
#
select
concat
(
'a'
,
quote
(
NULL
));
#
#
# Wrong usage of functions
# Wrong usage of functions
#
#
...
...
sql/item_strfunc.cc
View file @
63da0750
...
@@ -2574,9 +2574,12 @@ String* Item_func_inet_ntoa::val_str(String* str)
...
@@ -2574,9 +2574,12 @@ String* Item_func_inet_ntoa::val_str(String* str)
This function is very useful when you want to generate SQL statements
This function is very useful when you want to generate SQL statements
RETURN VALUES
NOTE
QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes).
RETURN VALUES
str Quoted string
str Quoted string
NULL
Argument to QUOTE() was NULL or o
ut of memory.
NULL
O
ut of memory.
*/
*/
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
...
@@ -2601,7 +2604,12 @@ String *Item_func_quote::val_str(String *str)
...
@@ -2601,7 +2604,12 @@ String *Item_func_quote::val_str(String *str)
String
*
arg
=
args
[
0
]
->
val_str
(
str
);
String
*
arg
=
args
[
0
]
->
val_str
(
str
);
uint
arg_length
,
new_length
;
uint
arg_length
,
new_length
;
if
(
!
arg
)
// Null argument
if
(
!
arg
)
// Null argument
goto
null
;
{
str
->
copy
(
"NULL"
,
4
,
collation
.
collation
);
// Return the string 'NULL'
null_value
=
0
;
return
str
;
}
arg_length
=
arg
->
length
();
arg_length
=
arg
->
length
();
new_length
=
arg_length
+
2
;
/* for beginning and ending ' signs */
new_length
=
arg_length
+
2
;
/* for beginning and ending ' signs */
...
...
tests/client_test.c
View file @
63da0750
...
@@ -12130,11 +12130,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -12130,11 +12130,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return
0
;
return
0
;
}
}
static
void
get_options
(
int
argc
,
char
**
argv
)
static
void
get_options
(
int
*
argc
,
char
*
**
argv
)
{
{
int
ho_error
;
int
ho_error
;
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
client_test_long_options
,
if
((
ho_error
=
handle_options
(
argc
,
argv
,
client_test_long_options
,
get_one_option
)))
get_one_option
)))
exit
(
ho_error
);
exit
(
ho_error
);
...
@@ -12177,7 +12177,7 @@ int main(int argc, char **argv)
...
@@ -12177,7 +12177,7 @@ int main(int argc, char **argv)
load_defaults
(
"my"
,
client_test_load_default_groups
,
&
argc
,
&
argv
);
load_defaults
(
"my"
,
client_test_load_default_groups
,
&
argc
,
&
argv
);
defaults_argv
=
argv
;
defaults_argv
=
argv
;
get_options
(
argc
,
argv
);
get_options
(
&
argc
,
&
argv
);
client_connect
();
/* connect to server */
client_connect
();
/* connect to server */
...
@@ -12187,30 +12187,28 @@ int main(int argc, char **argv)
...
@@ -12187,30 +12187,28 @@ int main(int argc, char **argv)
/* Start of tests */
/* Start of tests */
test_count
=
1
;
test_count
=
1
;
start_time
=
time
((
time_t
*
)
0
);
start_time
=
time
((
time_t
*
)
0
);
int
i
,
name_ok
;
if
(
!
argc
)
if
(
!
argv
[
1
])
{
{
for
(
fptr
=
my_tests
;
fptr
->
name
;
fptr
++
)
for
(
fptr
=
my_tests
;
fptr
->
name
;
fptr
++
)
(
*
fptr
->
function
)();
(
*
fptr
->
function
)();
}
}
else
else
{
{
for
(
i
=
1
;
argv
[
i
];
i
++
)
for
(
;
*
argv
;
argv
++
)
{
{
name_ok
=
0
;
for
(
fptr
=
my_tests
;
fptr
->
name
;
fptr
++
)
for
(
fptr
=
my_tests
;
fptr
->
name
;
fptr
++
)
{
{
if
(
!
strcmp
(
fptr
->
name
,
argv
[
i
]
))
if
(
!
strcmp
(
fptr
->
name
,
*
argv
))
{
{
name_ok
=
1
;
(
*
fptr
->
function
)();
(
*
fptr
->
function
)();
break
;
}
}
}
}
if
(
!
name_ok
)
if
(
!
fptr
->
name
)
{
{
printf
(
"
\n\n
Given test not found: '%s'
\n
"
,
argv
[
i
]
);
fprintf
(
stderr
,
"
\n\n
Given test not found: '%s'
\n
"
,
*
argv
);
printf
(
"See legal test names with %s -T
\n\n
Aborting!
\n
"
,
fprintf
(
stderr
,
"See legal test names with %s -T
\n\n
Aborting!
\n
"
,
my_progname
);
my_progname
);
client_disconnect
();
client_disconnect
();
free_defaults
(
defaults_argv
);
free_defaults
(
defaults_argv
);
exit
(
1
);
exit
(
1
);
...
...
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