[CP][FEAT MERGE]SDO_GEOMETRY & MYSQL GIS EXPR IMPLEMENT
This commit is contained in:
		| @ -1019,6 +1019,7 @@ static const NonReservedKeyword Mysql_none_reserved_keywords[] = | ||||
|   {"kv_attributes", KV_ATTRIBUTES}, | ||||
|   {"RESOURCE_POOL", RESOURCE_POOL}, | ||||
|   {"clone", CLONE}, | ||||
|   {"_st_asmvt", _ST_ASMVT}, | ||||
| }; | ||||
|  | ||||
| /** https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html | ||||
|  | ||||
| @ -343,7 +343,7 @@ END_P SET_VAR DELIMITER | ||||
|         SET_TP SHARE SHUTDOWN SIGNED SIMPLE SKIP_INDEX SLAVE SLOW SLOT_IDX SNAPSHOT SOCKET SOME SONAME SOUNDS | ||||
|         SOURCE SPFILE SPLIT SQL_AFTER_GTIDS SQL_AFTER_MTS_GAPS SQL_BEFORE_GTIDS SQL_BUFFER_RESULT | ||||
|         SQL_CACHE SQL_NO_CACHE SQL_ID SCHEMA_ID SQL_THREAD SQL_TSI_DAY SQL_TSI_HOUR SQL_TSI_MINUTE SQL_TSI_MONTH | ||||
|         SQL_TSI_QUARTER SQL_TSI_SECOND SQL_TSI_WEEK SQL_TSI_YEAR SRID STANDBY STAT START STARTS STATS_AUTO_RECALC | ||||
|         SQL_TSI_QUARTER SQL_TSI_SECOND SQL_TSI_WEEK SQL_TSI_YEAR SRID STANDBY _ST_ASMVT STAT START STARTS STATS_AUTO_RECALC | ||||
|         STATS_PERSISTENT STATS_SAMPLE_PAGES STATUS STATEMENTS STATISTICS STD STDDEV STDDEV_POP STDDEV_SAMP STRONG | ||||
|         SYNCHRONIZATION SYNCHRONOUS STOP STORAGE STORAGE_FORMAT_VERSION STORE STORING STRING | ||||
|         SUBCLASS_ORIGIN SUBDATE SUBJECT SUBPARTITION SUBPARTITIONS SUBSTR SUBSTRING SUCCESSFUL SUM | ||||
| @ -520,7 +520,7 @@ END_P SET_VAR DELIMITER | ||||
| %type <node> on_empty on_error json_on_response opt_returning_type opt_on_empty_or_error json_value_expr opt_ascii opt_truncate_clause | ||||
| %type <node> ws_nweights opt_ws_as_char opt_ws_levels ws_level_flag_desc ws_level_flag_reverse ws_level_flags ws_level_list ws_level_list_item ws_level_number ws_level_range ws_level_list_or_range | ||||
| %type <node> get_diagnostics_stmt get_statement_diagnostics_stmt get_condition_diagnostics_stmt statement_information_item_list condition_information_item_list statement_information_item condition_information_item statement_information_item_name condition_information_item_name condition_arg | ||||
| %type <node> method_opt method_list method extension | ||||
| %type <node> method_opt method_list method extension mvt_param | ||||
| %type <node> opt_storage_name opt_calibration_list calibration_info_list | ||||
| %type <node> switchover_tenant_stmt switchover_clause opt_verify | ||||
| %type <node> recover_tenant_stmt recover_point_clause | ||||
| @ -534,6 +534,7 @@ END_P SET_VAR DELIMITER | ||||
| %type <node> table_values_caluse table_values_caluse_with_order_by_and_limit values_row_list row_value | ||||
| %type <node> create_tenant_snapshot_stmt snapshot_name drop_tenant_snapshot_stmt clone_tenant_stmt clone_snapshot_option clone_tenant_option clone_tenant_option_list | ||||
| %type <node> transfer_partition_stmt transfer_partition_clause part_info cancel_transfer_partition_clause | ||||
| %type <node> geometry_collection | ||||
| %type <node> ttl_definition ttl_expr ttl_unit | ||||
| %type <node> id_dot_id id_dot_id_dot_id | ||||
| %start sql_stmt | ||||
| @ -2362,6 +2363,11 @@ ALL { | ||||
| | /*empty*/{ $$ = NULL; } | ||||
| ; | ||||
|  | ||||
| geometry_collection: | ||||
| GEOMETRYCOLLECTION { $$ = NULL; } | ||||
| | GEOMCOLLECTION { $$ = NULL; } | ||||
| ; | ||||
|  | ||||
| func_expr: | ||||
| MOD '(' expr ',' expr ')' | ||||
| { | ||||
| @ -3025,25 +3031,42 @@ MOD '(' expr ',' expr ')' | ||||
|   merge_nodes(expr_list, result, T_EXPR_LIST, $3); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_MULTIPOLYGON, 1, expr_list); | ||||
| } | ||||
| | GEOMETRYCOLLECTION '(' expr_list ')' | ||||
| | geometry_collection '(' expr_list ')' | ||||
| { | ||||
|   UNUSED($1); | ||||
|   ParseNode *expr_list = NULL; | ||||
|   merge_nodes(expr_list, result, T_EXPR_LIST, $3); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_GEOMCOLLECTION, 1, expr_list); | ||||
| } | ||||
| | GEOMETRYCOLLECTION '(' ')' | ||||
| | geometry_collection '(' ')' | ||||
| { | ||||
|   UNUSED($1); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_GEOMCOLLECTION, 1, NULL); | ||||
| } | ||||
| | GEOMCOLLECTION '(' expr_list ')' | ||||
| | _ST_ASMVT '(' column_ref ')' | ||||
| { | ||||
|   ParseNode *expr_list = NULL; | ||||
|   merge_nodes(expr_list, result, T_EXPR_LIST, $3); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_GEOMCOLLECTION, 1, expr_list); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_ST_ASMVT, 1, $3); | ||||
|   $$->reserved_ = 0; | ||||
| } | ||||
| | GEOMCOLLECTION '(' ')' | ||||
| | _ST_ASMVT '(' column_ref ',' mvt_param ')' | ||||
| { | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_GEOMCOLLECTION, 1, NULL); | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_ST_ASMVT, 2, $3, $5); | ||||
|   $$->reserved_ = 0; | ||||
| } | ||||
| | _ST_ASMVT '(' column_ref ',' mvt_param ',' mvt_param ')' | ||||
| { | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_ST_ASMVT, 3, $3, $5, $7); | ||||
|   $$->reserved_ = 0; | ||||
| } | ||||
| | _ST_ASMVT '(' column_ref ',' mvt_param ',' mvt_param ',' mvt_param ')' | ||||
| { | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_ST_ASMVT, 4, $3, $5, $7, $9); | ||||
|   $$->reserved_ = 0; | ||||
| } | ||||
| | _ST_ASMVT '(' column_ref ',' mvt_param ',' mvt_param ',' mvt_param ',' mvt_param ')' | ||||
| { | ||||
|   malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS_ST_ASMVT, 5, $3, $5, $7, $9, $11); | ||||
|   $$->reserved_ = 0; | ||||
| } | ||||
| | SUM_OPNSIZE '(' expr ')' | ||||
| { | ||||
| @ -3051,6 +3074,18 @@ MOD '(' expr ',' expr ')' | ||||
| } | ||||
| ; | ||||
|  | ||||
| mvt_param: | ||||
| STRING_VALUE { $$ = $1; } | ||||
| | INTNUM { $$ = $1; } | ||||
| | '-' INTNUM | ||||
| { | ||||
|   $2->value_ = -$2->value_; | ||||
|   $$ = $2; | ||||
| } | ||||
| | NULLX { $$ = $1; } | ||||
| | column_ref { $$ = $1; } | ||||
| ; | ||||
|  | ||||
| sys_interval_func: | ||||
| INTERVAL '(' expr ',' expr ')' | ||||
| { | ||||
| @ -5613,8 +5648,9 @@ BINARY opt_string_length_i_v2 | ||||
|   $$->param_num_ = 0; | ||||
|   $$->sql_str_off_ = @1.first_column; | ||||
| } | ||||
| | GEOMETRYCOLLECTION | ||||
| | geometry_collection | ||||
| { | ||||
|   UNUSED($1); | ||||
|   malloc_terminal_node($$, result->malloc_pool_, T_CAST_ARGUMENT); | ||||
|   $$->value_ = 0; | ||||
|   $$->int16_values_[OB_NODE_CAST_TYPE_IDX] = T_GEOMETRY; /* data type */ | ||||
| @ -6045,8 +6081,9 @@ int_type_i opt_int_length_i opt_unsigned_i opt_zerofill_i | ||||
|   $$->int32_values_[0] = 0; /* length */ | ||||
|   $$->int32_values_[1] = 6; /* multipolygon, geometry uses collation type value convey sub geometry type. */ | ||||
| } | ||||
| | GEOMETRYCOLLECTION | ||||
| | geometry_collection | ||||
| { | ||||
|   UNUSED($1); | ||||
|   malloc_terminal_node($$, result->malloc_pool_, T_GEOMETRY); | ||||
|   $$->int32_values_[0] = 0; /* length */ | ||||
|   $$->int32_values_[1] = 7; /* geometrycollection, geometry uses collation type value convey sub geometry type. */ | ||||
| @ -20426,6 +20463,7 @@ ACCOUNT | ||||
| |       SQL_TSI_WEEK | ||||
| |       SQL_TSI_YEAR | ||||
| |       SRID | ||||
| |       _ST_ASMVT | ||||
| |       STACKED | ||||
| |       STANDBY | ||||
| |       START | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 wu-xingying
					wu-xingying