Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1
-
None
-
All
-
0d1481b4d26997bab9ab9a6200776b27b9826ba6
Description
This bug is simple to reproduce in all Qt4 and Qt5 versions.
Create a table with a column that has a default value set:
CREATE TABLE colors (
color varchar DEFAULT 'green'
);
Then use
QSqlRecord r = QSqlDatabase::record("colors")
to request an empty record. The default value in r.field("color").defaultValue() should be "green", but it is
"green':character varyin".
This is due to a bug in the Qt postgres plugin that extracts the
default value.
A test program is attached in qtbug.tgz. Additionally I added a simple patch
that fixes the bug. The patch was generated against Qt 5.2.1.