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
8b046e60
Commit
8b046e60
authored
Jan 20, 2010
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
upmerge 43005,48888,49837,49878,50471
parents
a7dc95fb
acc2b1ba
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
12 deletions
+111
-12
client/mysqltest.cc
client/mysqltest.cc
+33
-4
mysql-test/lib/My/SafeProcess/safe_process_win.cc
mysql-test/lib/My/SafeProcess/safe_process_win.cc
+14
-8
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+13
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+51
-0
No files found.
client/mysqltest.cc
View file @
8b046e60
...
...
@@ -134,6 +134,7 @@ struct st_block
int
line
;
/* Start line of block */
my_bool
ok
;
/* Should block be executed */
enum
block_cmd
cmd
;
/* Command owning the block */
char
delim
[
MAX_DELIMITER_LENGTH
];
/* Delimiter before block */
};
static
struct
st_block
block_stack
[
32
];
...
...
@@ -2650,6 +2651,10 @@ void do_exec(struct st_command *command)
#endif
#endif
/* exec command is interpreted externally and will not take newlines */
while
(
replace
(
&
ds_cmd
,
"
\n
"
,
1
,
" "
,
1
)
==
0
)
;
DBUG_PRINT
(
"info"
,
(
"Executing '%s' as '%s'"
,
command
->
first_argument
,
ds_cmd
.
str
));
...
...
@@ -5109,6 +5114,12 @@ int do_done(struct st_command *command)
}
else
{
if
(
*
cur_block
->
delim
)
{
/* Restore "old" delimiter after false if block */
strcpy
(
delimiter
,
cur_block
->
delim
);
delimiter_length
=
strlen
(
delimiter
);
}
/* Pop block from stack, goto next line */
cur_block
--
;
parser
.
current_line
++
;
...
...
@@ -5167,6 +5178,7 @@ void do_block(enum block_cmd cmd, struct st_command* command)
cur_block
++
;
cur_block
->
cmd
=
cmd
;
cur_block
->
ok
=
FALSE
;
cur_block
->
delim
[
0
]
=
'\0'
;
DBUG_VOID_RETURN
;
}
...
...
@@ -5203,6 +5215,15 @@ void do_block(enum block_cmd cmd, struct st_command* command)
if
(
not_expr
)
cur_block
->
ok
=
!
cur_block
->
ok
;
if
(
cur_block
->
ok
)
{
cur_block
->
delim
[
0
]
=
'\0'
;
}
else
{
/* Remember "old" delimiter if entering a false if block */
strcpy
(
cur_block
->
delim
,
delimiter
);
}
DBUG_PRINT
(
"info"
,
(
"OK: %d"
,
cur_block
->
ok
));
var_free
(
&
v
);
...
...
@@ -7629,7 +7650,14 @@ int main(int argc, char **argv)
1024
,
0
,
0
,
get_var_key
,
var_free
,
MYF
(
0
)))
die
(
"Variable hash initialization failed"
);
var_set_string
(
"$MYSQL_SERVER_VERSION"
,
MYSQL_SERVER_VERSION
);
var_set_string
(
"MYSQL_SERVER_VERSION"
,
MYSQL_SERVER_VERSION
);
var_set_string
(
"MYSQL_SYSTEM_TYPE"
,
SYSTEM_TYPE
);
var_set_string
(
"MYSQL_MACHINE_TYPE"
,
MACHINE_TYPE
);
if
(
sizeof
(
void
*
)
==
8
)
{
var_set_string
(
"MYSQL_SYSTEM_ARCHITECTURE"
,
"64"
);
}
else
{
var_set_string
(
"MYSQL_SYSTEM_ARCHITECTURE"
,
"32"
);
}
memset
(
&
master_pos
,
0
,
sizeof
(
master_pos
));
...
...
@@ -7759,7 +7787,8 @@ int main(int argc, char **argv)
command
->
type
=
Q_COMMENT
;
}
my_bool
ok_to_do
=
cur_block
->
ok
;
/* delimiter needs to be executed so we can continue to parse */
my_bool
ok_to_do
=
cur_block
->
ok
||
command
->
type
==
Q_DELIMITER
;
/*
Some commands need to be "done" the first time if they may get
re-iterated over in a true context. This can only happen if there's
...
...
@@ -9417,7 +9446,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
if
(
pa
->
length
+
length
>=
pa
->
max_length
)
{
if
(
!
(
new_pos
=
(
uchar
*
)
my_realloc
((
uchar
*
)
pa
->
str
,
(
uint
)
(
pa
->
max_
length
+
PS_MALLOC
),
(
uint
)
(
pa
->
length
+
length
+
PS_MALLOC
),
MYF
(
MY_WME
))))
DBUG_RETURN
(
1
);
if
(
new_pos
!=
pa
->
str
)
...
...
@@ -9428,7 +9457,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
char
*
);
pa
->
str
=
new_pos
;
}
pa
->
max_length
+=
PS_MALLOC
;
pa
->
max_length
=
pa
->
length
+
length
+
PS_MALLOC
;
}
if
(
pa
->
typelib
.
count
>=
pa
->
max_count
-
1
)
{
...
...
mysql-test/lib/My/SafeProcess/safe_process_win.cc
View file @
8b046e60
...
...
@@ -186,13 +186,19 @@ int main(int argc, const char** argv )
die
(
"No real args -> nothing to do"
);
/* Copy the remaining args to child_arg */
for
(
int
j
=
i
+
1
;
j
<
argc
;
j
++
)
{
if
(
strchr
(
argv
[
j
],
' '
))
{
/* Protect with "" if this arg contains a space */
arg
=
argv
[
j
];
if
(
strchr
(
arg
,
' '
)
&&
arg
[
0
]
!=
'\"'
&&
arg
[
strlen
(
arg
)]
!=
'\"'
)
{
/* Quote arg that contains spaces and are not quoted already */
to
+=
_snprintf
(
to
,
child_args
+
sizeof
(
child_args
)
-
to
,
"
\"
%s
\"
"
,
argv
[
j
]);
}
else
{
"
\"
%s
\"
"
,
arg
);
}
else
{
to
+=
_snprintf
(
to
,
child_args
+
sizeof
(
child_args
)
-
to
,
"%s "
,
argv
[
j
]
);
"%s "
,
arg
);
}
}
break
;
...
...
mysql-test/r/mysqltest.result
View file @
8b046e60
...
...
@@ -216,6 +216,12 @@ source database
echo message echo message
mysqltest: At line 1: Missing argument in exec
1
1
2
2
X
3
MySQL
"MySQL"
MySQL: The
...
...
@@ -377,6 +383,10 @@ test
test2
test3
test4
outer
true-inner
true-inner again
true-outer
Counter is greater than 0, (counter=10)
Counter is not 0, (counter=0)
1
...
...
@@ -417,6 +427,9 @@ mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_co
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
select "LONG_STRING" as x;
x
LONG_STRING
mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: Invalid integer argument "a"
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
...
...
mysql-test/t/mysqltest.test
View file @
8b046e60
...
...
@@ -605,6 +605,15 @@ echo ;
--
error
1
--
exec
echo
"--exec "
|
$MYSQL_TEST
2
>&
1
# Multi-line exec
exec
$MYSQL
test
-
e
"select 1"
;
exec
$MYSQL
test
-
e
"select
2"
;
let
$query
=
select
3
as
X
;
exec
$MYSQL
test
-
e
"
$query
"
;
# ----------------------------------------------------------------------------
# Test let command
# ----------------------------------------------------------------------------
...
...
@@ -1006,6 +1015,37 @@ echo test3stop
--
delimiter
;
echo
test4
;
# ----------------------------------------------------------------------------
# Test that delimiter within if() works in in various combinations
# ----------------------------------------------------------------------------
if
(
0
)
{
delimiter
||
;
echo
false
-
inner
||
if
(
0
)
{
delimiter
*||
echo
false
-
innerer
*
delimiter
||*
}
echo
false
-
inner
again
||
}
echo
outer
;
if
(
1
)
{
delimiter
/
;
echo
true
-
inner
/
if
(
0
)
{
delimiter
%/
echo
true
-
innerer
%
}
echo
true
-
inner
again
/
}
echo
true
-
outer
/
delimiter
;
/
# ----------------------------------------------------------------------------
# Test if
...
...
@@ -1285,6 +1325,17 @@ select "a" as col1, "c" as col2;
--
error
1
--
exec
echo
"--replace_column 1 b c "
|
$MYSQL_TEST
2
>&
1
let
$long_rep
=
1234567890123456789012345678901234567890
;
let
$long_rep
=
$long_rep
,
$long_rep
;
let
$long_rep
=
$long_rep
,
$long_rep
;
let
$long_rep
=
$long_rep
,
$long_rep
;
let
$long_rep
=
$long_rep
,
$long_rep
;
let
$long_rep
=
$long_rep
,
$long_rep
;
# This tests from strings > 1024 (here 1311)
--
replace_result
$long_rep
LONG_STRING
eval
select
"
$long_rep
"
as
x
;
# ----------------------------------------------------------------------------
# Test sync_with_master
...
...
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