You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am getting field type: char(12) character set NONE, connection character set is UTF8 or UNICODE_FSS, and I fetching value by rs.getString(1), I'm receiving only 3 or 4 chars (3 for UTF8, 4 for UNICODE). Returning value is 12 character length. When I use rs.getBytes(1) , I'm receiving whole 12 chars.
I tested it for FB 2.0 and FB 2.5.
2) SQL code:
create or alter procedure TMP_BUG_GET_CHAR_BY_ASSTRING
returns (
OUT char(12) character set NONE)
as
begin
--
out='001000000001';
suspend;
out='111111111111';
suspend;
out='000000000000';
suspend;
out='101010101010';
suspend;
--
end;
The GDS API is going to be removed in Jaybird 3. You can obtain the information from the databasemetadata object. For the ODS version you need to unwrap or cast to FirebirdDatabaseMetaData. It looks like the dialect is missing from this info. I will check if I make this available in the new API in Jaybird 3.
Submitted by: Tomasz Kujalow (tkujalow)
When I am getting field type: char(12) character set NONE, connection character set is UTF8 or UNICODE_FSS, and I fetching value by rs.getString(1), I'm receiving only 3 or 4 chars (3 for UTF8, 4 for UNICODE). Returning value is 12 character length. When I use rs.getBytes(1) , I'm receiving whole 12 chars.
I tested it for FB 2.0 and FB 2.5.
My program which show this problem:
1) Output:
Version: 2.2
ODS: 11.0
Dialect: 3
Firebird: Firebird 2.09LI LI-V2.0.7.13318
Encoding: UNICODE_FSS
rs.getString(1) returns: _|0010|_
rs.getBytes(1) returns: _|001000000001|_
rs.getString(1) returns: _|1111|_
rs.getBytes(1) returns: _|111111111111|_
rs.getString(1) returns: _|0000|_
rs.getBytes(1) returns: _|000000000000|_
rs.getString(1) returns: _|1010|_
rs.getBytes(1) returns: _|101010101010|_
Encoding: UTF8
rs.getString(1) returns: _|001|_
rs.getBytes(1) returns: _|001000000001|_
rs.getString(1) returns: _|111|_
rs.getBytes(1) returns: _|111111111111|_
rs.getString(1) returns: _|000|_
rs.getBytes(1) returns: _|000000000000|_
rs.getString(1) returns: _|101|_
rs.getBytes(1) returns: _|101010101010|_
Encoding: ASCII
rs.getString(1) returns: _|001000000001|_
rs.getBytes(1) returns: _|001000000001|_
rs.getString(1) returns: _|111111111111|_
rs.getBytes(1) returns: _|111111111111|_
rs.getString(1) returns: _|000000000000|_
rs.getBytes(1) returns: _|000000000000|_
rs.getString(1) returns: _|101010101010|_
rs.getBytes(1) returns: _|101010101010|_
Encoding: NONE
rs.getString(1) returns: _|001000000001|_
rs.getBytes(1) returns: _|001000000001|_
rs.getString(1) returns: _|111111111111|_
rs.getBytes(1) returns: _|111111111111|_
rs.getString(1) returns: _|000000000000|_
rs.getBytes(1) returns: _|000000000000|_
rs.getString(1) returns: _|101010101010|_
rs.getBytes(1) returns: _|101010101010|_
Encoding: WIN1250
rs.getString(1) returns: _|001000000001|_
rs.getBytes(1) returns: _|001000000001|_
rs.getString(1) returns: _|111111111111|_
rs.getBytes(1) returns: _|111111111111|_
rs.getString(1) returns: _|000000000000|_
rs.getBytes(1) returns: _|000000000000|_
rs.getString(1) returns: _|101010101010|_
rs.getBytes(1) returns: _|101010101010|_
2) SQL code:
create or alter procedure TMP_BUG_GET_CHAR_BY_ASSTRING
returns (
OUT char(12) character set NONE)
as
begin
--
out='001000000001';
suspend;
out='111111111111';
suspend;
out='000000000000';
suspend;
out='101010101010';
suspend;
--
end;
3) Application:
import org.firebirdsql.gds.DatabaseParameterBuffer;
import org.firebirdsql.gds.GDS;
import org.firebirdsql.gds.GDSException;
import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.IscDbHandle;
import org.firebirdsql.gds.impl.GDSFactory;
public class FirebirdBugTest {
private static GDS gds=null;
private static String dbAddr="10.100.2.20/3050:/DATA/FIREBIRD/test_database.gdb";
private static String dbPass="masterkey";
public static void main(String[] args) {
}
The text was updated successfully, but these errors were encountered: