New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid DPB encoding for 2.5 servers [JDBC251] #670
Comments
Commented by: Roman KIslukhin (roman.kisluhin) Patch fixing this issue |
Modified by: Roman KIslukhin (roman.kisluhin)Attachment: dpb_encoding.patch [ 12142 ] |
Commented by: @mrotteveel Could you include a testcase that demonstrates this? As this patch indeed has the potential to break things for earlier Firebird versions, I am hesitant to add it to Jaybird 2.2 at this point. BTW: This is not really a bug in Jaybird, but an improvement to the protocol; this problem has essentially always existed in the Firebird wire protocol. |
Commented by: Roman KIslukhin (roman.kisluhin) Server: Client: Result: |
Modified by: Roman KIslukhin (roman.kisluhin)Attachment: DpbTest.java [ 12144 ] |
Commented by: @mrotteveel Simplified reproduction class. NOTE: Is saved as UTF-8 |
Modified by: @mrotteveelAttachment: ReproduceJDBC251.java [ 12150 ] |
Commented by: @mrotteveel I am not going to take on this patch for Jaybird 2.2. However, I will include isc_dpb_utf8_filename in ISCConstants. This way you can include utf8_filename=1 in the JDBC url (or add property utf8_filename with value 1) to get the desired behaviour with manually setting file.encoding=UTF-8 on the commandline. For the database filename you can add the property filename_charset=<java charset> to the JDBCurl as well. I will see if it is wise and easy to use this same property for other (string) DPB elements. |
Commented by: @mrotteveel Need to take this into consideration when extending wire protocol support in Jaybird 2.3 |
Modified by: @mrotteveelFix Version: Jaybird 2.3 [ 10440 ] |
Modified by: @mrotteveelassignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ] |
Commented by: @mrotteveel Implemented in the new wire protocol for Jaybird 3.0. I am not sure yet about the impact on the native client wrapper. |
Modified by: @mrotteveel |
Modified by: @mrotteveelstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Roman KIslukhin (roman.kisluhin)
Jira_subtask_outward JDBC253
Is duplicated by JDBC149
Attachments:
dpb_encoding.patch
DpbTest.java
ReproduceJDBC251.java
Since firebird 2.5 server receives dpb parameters in differents way for windows and linux os: on windows it converts string parameters from system encoding to utf8 (if isc_dpb_utf8_filename parameter is not set).
It's wrong If encodings on client and server are distinct (e.g. client on linux but server on windows etc.).
With Firebird 2.5 new MON$ field encodings, incorrect encoding for e.g. process name leads to conversion errors when trying to access mon$attachments table.
In Jaybird all string parameters in database parameter buffer are passed to fb in java encoding (e.g. UTF8 or Cp1251 - depend on file.encoding system parameter).
See code in ParameterBufferBase.StringArgument#writeTo():
final byte[] valueBytes = this.value.getBytes();
We suggest fix it to pass all dpb parameters in UTF8 and use isc_dpb_utf8_filename parameter.
This may affect backwards compatibility with 2.1 servers, if non-ASCII file names are used.
Commits: 8f6cd13
The text was updated successfully, but these errors were encountered: