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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
172dc5b3
Commit
172dc5b3
authored
Jan 23, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solve the lex conflict between the existing repeat() function
and repeat SP-construction
parent
838303a7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
mysql-test/r/sp.result
mysql-test/r/sp.result
+6
-6
mysql-test/t/sp.test
mysql-test/t/sp.test
+3
-3
sql/lex.h
sql/lex.h
+1
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-4
No files found.
mysql-test/r/sp.result
View file @
172dc5b3
...
@@ -72,10 +72,10 @@ set x = x-1;
...
@@ -72,10 +72,10 @@ set x = x-1;
insert into test.t1 values ("a", x);
insert into test.t1 values ("a", x);
end while;
end while;
create procedure b(x int)
create procedure b(x int)
sp
repeat
repeat
insert into test.t1 values (
"b"
, x);
insert into test.t1 values (
repeat("b",3)
, x);
set x = x-1;
set x = x-1;
until x = 0 end
sp
repeat;
until x = 0 end repeat;
create procedure c(x int)
create procedure c(x int)
hmm: while x > 0 do
hmm: while x > 0 do
insert into test.t1 values ("c", x);
insert into test.t1 values ("c", x);
...
@@ -187,9 +187,9 @@ delete from t1;
...
@@ -187,9 +187,9 @@ delete from t1;
call b(3);
call b(3);
select * from t1;
select * from t1;
id data
id data
b 3
b
bb
3
b 2
b
bb
2
b 1
b
bb
1
delete from t1;
delete from t1;
call c(3);
call c(3);
select * from t1;
select * from t1;
...
...
mysql-test/t/sp.test
View file @
172dc5b3
...
@@ -122,10 +122,10 @@ end while|
...
@@ -122,10 +122,10 @@ end while|
# REPEAT
# REPEAT
create
procedure
b
(
x
int
)
create
procedure
b
(
x
int
)
sp
repeat
repeat
insert
into
test
.
t1
values
(
"b"
,
x
);
insert
into
test
.
t1
values
(
repeat
(
"b"
,
3
)
,
x
);
set
x
=
x
-
1
;
set
x
=
x
-
1
;
until
x
=
0
end
sp
repeat
|
until
x
=
0
end
repeat
|
# Labelled WHILE with ITERATE (pointless really)
# Labelled WHILE with ITERATE (pointless really)
create
procedure
c
(
x
int
)
create
procedure
c
(
x
int
)
...
...
sql/lex.h
View file @
172dc5b3
...
@@ -318,7 +318,7 @@ static SYMBOL symbols[] = {
...
@@ -318,7 +318,7 @@ static SYMBOL symbols[] = {
{
"REPAIR"
,
SYM
(
REPAIR
),
0
,
0
},
{
"REPAIR"
,
SYM
(
REPAIR
),
0
,
0
},
{
"REPLACE"
,
SYM
(
REPLACE
),
0
,
0
},
{
"REPLACE"
,
SYM
(
REPLACE
),
0
,
0
},
{
"REPLICATION"
,
SYM
(
REPLICATION
),
0
,
0
},
{
"REPLICATION"
,
SYM
(
REPLICATION
),
0
,
0
},
{
"
SPREPEAT"
,
SYM
(
SPREPEAT_SYM
),
0
,
0
},
/* QQ Temp. until conflict solved */
{
"
REPEAT"
,
SYM
(
REPEAT_SYM
),
0
,
0
},
{
"REPEATABLE"
,
SYM
(
REPEATABLE_SYM
),
0
,
0
},
{
"REPEATABLE"
,
SYM
(
REPEATABLE_SYM
),
0
,
0
},
{
"REQUIRE"
,
SYM
(
REQUIRE_SYM
),
0
,
0
},
{
"REQUIRE"
,
SYM
(
REQUIRE_SYM
),
0
,
0
},
{
"RESET"
,
SYM
(
RESET_SYM
),
0
,
0
},
{
"RESET"
,
SYM
(
RESET_SYM
),
0
,
0
},
...
@@ -567,7 +567,6 @@ static SYMBOL sql_functions[] = {
...
@@ -567,7 +567,6 @@ static SYMBOL sql_functions[] = {
{
"RADIANS"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_radians
)},
{
"RADIANS"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_radians
)},
{
"RAND"
,
SYM
(
RAND
),
0
,
0
},
{
"RAND"
,
SYM
(
RAND
),
0
,
0
},
{
"RELEASE_LOCK"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_release_lock
)},
{
"RELEASE_LOCK"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_release_lock
)},
{
"REPEAT"
,
SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_repeat
)},
{
"REVERSE"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_reverse
)},
{
"REVERSE"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_reverse
)},
{
"ROUND"
,
SYM
(
ROUND
),
0
,
0
},
{
"ROUND"
,
SYM
(
ROUND
),
0
,
0
},
{
"RPAD"
,
SYM
(
FUNC_ARG3
),
0
,
CREATE_FUNC
(
create_func_rpad
)},
{
"RPAD"
,
SYM
(
FUNC_ARG3
),
0
,
CREATE_FUNC
(
create_func_rpad
)},
...
...
sql/sql_yacc.yy
View file @
172dc5b3
...
@@ -535,8 +535,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
...
@@ -535,8 +535,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token ITERATE_SYM
%token ITERATE_SYM
%token LEAVE_SYM
%token LEAVE_SYM
%token LOOP_SYM
%token LOOP_SYM
/* QQ This is temporary, until the REPEAT conflict is solved. */
%token REPEAT_SYM
%token SPREPEAT_SYM
%token UNTIL_SYM
%token UNTIL_SYM
%token WHILE_SYM
%token WHILE_SYM
%token ASENSITIVE_SYM
%token ASENSITIVE_SYM
...
@@ -1284,8 +1283,8 @@ sp_unlabeled_control:
...
@@ -1284,8 +1283,8 @@ sp_unlabeled_control:
lex->sphead->add_instr(i);
lex->sphead->add_instr(i);
}
}
|
SPREPEAT_SYM sp_proc_stmts UNTIL_SYM expr END SP
REPEAT_SYM
|
REPEAT_SYM sp_proc_stmts UNTIL_SYM expr END
REPEAT_SYM
{
/* ^^ QQ temp. until conflict solved ^^ */
{
LEX *lex= Lex;
LEX *lex= Lex;
uint ip= lex->sphead->instructions();
uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
...
@@ -2517,6 +2516,8 @@ simple_expr:
...
@@ -2517,6 +2516,8 @@ simple_expr:
{ $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);}
{ $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);}
| FUNC_ARG3 '(' expr ',' expr ',' expr ')'
| FUNC_ARG3 '(' expr ',' expr ',' expr ')'
{ $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);}
{ $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);}
| REPEAT_SYM '(' expr ',' expr ')'
{ $$= new Item_func_repeat($3,$5); }
| ATAN '(' expr ')'
| ATAN '(' expr ')'
{ $$= new Item_func_atan($3); }
{ $$= new Item_func_atan($3); }
| ATAN '(' expr ',' expr ')'
| ATAN '(' expr ',' expr ')'
...
...
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