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
162f0803
Commit
162f0803
authored
Feb 28, 2007
by
msvensson@pilot.blaudden
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint-bug20166
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
parents
3fc963f1
f63240f9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
26 deletions
+78
-26
client/mysqltest.c
client/mysqltest.c
+7
-1
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+22
-17
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+10
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+14
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+22
-0
sql/event_queue.cc
sql/event_queue.cc
+0
-7
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-1
No files found.
client/mysqltest.c
View file @
162f0803
...
@@ -60,6 +60,11 @@
...
@@ -60,6 +60,11 @@
# endif
# endif
#endif
#endif
/* Use cygwin for --exec and --system before 5.0 */
#if MYSQL_VERSION_ID < 50000
#define USE_CYGWIN
#endif
#define MAX_VAR_NAME_LENGTH 256
#define MAX_VAR_NAME_LENGTH 256
#define MAX_COLUMNS 256
#define MAX_COLUMNS 256
#define MAX_EMBEDDED_SERVER_ARGS 64
#define MAX_EMBEDDED_SERVER_ARGS 64
...
@@ -5355,8 +5360,9 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
...
@@ -5355,8 +5360,9 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
/*
/*
If we got here the statement succeeded and was expected to do so,
If we got here the statement succeeded and was expected to do so,
get data. Note that this can still give errors found during execution!
get data. Note that this can still give errors found during execution!
Store the result of the query if if will return any fields
*/
*/
if
(
mysql_stmt_store_result
(
stmt
))
if
(
mysql_stmt_
field_count
(
stmt
)
&&
mysql_stmt_
store_result
(
stmt
))
{
{
handle_error
(
command
,
mysql_stmt_errno
(
stmt
),
handle_error
(
command
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
),
mysql_stmt_sqlstate
(
stmt
),
ds
);
mysql_stmt_error
(
stmt
),
mysql_stmt_sqlstate
(
stmt
),
ds
);
...
...
mysql-test/lib/mtr_process.pl
View file @
162f0803
...
@@ -22,7 +22,7 @@ use Socket;
...
@@ -22,7 +22,7 @@ use Socket;
use
Errno
;
use
Errno
;
use
strict
;
use
strict
;
use
POSIX
'
WNOHANG
'
;
use
POSIX
qw(WNOHANG SIGHUP)
;
sub
mtr_run
($$$$$$
;
$
);
sub
mtr_run
($$$$$$
;
$
);
sub
mtr_spawn
($$$$$$
;
$
);
sub
mtr_spawn
($$$$$$
;
$
);
...
@@ -139,19 +139,18 @@ sub spawn_impl ($$$$$$$$) {
...
@@ -139,19 +139,18 @@ sub spawn_impl ($$$$$$$$) {
{
{
if
(
$!
==
$!
{
EAGAIN
}
)
# See "perldoc Errno"
if
(
$!
==
$!
{
EAGAIN
}
)
# See "perldoc Errno"
{
{
mtr_
debu
g
("
Got EAGAIN from fork(), sleep 1 second and redo
");
mtr_
warnin
g
("
Got EAGAIN from fork(), sleep 1 second and redo
");
sleep
(
1
);
sleep
(
1
);
redo
FORK
;
redo
FORK
;
}
}
else
{
mtr_error
("
$path
(
$pid
) can't be forked, error: $!
");
mtr_error
("
$path
(
$pid
) can't be forked
");
}
}
}
if
(
$pid
)
if
(
$pid
)
{
{
spawn_parent_impl
(
$pid
,
$mode
,
$path
);
return
spawn_parent_impl
(
$pid
,
$mode
,
$path
);
}
}
else
else
{
{
...
@@ -216,8 +215,11 @@ sub spawn_impl ($$$$$$$$) {
...
@@ -216,8 +215,11 @@ sub spawn_impl ($$$$$$$$) {
{
{
mtr_child_error
("
failed to execute
\"
$path
\"
: $!
");
mtr_child_error
("
failed to execute
\"
$path
\"
: $!
");
}
}
mtr_error
("
Should never come here 1!
");
}
}
mtr_error
("
Should never come here 2!
");
}
}
mtr_error
("
Should never come here 3!
");
}
}
...
@@ -230,12 +232,21 @@ sub spawn_parent_impl {
...
@@ -230,12 +232,21 @@ sub spawn_parent_impl {
{
{
if
(
$mode
eq
'
run
'
)
if
(
$mode
eq
'
run
'
)
{
{
# Simple run of command, w
e wait
for it to return
# Simple run of command, w
ait blocking
for it to return
my
$ret_pid
=
waitpid
(
$pid
,
0
);
my
$ret_pid
=
waitpid
(
$pid
,
0
);
if
(
$ret_pid
!=
$pid
)
if
(
$ret_pid
!=
$pid
)
{
{
mtr_error
("
waitpid(
$pid
, 0) returned
$ret_pid
"
.
# The "simple" waitpid has failed, print debug info
"
when waiting for '
$path
'
");
# and try to handle the error
mtr_warning
("
waitpid(
$pid
, 0) returned
$ret_pid
"
.
"
when waiting for '
$path
', error: '$!'
");
if
(
$ret_pid
==
-
1
)
{
# waitpid returned -1, that would indicate the process
# no longer exist and waitpid couldn't wait for it.
return
1
;
}
mtr_error
("
Error handling failed
");
}
}
return
mtr_process_exit_status
(
$?
);
return
mtr_process_exit_status
(
$?
);
...
@@ -1109,12 +1120,6 @@ sub mtr_kill_processes ($) {
...
@@ -1109,12 +1120,6 @@ sub mtr_kill_processes ($) {
#
#
##############################################################################
##############################################################################
# FIXME something is wrong, we sometimes terminate with "Hangup" written
# to tty, and no STDERR output telling us why.
# FIXME for some reason, setting HUP to 'IGNORE' will cause exit() to
# write out "Hangup", and maybe loose some output. We insert a sleep...
sub
mtr_exit
($)
{
sub
mtr_exit
($)
{
my
$code
=
shift
;
my
$code
=
shift
;
mtr_timer_stop_all
(
$::glob_timers
);
mtr_timer_stop_all
(
$::glob_timers
);
...
@@ -1126,7 +1131,7 @@ sub mtr_exit ($) {
...
@@ -1126,7 +1131,7 @@ sub mtr_exit ($) {
# set ourselves as the group leader at startup (with
# set ourselves as the group leader at startup (with
# POSIX::setpgrp(0,0)), but then care must be needed to always do
# POSIX::setpgrp(0,0)), but then care must be needed to always do
# proper child process cleanup.
# proper child process cleanup.
kill
('
HUP
'
,
-
$$
)
if
!
$::glob_win32_perl
and
$$
==
getpgrp
();
POSIX::
kill
(
SIGHUP
,
-
$$
)
if
!
$::glob_win32_perl
and
$$
==
getpgrp
();
exit
(
$code
);
exit
(
$code
);
}
}
...
...
mysql-test/mysql-test-run.pl
View file @
162f0803
...
@@ -2136,6 +2136,16 @@ sub remove_stale_vardir () {
...
@@ -2136,6 +2136,16 @@ sub remove_stale_vardir () {
mtr_verbose
("
Removing
$opt_vardir
/
");
mtr_verbose
("
Removing
$opt_vardir
/
");
rmtree
("
$opt_vardir
/
");
rmtree
("
$opt_vardir
/
");
}
}
if
(
$opt_mem
)
{
# A symlink from var/ to $opt_mem will be set up
# remove the $opt_mem dir to assure the symlink
# won't point at an old directory
mtr_verbose
("
Removing
$opt_mem
");
rmtree
(
$opt_mem
);
}
}
}
else
else
{
{
...
...
mysql-test/r/func_str.result
View file @
162f0803
...
@@ -2273,4 +2273,18 @@ abcxx
...
@@ -2273,4 +2273,18 @@ abcxx
select lpad('abc', cast(5 as unsigned integer), 'x');
select lpad('abc', cast(5 as unsigned integer), 'x');
lpad('abc', cast(5 as unsigned integer), 'x')
lpad('abc', cast(5 as unsigned integer), 'x')
xxabc
xxabc
DROP TABLE IF EXISTS t1;
CREATE TABLE `t1` (
`id` varchar(20) NOT NULL,
`tire` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2);
SELECT REPEAT( '#', tire ) AS A,
REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`;
A B tire
0
# # 1
## ## 2
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/t/func_str.test
View file @
162f0803
...
@@ -1115,4 +1115,26 @@ select repeat('a', cast(2 as unsigned int));
...
@@ -1115,4 +1115,26 @@ select repeat('a', cast(2 as unsigned int));
select
rpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
select
rpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
select
lpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
select
lpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
#
# Bug #25197 :repeat function returns null when using table field directly as count
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
`t1`
(
`id`
varchar
(
20
)
NOT
NULL
,
`tire`
tinyint
(
3
)
unsigned
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
);
INSERT
INTO
`t1`
(
`id`
,
`tire`
)
VALUES
(
'A'
,
0
),
(
'B'
,
1
),(
'C'
,
2
);
SELECT
REPEAT
(
'#'
,
tire
)
AS
A
,
REPEAT
(
'#'
,
tire
%
999
)
AS
B
,
tire
FROM
`t1`
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/event_queue.cc
View file @
162f0803
...
@@ -153,13 +153,6 @@ Event_queue::init_queue(THD *thd, Event_db_repository *db_repo)
...
@@ -153,13 +153,6 @@ Event_queue::init_queue(THD *thd, Event_db_repository *db_repo)
goto
err
;
goto
err
;
}
}
if
(
sizeof
(
my_time_t
)
!=
sizeof
(
time_t
))
{
sql_print_error
(
"SCHEDULER: sizeof(my_time_t) != sizeof(time_t) ."
"The scheduler may not work correctly. Stopping"
);
goto
err
;
}
res
=
load_events_from_db
(
thd
);
res
=
load_events_from_db
(
thd
);
UNLOCK_QUEUE_DATA
();
UNLOCK_QUEUE_DATA
();
if
(
res
)
if
(
res
)
...
...
sql/item_strfunc.cc
View file @
162f0803
...
@@ -2274,8 +2274,10 @@ String *Item_func_repeat::val_str(String *str)
...
@@ -2274,8 +2274,10 @@ String *Item_func_repeat::val_str(String *str)
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
)
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
)
goto
err
;
// string and/or delim are null
goto
err
;
// string and/or delim are null
null_value
=
0
;
null_value
=
0
;
if
((
count
<=
0
)
&&
!
args
[
1
]
->
unsigned_flag
)
// For nicer SQL code
if
(
count
==
0
||
count
<
0
&&
!
args
[
1
]
->
unsigned_flag
)
return
&
my_empty_string
;
return
&
my_empty_string
;
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Bounds check on count: If this is triggered, we will error. */
/* Bounds check on count: If this is triggered, we will error. */
if
((
ulonglong
)
count
>
INT_MAX32
)
if
((
ulonglong
)
count
>
INT_MAX32
)
...
...
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