efmarshall / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Support for SUBSTRING without a FROM condition #479

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
"SELECT SUBSTRING('ABCDEF' FOR 3)" is not valid in H2, at present the FROM 
condition is mandatory. I think we can probably relax this constraint to match 
the handling in Postgres?

What is the expected output?

mydb=# SELECT SUBSTRING('ABCDEF' FOR 3);
 substring 
-----------
 ABC
(1 row)

A patch is attached which includes a unit test. Note that PG also supports 
flipping the FOR/FROM portion of the query, and barfs when neither are 
provided. Unsure if you want to mirror this behaviour too?

Original issue reported on code.google.com by arbfrank...@gmail.com on 14 Jun 2013 at 3:55

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, patch committed.

Original comment by noelgrandin on 18 Jun 2013 at 1:32