Re: [Firebird-devel] Incorrect string right truncation errors in Firebird 5

2022-05-16 Thread Adriano dos Santos Fernandes
On 16/05/2022 12:07, Mark Rotteveel wrote:
> On 16-05-2022 16:50, Mark Rotteveel wrote:
>> I was running some tests against Firebird-5.0.0.494-0_x64 (latest
>> snapshot, from last Saturday), and I notice that I get incorrect
>> string right truncation errors with CHAR/VARCHAR.
>>
>> I currently cannot dive deeper into it, but as a datapoint, the error
>> does not occur with Firebird-5.0.0.488-0_x64.
>>
>> Based solely on the commit message, maybe this commit is at fault?
>> https://github.com/FirebirdSQL/firebird/commit/dd18a3b11b28c3ed8126a6f54b829989954bfa03
> 
> 
> The Jaybird test that triggers this is
> org.firebirdsql.jdbc.TestFBPreparedStatementUTF8, specifically tests:
> 
> - connectionUtf8_insertMultiByte_inWin1252_char_1_win1252_succeeds
> (fails with "expected length 1, actual 2")
> - connectionUtf8_insertMultiByte_notInWin1252_char_1_win1252_fails
> (fails with "expected length 1, actual 2", should fail with "Cannot
> transliterate character between character sets")
> - connectionUtf8_insertMultipleInWin1252_char_5_win1252_succeeds (fails
> with "expected length 5, actual 8")
> - connectionUtf8_insertMultipleInWin1252_varchar_5_win1252_succeeds
> (fails with "expected length 5, actual 8")
> -
> connectionUtf8_insertMultipleInWin1252_lessThanMax_varchar_5_win1252_succeeds
> (fails with "expected length 5, actual 6")
> -connectionUtf8_insertMultiByte_char_1_utf8_succeeds (fails with
> "expected length 1, actual 2")
> - connectionUtf8_insertMultiple_char_5_utf8_succeeds (fails with
> "expected length 5, actual 8")
> - connectionUtf8_insertMultiple_varchar_5_utf8_succeeds (fails with
> "expected length 5, actual 8")
> - connectionUtf8_insertMultiple_lessThanMax_varchar_5_utf8_succeeds
> (fails with "expected length 5, actual 6")
> 
> For CHAR, it seems to count 1 more character, for VARCHAR 2-3 more
> characters.
> 

Is this happening with fbclient library too?

Is the error in insert or select?

I'm failing to reproduce it in isql, for example for
connectionUtf8_insertMultipleInWin1252_varchar_5_win1252_succeeds:

-
CREATE TABLE utf8table (
 id INTEGER,
 char_1_none CHAR(1) CHARACTER SET NONE,
 char_1_utf8 CHAR(1) CHARACTER SET UTF8,
 char_1_win1252 CHAR(1) CHARACTER SET WIN1252,
 char_5_none CHAR(5) CHARACTER SET NONE,
 char_5_utf8 CHAR(5) CHARACTER SET UTF8,
 char_5_win1252 CHAR(5) CHARACTER SET WIN1252,
 varchar_5_none VARCHAR(5) CHARACTER SET NONE,
 varchar_5_utf8 VARCHAR(5) CHARACTER SET UTF8,
 varchar_5_win1252 VARCHAR(5) CHARACTER SET WIN1252
);

/*
select unicode_char(0x00FE) || unicode_char(0x00A3) || 'a' ||
unicode_char(0x0160) || ',' from rdb$database;
*/

set bulk_insert INSERT INTO utf8table (id, char_5_win1252) VALUES (?, ?);
(1, 'þ£aŠ,')
stop
;

select char_5_win1252 from utf8table where id = 1;
-


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Unused but still handled DPB items

2022-05-16 Thread Dimitry Sibiryakov

  Hello All.

  Shouldn't code for handling isc_dpb_journal, isc_dpb_old_file, etc cleaned 
out or someone have plans for their reuse?


--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Incorrect string right truncation errors in Firebird 5

2022-05-16 Thread Mark Rotteveel

On 16-05-2022 16:50, Mark Rotteveel wrote:
I was running some tests against Firebird-5.0.0.494-0_x64 (latest 
snapshot, from last Saturday), and I notice that I get incorrect string 
right truncation errors with CHAR/VARCHAR.


I currently cannot dive deeper into it, but as a datapoint, the error 
does not occur with Firebird-5.0.0.488-0_x64.


Based solely on the commit message, maybe this commit is at fault? 
https://github.com/FirebirdSQL/firebird/commit/dd18a3b11b28c3ed8126a6f54b829989954bfa03 


The Jaybird test that triggers this is 
org.firebirdsql.jdbc.TestFBPreparedStatementUTF8, specifically tests:


- connectionUtf8_insertMultiByte_inWin1252_char_1_win1252_succeeds 
(fails with "expected length 1, actual 2")
- connectionUtf8_insertMultiByte_notInWin1252_char_1_win1252_fails 
(fails with "expected length 1, actual 2", should fail with "Cannot 
transliterate character between character sets")
- connectionUtf8_insertMultipleInWin1252_char_5_win1252_succeeds (fails 
with "expected length 5, actual 8")
- connectionUtf8_insertMultipleInWin1252_varchar_5_win1252_succeeds 
(fails with "expected length 5, actual 8")
- 
connectionUtf8_insertMultipleInWin1252_lessThanMax_varchar_5_win1252_succeeds 
(fails with "expected length 5, actual 6")
-connectionUtf8_insertMultiByte_char_1_utf8_succeeds (fails with 
"expected length 1, actual 2")
- connectionUtf8_insertMultiple_char_5_utf8_succeeds (fails with 
"expected length 5, actual 8")
- connectionUtf8_insertMultiple_varchar_5_utf8_succeeds (fails with 
"expected length 5, actual 8")
- connectionUtf8_insertMultiple_lessThanMax_varchar_5_utf8_succeeds 
(fails with "expected length 5, actual 6")


For CHAR, it seems to count 1 more character, for VARCHAR 2-3 more 
characters.


Mark
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Incorrect string right truncation errors in Firebird 5

2022-05-16 Thread Mark Rotteveel
I was running some tests against Firebird-5.0.0.494-0_x64 (latest 
snapshot, from last Saturday), and I notice that I get incorrect string 
right truncation errors with CHAR/VARCHAR.


I currently cannot dive deeper into it, but as a datapoint, the error 
does not occur with Firebird-5.0.0.488-0_x64.


Based solely on the commit message, maybe this commit is at fault? 
https://github.com/FirebirdSQL/firebird/commit/dd18a3b11b28c3ed8126a6f54b829989954bfa03


Mark
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel