jimcoly / h2database

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

INSTR behaves case sensitive on VARCHAR_IGNORECASE column #591

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1. CREATE TABLE TESTBUG(STRFLD VARCHAR_IGNORECASE(254) NOT NULL);
2. INSERT INTO TESTBUG(STRFLD) VALUES ('Abc');
3. SELECT STRFLD FROM TESTBUG WHERE INSTR(STRFLD , 'a') > 0;

What is the expected output?
The inserted row 'Abc'.

What do you see instead?
"no rows"

What version of the product are you using?
"H2 1.3.176 (2014-04-05)"

On what operating system
"Microsoft Windows XP [Version 5.1.2600]"
, file system
"NTFS"
, and virtual machine
"IKVM 7.2.4630.5"
?

Do you know a workaround?
Yes: use "LIKE '%a%'" instead.

What is your use case, meaning why do you need this feature?
MySQL compatible queries.

How important/urgent is the problem for you?
Not important, not urgent.

Please provide any additional information below.
Note VARCHAR_IGNORECASE column type.
H2 Server started with command:

ikvm.exe -cp h2-1.3.176.jar org.h2.tools.Console -web -tcp

Thousands of rows inserted and queried(some complex) works fine.

Original issue reported on code.google.com by software...@gmail.com on 7 Nov 2014 at 2:13

GoogleCodeExporter commented 9 years ago
Yes, this function is case sensitive, even if the parameters are not. I will 
document this, but don't consider this to be a bug. If needed, a user defined 
function can be created. But patches are welcome.

Original comment by thomas.t...@gmail.com on 12 Mar 2015 at 6:50

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 12 Mar 2015 at 6:50