| Bug #33615 | Database combobox not populated correctly when problematic database specified | ||
|---|---|---|---|
| Submitted: | 2 Jan 3:05 | Modified: | 14 Feb 17:39 |
| Reporter: | JJS (Silver Quality Contributor) | ||
| Status: | Closed | ||
| Category: | Connector/ODBC | Severity: | S3 (Non-critical) |
| Version: | 5.1 | OS: | Microsoft Windows (Any) |
| Assigned to: | Lawrin Novitsky | Target Version: | |
| Tags: | qc, database | ||
| Triage: | D3 (Medium) / R1 (None/Negligible) / E2 (Low) | ||
[2 Jan 3:05]
JJS
[2 Jan 9:07]
Tonci Grgin
Hi Jared and thanks for your report. Verified as described with following comments: - c/ODBC 5.0 is *discontinued*, please do not file bugs against it any more - c/ODBC 5.1 truly displays empty list in process of clearing bad input from drop down list. Next click on drop down list shows databases correctly. I don't see a bug here but the behavior probably can be corrected.
[2 Jan 22:56]
Jim Winstead
What is probably happening here is that the setup library is using the entered database name when making a connection to the server to get the list of databases, and failing to authenticate because of the nonexistent database. In mygetdatabases(), we should make sure no database is specified in the DataSource (just set it aside during the Connect call). Also, errors encountered by mygetdatabases() should be handled correctly in the Windows GUI code.
[27 Jan 21:12]
Lawrin Novitsky
Patch for 5.1 - setup dialog doesn't care about selected DB then databases list retrieved
Attachment: bug33615.patch (application/octet-stream, text), 643 bytes.
[28 Jan 23:50]
Jim Winstead
i think that it would be more clear to set aside the whole pointer, not just swap in a \0 as the first character. in my first look at the patch, i assumed the second conditional expression was wrong because i expected the pointer itself to be set/unset.
[29 Jan 13:32]
Lawrin Novitsky
Fixed patch - whole pointer reset/set. Right, it's more simple this way
Attachment: bug33615.patch (application/octet-stream, text), 586 bytes.
[2 Feb 5:42]
Jess Balint
I think we should also add this to preserve any database name that is currently entered.
Index: setupgui/windows/odbcdialogparams.cpp
===================================================================
--- setupgui/windows/odbcdialogparams.cpp (revision 1010)
+++ setupgui/windows/odbcdialogparams.cpp (working copy)
@@ -506,6 +506,8 @@
for (; dbtmp; dbtmp= list_rest(dbtmp))
ComboBox_AddString(hwndCtl, (SQLWCHAR *)dbtmp->data);
list_free(dbs, 1);
+ if (pParams->database)
+ ComboBox_SetText(hwndCtl, pParams->database);
}
}
}
[2 Feb 11:16]
Lawrin Novitsky
That already has been done in patch to auto-complete bug, that is not posted yet.
[7 Feb 8:08]
Lawrin Novitsky
Committed as revision 1020.
[14 Feb 17:39]
MC Brown
A note has been added to the 5.1.2 changelog: Specifying a non-existent database name within the GUI dialog would result in an empty list, not an error.
