Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
2.2.1
-
None
-
MariaDB 10.1.30, MariaDB JDBC driver 2.2.1, Ubuntu 16.04
Description
When wrong column name is used to retrieve the column value from a table, an SQLException is thrown but the exception contains vendor code 0 and SQL state null though error message is as expected.
You can reproduce the problem using attached JDBC program.
Here is the sample output:
Connected to jdbc:mariadb: ....<removed actual info purposefully>
Dropping test table tbl_getcolbug...
Dropped the test table.
Creating test table tbl_getcolbug(c1 INTEGER)...
Created the test table.
Inserting value 10 into column c1 of test table tbl_getcolbug...
Inserted the value.
Executing SELECT to get value from coolumn c1 of test table tbl_getcolbug...
Executed the SELECT statement...
Retrieving column value using getInt("c1")...
Retrieved value=10
Pass test if retrieved value is 10
Retrieving value from invalid column using getInt("col_xyz")...
**Error**: Vendor code=0,SQL State=null, error message=No such column :col_xyz
Pass test if vendor code != 0 and SQL State != null.