mariadb/sql
Alexander Barkov 48d7038861 Token precedence cleanup in *.yy
We'll be fixing soon shift-reduce conflicts introduced in the new
10.3 syntax (see MDEV-15818 for details) by defining precedence for
a number of tokens (e.g. TIMESTAMP, TRANSACTION_SYM, TEXT_STRING)
and adding "%prec" directives.

Before doing this, it's better to have the existing precedences set properly,
for easier readability and maintainability.

Details:
- Changing precedence of NOT to its proper position (between AND and IS).
  It was wrong. It worked fine only because the relevant grammar reside
  in different separate rules (expr and predicate).

- Moving NOT2_SYM and BINARY to the same line with NEG and ~
  It worked fine because operators !, BINARY, ~ do not conflict
  to each other.

- Fixing associativity of NOT_SYM, NOT2_SYM, BINARY, COLLATE_SYM
  from "right" to "left". They are not dyadic (operate on a single expression
  only). So "%left" or "%right" is needed only to set precedence,
  while associativity does not matter.
  Note, it would be better to use "%precedence" for these tokens
  instead of "%left" though, but we use an old version of Bison on windows,
  which may not support %precedence yet.

This patch does not change behavior. The generated sql_yacc.cc and
sql_yacc_ora.cc are exactly the same before and after this change.
2018-05-16 21:58:28 +04:00
..
share MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a versioned HEAP table. 2018-05-16 09:44:22 +04:00
add_errmsg
authors.h
bounded_queue.h
client_settings.h
CMakeLists.txt
compat56.cc
compat56.h
contributors.h
create_options.cc
create_options.h Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
custom_conf.h
datadict.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
datadict.h
debug_sync.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
debug_sync.h
derror.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
derror.h
des_key_file.cc
des_key_file.h
discover.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
discover.h
encryption.cc
event_data_objects.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
event_data_objects.h
event_db_repository.cc
event_db_repository.h
event_parse_data.cc
event_parse_data.h
event_queue.cc
event_queue.h
event_scheduler.cc
event_scheduler.h
events.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
events.h
field.cc MDEV-15592 - Column COMPRESSED should select a 'high order' datatype 2018-05-11 19:57:07 +04:00
field.h MDEV-15592 - Column COMPRESSED should select a 'high order' datatype 2018-05-11 19:57:07 +04:00
field_comp.cc
field_comp.h
field_conv.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
filesort.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
filesort.h
filesort_utils.cc
filesort_utils.h
gcalc_slicescan.cc
gcalc_slicescan.h
gcalc_tools.cc
gcalc_tools.h
gen_lex_hash.cc Add checking of correct likely/unlikely 2018-05-07 00:07:32 +03:00
gen_lex_token.cc
group_by_handler.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
group_by_handler.h
gstream.cc
gstream.h
ha_partition.cc cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
ha_partition.h
ha_sequence.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
ha_sequence.h
handler.cc MDEV-14823, MDEV-15956 Versioning error messages fixes 2018-05-12 10:16:46 +02:00
handler.h cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
hash_filo.cc
hash_filo.h
hostname.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
hostname.h
init.cc
init.h
innodb_priv.h
item.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
item.h MDEV-15576: Server crashed in Cached_item_str::cmp / sortcmp or Assertion `item->null_value' failed in Type_handler_temporal_result::make_sort_key upon SELECT with NULLIF and ROLLUP 2018-05-15 14:20:54 +02:00
item_buff.cc
item_cmpfunc.cc MDEV-15576: Server crashed in Cached_item_str::cmp / sortcmp or Assertion `item->null_value' failed in Type_handler_temporal_result::make_sort_key upon SELECT with NULLIF and ROLLUP 2018-05-15 14:20:54 +02:00
item_cmpfunc.h
item_create.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
item_create.h
item_func.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
item_func.h MDEV-15576: Server crashed in Cached_item_str::cmp / sortcmp or Assertion `item->null_value' failed in Type_handler_temporal_result::make_sort_key upon SELECT with NULLIF and ROLLUP 2018-05-15 14:20:54 +02:00
item_geofunc.cc
item_geofunc.h
item_inetfunc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
item_inetfunc.h
item_jsonfunc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
item_jsonfunc.h
item_row.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
item_row.h
item_strfunc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
item_strfunc.h
item_subselect.cc MDEV-14820 System versioning is applied incorrectly to CTEs 2018-05-12 10:16:45 +02:00
item_subselect.h
item_sum.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
item_sum.h
item_timefunc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
item_timefunc.h
item_vers.cc MDEV-15893 Rename VTQ to TRT 2018-05-12 10:16:46 +02:00
item_vers.h MDEV-15893 Rename VTQ to TRT 2018-05-12 10:16:46 +02:00
item_windowfunc.cc
item_windowfunc.h
item_xmlfunc.cc
item_xmlfunc.h
key.cc
key.h
keycaches.cc
keycaches.h
lex.h MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE 2018-05-16 17:21:31 +04:00
lex_string.h
lex_symbol.h
lock.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
lock.h
log.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
log.h
log_event.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
log_event.h Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
log_event_old.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
log_event_old.h
log_slow.h
main.cc
mariadb.h
mdl.cc
mdl.h
mem_root_array.h
message.h
message.mc
message.rc
mf_iocache.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
mf_iocache_encr.cc
MSG00001.bin
multi_range_read.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
multi_range_read.h
my_apc.cc
my_apc.h
my_decimal.cc
my_decimal.h
my_json_writer.cc
my_json_writer.h
mysql_install_db.cc
mysql_upgrade_service.cc
mysqld.cc MDEV-15978 Add Feature_system_versioning status variable 2018-05-12 10:16:46 +02:00
mysqld.h Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
mysqld_suffix.h
net_serv.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
nt_servc.cc
nt_servc.h
opt_index_cond_pushdown.cc
opt_range.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
opt_range.h
opt_range_mrr.cc
opt_split.cc
opt_subselect.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
opt_subselect.h
opt_sum.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
opt_table_elimination.cc
parse_file.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
parse_file.h
partition_element.h
partition_info.cc MDEV-16101: ADD PARTITION on table partitioned by list does not work with more than 32 list values. 2018-05-14 15:12:40 -07:00
partition_info.h
password.c
plistsort.c
procedure.cc
procedure.h
protocol.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
protocol.h
proxy_protocol.cc
proxy_protocol.h
records.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
records.h cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
repl_failsafe.cc
repl_failsafe.h
replication.h
rpl_constants.h
rpl_filter.cc
rpl_filter.h
rpl_gtid.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
rpl_gtid.h
rpl_injector.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
rpl_injector.h
rpl_mi.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
rpl_mi.h
rpl_parallel.cc MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT 2018-05-07 14:58:11 +05:30
rpl_parallel.h
rpl_record.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
rpl_record.h
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc
rpl_reporting.h
rpl_rli.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h
scheduler.cc
scheduler.h
semisync.cc
semisync.h
semisync_master.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
semisync_master.h
semisync_master_ack_receiver.cc
semisync_master_ack_receiver.h
semisync_slave.cc
semisync_slave.h
session_tracker.cc
session_tracker.h
set_var.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
set_var.h
signal_handler.cc
slave.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
slave.h
sp.cc sp_cache_package_routine: fix compile warning 2018-05-07 14:37:38 +04:00
sp.h
sp_cache.cc
sp_cache.h
sp_head.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sp_head.h
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sp_rcontext.h
spatial.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
spatial.h
sql_acl.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_acl.h
sql_admin.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_admin.h
sql_alloc.h
sql_alter.cc MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT 2018-05-07 14:58:11 +05:30
sql_alter.h MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT 2018-05-07 14:58:11 +05:30
sql_analyse.cc
sql_analyse.h
sql_analyze_stmt.cc
sql_analyze_stmt.h
sql_array.h Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_audit.cc
sql_audit.h
sql_base.cc MDEV-15465 Server crash or ASAN heap-use-after-free in Item_func_match::cleanup upon using FT search with partitioning. 2018-05-15 14:10:19 +04:00
sql_base.h MDEV-15465 Server crash or ASAN heap-use-after-free in Item_func_match::cleanup upon using FT search with partitioning. 2018-05-15 14:10:19 +04:00
sql_basic_types.h
sql_binlog.cc
sql_binlog.h
sql_bitmap.h
sql_bootstrap.cc
sql_bootstrap.h
sql_builtin.cc.in
sql_cache.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_cache.h
sql_callback.h
sql_class.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_class.h MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions 2018-05-12 10:16:46 +02:00
sql_client.cc
sql_cmd.h
sql_connect.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_connect.h
sql_const.h
sql_crypt.cc
sql_crypt.h
sql_cte.cc MDEV-14820 System versioning is applied incorrectly to CTEs 2018-05-12 10:16:45 +02:00
sql_cte.h
sql_cursor.cc
sql_cursor.h
sql_db.cc cleanup: quoted_string 2018-05-12 10:16:45 +02:00
sql_db.h
sql_delete.cc cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
sql_delete.h
sql_derived.cc MDEV-14820 System versioning is applied incorrectly to CTEs 2018-05-12 10:16:45 +02:00
sql_derived.h
sql_digest.cc
sql_digest.h
sql_digest_stream.h
sql_do.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_do.h
sql_error.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_error.h
sql_explain.cc
sql_explain.h
sql_expression_cache.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_expression_cache.h
sql_get_diagnostics.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_get_diagnostics.h
sql_handler.cc MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a versioned HEAP table. 2018-05-16 09:44:22 +04:00
sql_handler.h MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a versioned HEAP table. 2018-05-16 09:44:22 +04:00
sql_help.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_help.h
sql_hset.h
sql_insert.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_insert.h
sql_join_cache.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_join_cache.h
sql_lex.cc MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE 2018-05-16 17:21:31 +04:00
sql_lex.h MDEV-14820 System versioning is applied incorrectly to CTEs 2018-05-12 10:16:45 +02:00
sql_lifo_buffer.h
sql_list.cc
sql_list.h
sql_load.cc MDEV-15965 Invisible columns and LOAD DATA don't work well together:... ER_WARN_TOO_FEW_RECORDS 2018-05-15 12:38:44 +05:30
sql_load.h
sql_locale.cc
sql_locale.h
sql_manager.cc
sql_manager.h
sql_parse.cc cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
sql_parse.h Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql_partition.cc versioning: use @@timestamp 2018-05-12 10:16:46 +02:00
sql_partition.h Remove mem_alloc_error() 2018-05-07 00:07:33 +03:00
sql_partition_admin.cc Remove mem_alloc_error() 2018-05-07 00:07:33 +03:00
sql_partition_admin.h
sql_plist.h
sql_plugin.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_plugin.h
sql_plugin_compat.h
sql_plugin_services.ic
sql_prepare.cc MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a versioned HEAP table. 2018-05-16 09:44:22 +04:00
sql_prepare.h
sql_priv.h
sql_profile.cc
sql_profile.h
sql_reload.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_reload.h
sql_rename.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_rename.h
sql_repl.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_repl.h
sql_select.cc MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
sql_select.h Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
sql_sequence.cc Added missing write_unlock() in case of errors 2018-05-14 10:08:04 +03:00
sql_sequence.h
sql_servers.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_servers.h
sql_show.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_show.h
sql_signal.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_signal.h
sql_sort.h Change read_to_buffer to use ulong instead of uint 2018-05-07 00:07:33 +03:00
sql_state.c
sql_statistics.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
sql_statistics.h
sql_string.cc
sql_string.h Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_table.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
sql_table.h
sql_tablespace.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_tablespace.h
sql_test.cc
sql_test.h
sql_time.cc
sql_time.h
sql_trigger.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_trigger.h
sql_truncate.cc MDEV-15970 Crash when doing truncate on locked sequence 2018-05-14 10:08:05 +03:00
sql_truncate.h
sql_tvc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_tvc.h
sql_type.cc MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
sql_type.h MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
sql_udf.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
sql_udf.h
sql_union.cc MDEV-15465 Server crash or ASAN heap-use-after-free in Item_func_match::cleanup upon using FT search with partitioning. 2018-05-15 14:10:19 +04:00
sql_union.h
sql_update.cc cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next() 2018-05-12 10:16:45 +02:00
sql_update.h
sql_view.cc cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
sql_view.h
sql_window.cc Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
sql_window.h
sql_yacc.yy Token precedence cleanup in *.yy 2018-05-16 21:58:28 +04:00
sql_yacc_ora.yy Token precedence cleanup in *.yy 2018-05-16 21:58:28 +04:00
strfunc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
strfunc.h
structs.h
sys_vars.cc MDEV-15995 Drop extra semicolon in VARIABLE_COMMENT for SYSTEM_VERSIONING_ALTER_HISTORY 2018-05-12 10:16:46 +02:00
sys_vars.ic MDEV-15923 option to control who can set session @@timestamp 2018-05-12 10:16:45 +02:00
sys_vars_shared.h
table.cc MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
table.h MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
table_cache.cc Add checking of correct likely/unlikely 2018-05-07 00:07:32 +03:00
table_cache.h
temporary_tables.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
thr_malloc.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
thr_malloc.h
threadpool.h
threadpool_common.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
threadpool_generic.cc
threadpool_win.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
transaction.cc MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions 2018-05-12 10:16:46 +02:00
transaction.h
tzfile.h
tztime.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
tztime.h
udf_example.c
udf_example.def
uniques.cc Change read_to_buffer to use ulong instead of uint 2018-05-07 00:07:33 +03:00
uniques.h
unireg.cc cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
unireg.h
vers_string.h cleanup: versioning style fixes 2018-05-12 10:16:45 +02:00
vers_utils.h
winservice.c
winservice.h
wsrep_applier.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
wsrep_applier.h
wsrep_binlog.cc Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
wsrep_binlog.h
wsrep_check_opts.cc
wsrep_dummy.cc
wsrep_hton.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
wsrep_mysqld.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
wsrep_mysqld.h Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
wsrep_notify.cc
wsrep_priv.h
wsrep_sst.cc
wsrep_sst.h
wsrep_thd.cc Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
wsrep_thd.h
wsrep_utils.cc
wsrep_utils.h
wsrep_var.cc
wsrep_var.h
wsrep_xid.cc
wsrep_xid.h