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
41d1c094
Commit
41d1c094
authored
Jun 17, 2005
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix of 5.0 tree
parent
4f966145
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
735 deletions
+55
-735
client/mysqltest.c
client/mysqltest.c
+54
-29
mysql-test/include/rpl_stmt_seq.inc
mysql-test/include/rpl_stmt_seq.inc
+1
-1
mysql-test/r/rpl_ddl.result
mysql-test/r/rpl_ddl.result
+0
-705
No files found.
client/mysqltest.c
View file @
41d1c094
...
@@ -164,10 +164,17 @@ static char TMPDIR[FN_REFLEN];
...
@@ -164,10 +164,17 @@ static char TMPDIR[FN_REFLEN];
static
char
delimiter
[
MAX_DELIMITER
]
=
DEFAULT_DELIMITER
;
static
char
delimiter
[
MAX_DELIMITER
]
=
DEFAULT_DELIMITER
;
static
uint
delimiter_length
=
1
;
static
uint
delimiter_length
=
1
;
static
int
*
cur_block
,
*
block_stack_end
;
/* Block stack */
static
int
block_stack
[
BLOCK_STACK_DEPTH
];
enum
block_cmd
{
cmd_none
,
cmd_if
,
cmd_while
};
typedef
struct
{
int
line
;
/* Start line of block */
my_bool
ok
;
/* Should block be executed */
enum
block_cmd
cmd
;
/* Command owning the block */
}
BLOCK
;
static
BLOCK
block_stack
[
BLOCK_STACK_DEPTH
];
static
BLOCK
*
cur_block
,
*
block_stack_end
;
static
int
block_ok_stack
[
BLOCK_STACK_DEPTH
];
static
CHARSET_INFO
*
charset_info
=
&
my_charset_latin1
;
/* Default charset */
static
CHARSET_INFO
*
charset_info
=
&
my_charset_latin1
;
/* Default charset */
static
const
char
*
charset_name
=
"latin1"
;
/* Default character set name */
static
const
char
*
charset_name
=
"latin1"
;
/* Default character set name */
...
@@ -221,8 +228,6 @@ MYSQL_RES *last_result=0;
...
@@ -221,8 +228,6 @@ MYSQL_RES *last_result=0;
PARSER
parser
;
PARSER
parser
;
MASTER_POS
master_pos
;
MASTER_POS
master_pos
;
int
*
block_ok
;
/* set to 0 if the current block should not be executed */
int
false_block_depth
=
0
;
/* if set, all results are concated and compared against this file */
/* if set, all results are concated and compared against this file */
const
char
*
result_file
=
0
;
const
char
*
result_file
=
0
;
...
@@ -296,6 +301,7 @@ Q_START_TIMER, Q_END_TIMER,
...
@@ -296,6 +301,7 @@ Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET
,
Q_DISABLE_PS_PROTOCOL
,
Q_ENABLE_PS_PROTOCOL
,
Q_CHARACTER_SET
,
Q_DISABLE_PS_PROTOCOL
,
Q_ENABLE_PS_PROTOCOL
,
Q_EXIT
,
Q_EXIT
,
Q_DISABLE_RECONNECT
,
Q_ENABLE_RECONNECT
,
Q_DISABLE_RECONNECT
,
Q_ENABLE_RECONNECT
,
Q_IF
,
Q_UNKNOWN
,
/* Unknown command. */
Q_UNKNOWN
,
/* Unknown command. */
Q_COMMENT
,
/* Comments, ignored. */
Q_COMMENT
,
/* Comments, ignored. */
...
@@ -386,6 +392,7 @@ const char *command_names[]=
...
@@ -386,6 +392,7 @@ const char *command_names[]=
"exit"
,
"exit"
,
"disable_reconnect"
,
"disable_reconnect"
,
"enable_reconnect"
,
"enable_reconnect"
,
"if"
,
0
0
};
};
...
@@ -1924,36 +1931,54 @@ int do_connect(struct st_query* q)
...
@@ -1924,36 +1931,54 @@ int do_connect(struct st_query* q)
int
do_done
(
struct
st_query
*
q
)
int
do_done
(
struct
st_query
*
q
)
{
{
/* Dummy statement to eliminate compiler warning */
q
->
type
=
Q_END_BLOCK
;
q
->
type
=
Q_END_BLOCK
;
/* Check if empty block stack */
if
(
cur_block
==
block_stack
)
if
(
cur_block
==
block_stack
)
die
(
"Stray '}' - end of block before beginning"
);
die
(
"Stray '}' - end of block before beginning"
);
if
(
*
block_ok
--
)
/* Test if inner block has been executed */
if
(
cur_block
->
ok
&&
cur_block
->
cmd
==
cmd_while
)
{
{
parser
.
current_line
=
*--
cur_block
;
/* Pop block from stack, re-execute outer block */
cur_block
--
;
parser
.
current_line
=
cur_block
->
line
;
}
}
else
else
{
{
++
parser
.
current_line
;
/* Pop block from stack, goto next line */
--
cur_block
;
cur_block
--
;
parser
.
current_line
++
;
}
}
return
0
;
return
0
;
}
}
int
do_while
(
struct
st_query
*
q
)
int
do_block
(
enum
block_cmd
cmd
,
struct
st_query
*
q
)
{
{
char
*
p
=
q
->
first_argument
;
char
*
p
=
q
->
first_argument
;
const
char
*
expr_start
,
*
expr_end
;
const
char
*
expr_start
,
*
expr_end
;
VAR
v
;
VAR
v
;
/* Check stack overflow */
if
(
cur_block
==
block_stack_end
)
if
(
cur_block
==
block_stack_end
)
die
(
"Nesting too deeply"
);
die
(
"Nesting too deeply"
);
if
(
!*
block_ok
)
/* Set way to find outer block again, increase line counter */
cur_block
->
line
=
parser
.
current_line
++
;
/* If this block is ignored */
if
(
!
cur_block
->
ok
)
{
{
++
false_block_depth
;
/* Inner block should be ignored too */
*++
block_ok
=
0
;
cur_block
++
;
*
cur_block
++
=
parser
.
current_line
++
;
cur_block
->
cmd
=
cmd
;
cur_block
->
ok
=
FALSE
;
return
0
;
return
0
;
}
}
/* Parse and evaluate test expression */
expr_start
=
strchr
(
p
,
'('
);
expr_start
=
strchr
(
p
,
'('
);
if
(
!
expr_start
)
if
(
!
expr_start
)
die
(
"missing '(' in while"
);
die
(
"missing '(' in while"
);
...
@@ -1962,14 +1987,12 @@ int do_while(struct st_query* q)
...
@@ -1962,14 +1987,12 @@ int do_while(struct st_query* q)
die
(
"missing ')' in while"
);
die
(
"missing ')' in while"
);
var_init
(
&
v
,
0
,
0
,
0
,
0
);
var_init
(
&
v
,
0
,
0
,
0
,
0
);
eval_expr
(
&
v
,
++
expr_start
,
&
expr_end
);
eval_expr
(
&
v
,
++
expr_start
,
&
expr_end
);
*
cur_block
++
=
parser
.
current_line
++
;
if
(
!
v
.
int_val
)
/* Define inner block */
{
cur_block
++
;
*++
block_ok
=
0
;
cur_block
->
cmd
=
cmd
;
false_block_depth
++
;
cur_block
->
ok
=
(
v
.
int_val
?
TRUE
:
FALSE
);
}
else
*++
block_ok
=
1
;
var_free
(
&
v
);
var_free
(
&
v
);
return
0
;
return
0
;
}
}
...
@@ -3653,12 +3676,13 @@ int main(int argc, char **argv)
...
@@ -3653,12 +3676,13 @@ int main(int argc, char **argv)
lineno
=
lineno_stack
;
lineno
=
lineno_stack
;
my_init_dynamic_array
(
&
q_lines
,
sizeof
(
struct
st_query
*
),
INIT_Q_LINES
,
my_init_dynamic_array
(
&
q_lines
,
sizeof
(
struct
st_query
*
),
INIT_Q_LINES
,
INIT_Q_LINES
);
INIT_Q_LINES
);
memset
(
block_stack
,
0
,
sizeof
(
block_stack
));
memset
(
block_stack
,
0
,
sizeof
(
block_stack
));
block_stack_end
=
block_stack
+
BLOCK_STACK_DEPTH
;
block_stack_end
=
block_stack
+
BLOCK_STACK_DEPTH
;
memset
(
block_ok_stack
,
0
,
sizeof
(
block_stack
))
;
cur_block
=
block_stack
;
cur_block
=
block_stack
;
cur_block
->
ok
=
TRUE
;
/* Outer block should always be executed */
block_ok
=
block_ok_stack
;
cur_block
->
cmd
=
cmd_none
;
*
block_ok
=
1
;
init_dynamic_string
(
&
ds_res
,
""
,
0
,
65536
);
init_dynamic_string
(
&
ds_res
,
""
,
0
,
65536
);
parse_args
(
argc
,
argv
);
parse_args
(
argc
,
argv
);
...
@@ -3712,7 +3736,7 @@ int main(int argc, char **argv)
...
@@ -3712,7 +3736,7 @@ int main(int argc, char **argv)
int
current_line_inc
=
1
,
processed
=
0
;
int
current_line_inc
=
1
,
processed
=
0
;
if
(
q
->
type
==
Q_UNKNOWN
||
q
->
type
==
Q_COMMENT_WITH_COMMAND
)
if
(
q
->
type
==
Q_UNKNOWN
||
q
->
type
==
Q_COMMENT_WITH_COMMAND
)
get_query_type
(
q
);
get_query_type
(
q
);
if
(
*
block_
ok
)
if
(
cur_block
->
ok
)
{
{
processed
=
1
;
processed
=
1
;
switch
(
q
->
type
)
{
switch
(
q
->
type
)
{
...
@@ -3915,7 +3939,8 @@ int main(int argc, char **argv)
...
@@ -3915,7 +3939,8 @@ int main(int argc, char **argv)
{
{
current_line_inc
=
0
;
current_line_inc
=
0
;
switch
(
q
->
type
)
{
switch
(
q
->
type
)
{
case
Q_WHILE
:
do_while
(
q
);
break
;
case
Q_WHILE
:
do_block
(
cmd_while
,
q
);
break
;
case
Q_IF
:
do_block
(
cmd_if
,
q
);
break
;
case
Q_END_BLOCK
:
do_done
(
q
);
break
;
case
Q_END_BLOCK
:
do_done
(
q
);
break
;
default:
current_line_inc
=
1
;
break
;
default:
current_line_inc
=
1
;
break
;
}
}
...
...
mysql-test/include/rpl_stmt_seq.inc
View file @
41d1c094
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
###############################################################
###############################################################
# Debug options : To debug this test script
# Debug options : To debug this test script
###############################################################
###############################################################
let
$showbinlog
=
0
;
let
$show
_
binlog
=
0
;
let
$manipulate
=
1
;
let
$manipulate
=
1
;
######## The typical test sequence
######## The typical test sequence
...
...
mysql-test/r/rpl_ddl.result
View file @
41d1c094
This diff is collapsed.
Click to expand it.
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