Fix #106: preserve nullable bit when setting SQL_TEXT in _php_ibase_b…#110
Fix #106: preserve nullable bit when setting SQL_TEXT in _php_ibase_b…#110MartinKoeditz wants to merge 1 commit intomasterfrom
Conversation
…ind() The fallthrough path in _php_ibase_bind() unconditionally set sqltype to SQL_TEXT, discarding the nullable bit (bit 0). This caused subsequent ibase_execute() calls with NULL to be ignored for nullable columns that went through this path. Fix: use SQL_TEXT | (var->sqltype & 1) to preserve the nullable flag. Adds test: tests/issue106_001.phpt
|
Hi! Thanks! Most of issues tagged assigned to me has been already fixed. I have to sit down and commit them here yet :) I will check your code too. |
|
Test case will be useful 👍 |
|
If it's ok for you then we should merge it. Test case is available and IMHO correct. |
|
This is fixed already in my local branch. I will merge test case once I push. Currently a bit busy on other projects :| |
|
Did you run this test case with non-fixed version? |
|
Not yet. |
|
So basically this test did not trigger the error for me. I did some tests on my own (tests/nulls_001.phpt, tests/nulls_002.phpt) and I don't remember now if they triggered the error. Most likely one of them did. However, I caught this issue when importing CSV file lots of fields and with prepare/execute after couple of rows. It feels like one or few queries are not enough. |
…ind()
The fallthrough path in _php_ibase_bind() unconditionally set sqltype to SQL_TEXT, discarding the nullable bit (bit 0). This caused subsequent ibase_execute() calls with NULL to be ignored for nullable columns that went through this path.
Fix: use SQL_TEXT | (var->sqltype & 1) to preserve the nullable flag.
Adds test: tests/issue106_001.phpt