Skip to content

Commit

Permalink
Fix Oracle insert with colum name 'RANK' (apache#11158)
Browse files Browse the repository at this point in the history
* issue-11074
Oracle Insert statement Parse SQL ERROR!Please Help! apache#11074

* Fix Oracle insert with colum name 'RANK'

* Fix Oracle insert with colum name 'RANK'
  • Loading branch information
tuichenchuxin authored Jul 6, 2021
1 parent 2ad1db3 commit 01bd119
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ unreservedWord
| BECOME | CHANGE | NOTIFICATION | PRIVILEGE | PURGE | RESUMABLE
| SYSGUID | SYSBACKUP | SYSDBA | SYSDG | SYSKM | SYSOPER | DBA_RECYCLEBIN |SCHEMA
| DO | DEFINER | CURRENT_USER | CASCADED | CLOSE | OPEN | NEXT | NAME | NAMES
| COLLATION | REAL | TYPE | FIRST
| COLLATION | REAL | TYPE | FIRST | RANK
;

schemaName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1824,4 +1824,18 @@
</projections>
</select-subquery>
</insert>

<insert sql-case-id="insert_with_rank_column">
<table name="sales" start-index="12" stop-index="16" />
<columns start-index="18" stop-index="23">
<column name="rank" start-index="19" stop-index="22" />
</columns>
<values>
<value>
<assignment-value>
<literal-expression value="1" start-index="33" stop-index="33" />
</assignment-value>
</value>
</values>
</insert>
</sql-parser-test-cases>
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@
<sql-case id="insert_with_multitable_element" value="INSERT ALL INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date, sales_sun) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, sales_mon, weekly_start_date+1) SELECT product_id, customer_id, weekly_start_date, sales_sun, sales_mon FROM sales_input_table" db-types="Oracle" />
<sql-case id="insert_all_with_multitable_with_conditional_when" value="INSERT ALL WHEN order_total &lt;= 100000 THEN INTO small_orders WHEN order_total > 1000000 AND order_total &lt;= 200000 THEN INTO medium_orders WHEN order_total > 200000 THEN INTO large_orders SELECT order_id, order_total, sales_rep_id, customer_id FROM orders" db-types="Oracle" />
<sql-case id="insert_all_with_multitable_with_conditional_when_with_conditional_else" value="INSERT ALL WHEN order_total &lt;= 100000 THEN INTO small_orders WHEN order_total > 100000 AND order_total &lt;= 200000 THEN INTO medium_orders ELSE INTO large_orders SELECT order_id, order_total, sales_rep_id, customer_id FROM orders" db-types="Oracle" />
<sql-case id="insert_with_rank_column" value="insert into sales (rank) values (1)" db-types="Oracle" />
</sql-cases>

0 comments on commit 01bd119

Please sign in to comment.