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
Warnings are not returned from attachDatabase() call [CORE4162] #4489
Comments
Commented by: @mrotteveel Test + output on Firebird 2.5.2 update 1 and Firebird 3.0 alpha 1 attached |
Modified by: @mrotteveelAttachment: test_output_FB25.txt [ 12355 ] Attachment: test_output_FB30a1.txt [ 12356 ] Attachment: DialectTest.java [ 12357 ] |
Commented by: @aafemt I would say that on FB3 it should be not warning, but error. |
Commented by: @dyemanov It would be interesting to know whether other types of warnings are returned to the client or not. |
Commented by: @mrotteveel I'd love to test that, but I can't quickly think of another action that triggers a warning. Any suggestions? |
Commented by: @AlexPeshkoff For example yo may try to perform 2 attachments to same database in embedded mode, second - with isc_dpb_config paraneter in DPB. Should produce warning |
Commented by: @dyemanov Alex, warnings are lost when copying from tdbb_status_vector to the caller's IStatus. I suspect the guilty routines are fb_utils::statusLength() and fb_utils::copyStatus(). The former has some commented out code related to warnings but its counting looks incorrect at the first glance. The latter needs similar corrections. But maybe something else remains hidden. At least after fixing them I still don't see the warning delivered to the y-valve. |
Modified by: @dyemanovassignee: Alexander Peshkov [ alexpeshkoff ] |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @AlexPeshkoffsummary: Changing dialect through DPB does not return a warning => Warnings are not returned from attachDatabase() call |
Commented by: @AlexPeshkoff The reason was multiple thread contexts (one on top of another). Destructor of inner context places correct status vector to user's IStatus, but after it destructor of outer context was overwriting a warning with it's clean status vector. |
Modified by: @AlexPeshkoffstatus: In Progress [ 3 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 2 [ 10560 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: @mrotteveel Issue occurs again in recent versions (tested in snapshot 3.0.0.31721-0_x64). I haven't tested snapshots recently, so I don't know when this problem was reintroduced. |
Commented by: @mrotteveel Might this be related to this set of changes: https://sourceforge.net/p/firebird/code/61033 ? |
Commented by: @AlexPeshkoff This might be related but in isql I get: # ./isql -z -s 1 employee WARNING: This database speaks SQL dialect 3 but Client SQL dialect was set to 1 . I.e. this seems to be java-specific. # javac DialectTest.java It's |
Commented by: @mrotteveel The example code requires Java 7 or higher as it uses try-with-resources (introduced in Java 7). Instead you could also use the org.firebirdsql.jdbc.TestFBDriver.testWarnings() test in the Jaybird testsuite. However I also tested with the snapshot of this morning and with that version the test passes again, so the problem seems to have been fixed again. To recap: |
Commented by: @AlexPeshkoff There were some postfixes. But: # ./isql -z employee -s 1 WARNING: This database speaks SQL dialect 3 but Client SQL dialect was set to 1 . Anyway - if in current trunk issue is not reproduced I think an issue can be closed. |
Commented by: @mrotteveel Using isql is not a correct reproduction: isql -s 1 doesn't set the dialect of the database, it sets the dialect of the connection. That warning is generated inside isql (see isql.epp line 5798), and not server side. My test uses isc_dpb_set_db_sql_dialect which generates the warning isc_dialect_reset_warning (or 335544802: Database dialect being changed from 3 to 1). But I think this can be closed again. |
Modified by: @dyemanovstatus: Reopened [ 4 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 2 [ 10586 ] Fix Version: 3.0 Alpha 2 [ 10560 ] => |
Commented by: @pavel-zotov One small question has shown up: why message about changing dialect from 3 to 1 appears *only* in 2.1.7 and *only* when we change this attribute using GFIX utility ? Following is simple test: 1) FB 2.1.7, Classic: 1.1) change dialect from 1 to 3 and return it to 1 using GFIX only:
|
Commented by: @AlexPeshkoff What about fbsvcmgr the reason is trivial - it does not check for warnings |
Commented by: @pavel-zotov Sorry for repeating old question, but once again: why message about changing dialect from 3 to 1 appears *only* in 2.1.7 ? @echo off - you will get warning (error ?) only in 2.1. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Deferred Test Details: Waiting for reply on issue 15/Nov/16 07:35 PM. |
Submitted by: @mrotteveel
Attachments:
test_output_FB25.txt
test_output_FB30a1.txt
DialectTest.java
Changing the dialect of a database using the dpb item isc_dpb_set_db_sql_dialect should return a warning ("Database dialect being changed from 3 to 1", error 335544802). This works correctly under Firebird 2.5 and earlier, but with Firebird 3.0 alpha 1 the dialect is changed, but no warning is returned to the client.
Background: the Jaybird test org.firebirdsql.jdbc.FBDriver.testWarnings() uses this to check processing of warnings by the driver.
Commits: f5e0fff FirebirdSQL/fbt-repository@cf45818
====== Test Details ======
Waiting for reply on issue 15/Nov/16 07:35 PM.
The text was updated successfully, but these errors were encountered: