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
d25340c9
Commit
d25340c9
authored
Aug 28, 2007
by
malff/marcsql@weblab.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge
parent
bdc65c43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
56 deletions
+44
-56
sql/sql_yacc.yy
sql/sql_yacc.yy
+44
-56
No files found.
sql/sql_yacc.yy
View file @
d25340c9
...
...
@@ -1152,8 +1152,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <item>
literal text_literal insert_ident order_ident
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
variable variable_aux bool_
factor bool_test bool_
pri
predicate bit_expr
bit_term bit_factor value_expr term factor
variable variable_aux bool_pri
predicate bit_expr
table_wild simple_expr udf_expr
expr_or_default set_expr_or_default interval_expr
param_marker geometry_function
...
...
@@ -6558,8 +6558,7 @@ optional_braces:
/* all possible expressions */
expr:
bool_factor
| expr or expr %prec OR_SYM
expr or expr %prec OR_SYM
{
/*
Design notes:
...
...
@@ -6654,36 +6653,35 @@ expr:
$$ = new (YYTHD->mem_root) Item_cond_and($1, $3);
}
}
;
bool_factor:
NOT_SYM bool_factor { $$= negate_expression(YYTHD, $2); }
| bool_test
;
bool_test:
bool_pri IS TRUE_SYM
| NOT_SYM expr %prec NOT_SYM
{ $$= negate_expression(YYTHD, $2); }
| bool_pri IS TRUE_SYM %prec IS
{ $$= new (YYTHD->mem_root) Item_func_istrue($1); }
| bool_pri IS not TRUE_SYM
| bool_pri IS not TRUE_SYM
%prec IS
{ $$= new (YYTHD->mem_root) Item_func_isnottrue($1); }
| bool_pri IS FALSE_SYM
| bool_pri IS FALSE_SYM
%prec IS
{ $$= new (YYTHD->mem_root) Item_func_isfalse($1); }
| bool_pri IS not FALSE_SYM
| bool_pri IS not FALSE_SYM
%prec IS
{ $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); }
| bool_pri IS UNKNOWN_SYM { $$= new Item_func_isnull($1); }
| bool_pri IS not UNKNOWN_SYM { $$= new Item_func_isnotnull($1); }
| bool_pri IS UNKNOWN_SYM %prec IS
{ $$= new Item_func_isnull($1); }
| bool_pri IS not UNKNOWN_SYM %prec IS
{ $$= new Item_func_isnotnull($1); }
| bool_pri
;
bool_pri:
bool_pri IS NULL_SYM { $$= new Item_func_isnull($1); }
| bool_pri IS not NULL_SYM { $$= new Item_func_isnotnull($1); }
| bool_pri EQUAL_SYM predicate { $$= new Item_func_equal($1,$3); }
bool_pri IS NULL_SYM %prec IS
{ $$= new Item_func_isnull($1); }
| bool_pri IS not NULL_SYM %prec IS
{ $$= new Item_func_isnotnull($1); }
| bool_pri EQUAL_SYM predicate %prec EQUAL_SYM
{ $$= new Item_func_equal($1,$3); }
| bool_pri comp_op predicate %prec EQ
{ $$= (*$2)(0)->create($1,$3); }
| bool_pri comp_op all_or_any '(' subselect ')' %prec EQ
{ $$= all_any_subquery_creator($1, $2, $3, $5); }
| predicate
| predicate
;
;
predicate:
...
...
@@ -6743,44 +6741,34 @@ predicate:
;
bit_expr:
bit_expr '|' bit_term { $$= new Item_func_bit_or($1,$3); }
| bit_term
;
bit_term:
bit_term '&' bit_factor { $$= new Item_func_bit_and($1,$3); }
| bit_factor
;
bit_factor:
bit_factor SHIFT_LEFT value_expr
bit_expr '|' bit_expr %prec '|'
{ $$= new Item_func_bit_or($1,$3); }
| bit_expr '&' bit_expr %prec '&'
{ $$= new Item_func_bit_and($1,$3); }
| bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
{ $$= new Item_func_shift_left($1,$3); }
| bit_
factor SHIFT_RIGHT value_expr
| bit_
expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
{ $$= new Item_func_shift_right($1,$3); }
| value_expr
;
value_expr:
value_expr '+' term { $$= new Item_func_plus($1,$3); }
| value_expr '-' term { $$= new Item_func_minus($1,$3); }
| value_expr '+' interval_expr interval
| bit_expr '+' bit_expr %prec '+'
{ $$= new Item_func_plus($1,$3); }
| bit_expr '-' bit_expr %prec '-'
{ $$= new Item_func_minus($1,$3); }
| bit_expr '+' interval_expr interval %prec '+'
{ $$= new Item_date_add_interval($1,$3,$4,0); }
|
value_expr '-' interval_expr interval
|
bit_expr '-' interval_expr interval %prec '-'
{ $$= new Item_date_add_interval($1,$3,$4,1); }
| term
;
term:
term '*' factor { $$= new Item_func_mul($1,$3); }
| term '/' factor { $$= new Item_func_div($1,$3); }
| term '%' factor { $$= new Item_func_mod($1,$3); }
| term DIV_SYM factor { $$= new Item_func_int_div($1,$3); }
| term MOD_SYM factor { $$= new Item_func_mod($1,$3); }
| factor
;
factor:
factor '^' simple_expr { $$= new Item_func_bit_xor($1,$3); }
| bit_expr '*' bit_expr %prec '*'
{ $$= new Item_func_mul($1,$3); }
| bit_expr '/' bit_expr %prec '/'
{ $$= new Item_func_div($1,$3); }
| bit_expr '%' bit_expr %prec '%'
{ $$= new Item_func_mod($1,$3); }
| bit_expr DIV_SYM bit_expr %prec DIV_SYM
{ $$= new Item_func_int_div($1,$3); }
| bit_expr MOD_SYM bit_expr %prec MOD_SYM
{ $$= new Item_func_mod($1,$3); }
| bit_expr '^' bit_expr
{ $$= new Item_func_bit_xor($1,$3); }
| simple_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