Description of problem: SQLBulkOperations function is broken in postgresql-odbc-09.01.0200-4.fc20.x86_64 postgresql-odbc emulates bulk insert by building a SQL insert statement and performing row-wise insert. postgresql-odbc-09.01.0200-4.fc20.x86_64 cannot build the SQL insert statement correctly due to programming errors. Version-Release number of selected component (if applicable): postgresql-odbc-09.01.0200-4.fc20.x86_64 How reproducible: Always. Actual results: [140486749001856]**** PGAPI_AllocStmt: hdbc = 0x202f740, stmt = 0x2048450 [140486749001856]CC_add_statement: self=0x202f740, stmt=0x2048450 [140486749001856]extend_iparameter_bindings: entering ... self=0x2048668, parameters_allocated=0, num_params=3 [140486749001856]exit extend_iparameter_bindings=0x2048820 [140486749001856]0 used=4 [140486749001856]PGAPI_BindParameter: entering... [140486749001856]extend_parameter_bindings: entering ... self=0x20485f8, parameters_allocated=0, num_params=1,(nil) [140486749001856]exit extend_parameter_bindings=0x2048890 [140486749001856]extend_putdata_info: entering ... self=0x2048730, parameters_allocated=0, num_params=1 [140486749001856]exit extend_putdata_info=0x2038d40 [140486749001856]PGAPI_BindParameter: ipar=0, paramType=1, fCType=-16, fSqlType=4, cbColDef=10, ibScale=0,[140486749001856]rgbValue=0x2048b80(0), pcbValue=0x2049390 [140486749001856]1 used=-3 [140486749001856]getCharColumnSizeX: type=1043, atttypmod=128, adtsize_or=0, unknown = -1 [140486749001856]PGAPI_BindParameter: entering... [140486749001856]extend_parameter_bindings: entering ... self=0x20485f8, parameters_allocated=1, num_params=2,0x2048890 [140486749001856]exit extend_parameter_bindings=0x2048890 [140486749001856]extend_putdata_info: entering ... self=0x2048730, parameters_allocated=1, num_params=2 [140486749001856]exit extend_putdata_info=0x204f500 [140486749001856]PGAPI_BindParameter: ipar=1, paramType=1, fCType=1, fSqlType=12, cbColDef=128, ibScale=-1,[140486749001856]rgbValue=0x2075da0(256), pcbValue=0x204a040 [140486749001856]2 used=-3 [140486749001856]getCharColumnSizeX: type=1043, atttypmod=32, adtsize_or=0, unknown = -1 [140486749001856]PGAPI_BindParameter: entering... [140486749001856]extend_parameter_bindings: entering ... self=0x20485f8, parameters_allocated=2, num_params=3,0x2048890 [140486749001856]exit extend_parameter_bindings=0x2048890 [140486749001856]extend_putdata_info: entering ... self=0x2048730, parameters_allocated=2, num_params=3 [140486749001856]exit extend_putdata_info=0x204f500 [140486749001856]PGAPI_BindParameter: ipar=2, paramType=1, fCType=1, fSqlType=12, cbColDef=32, ibScale=-1,[140486749001856]rgbValue=0x7fc59e9a7010(256), pcbValue=0x204acf0 [140486749001856]addstr=) values (?, ?, ?) returning ctid <--------- !!!HERE!!! [140486749001856]PGAPI_ExecDirect: entering...0 [140486749001856]SC_recycle_statement: self= 0x2048450 Expected results: [140657122736256]**** PGAPI_AllocStmt: hdbc = 0x1873e70, stmt = 0x188a1c0 [140657122736256]CC_add_statement: self=0x1873e70, stmt=0x188a1c0 [140657122736256]extend_iparameter_bindings: entering ... self=0x188a3f0, parameters_allocated=0, num_params=3 [140657122736256]exit extend_iparameter_bindings=0x188a5b0 [140657122736256]0 used=4 [140657122736256]PGAPI_BindParameter: entering... [140657122736256]extend_parameter_bindings: entering ... self=0x188a380, parameters_allocated=0, num_params=1,(nil) [140657122736256]exit extend_parameter_bindings=0x188a620 [140657122736256]extend_putdata_info: entering ... self=0x188a4d8, parameters_allocated=0, num_params=1 [140657122736256]exit extend_putdata_info=0x1879f80 [140657122736256]PGAPI_BindParameter: ipar=0, paramType=1, fCType=-16, fSqlType=4, cbColDef=10, ibScale=0,[140657122736256]rgbValue=0x188a8f0(0), pcbValue=0x188b100 [140657122736256]1 used=-3 [140657122736256]getCharColumnSizeX: type=1043, atttypmod=128, adtsize_or=0, unknown = -1 [140657122736256]PGAPI_BindParameter: entering... [140657122736256]extend_parameter_bindings: entering ... self=0x188a380, parameters_allocated=1, num_params=2,0x188a620 [140657122736256]exit extend_parameter_bindings=0x188a620 [140657122736256]extend_putdata_info: entering ... self=0x188a4d8, parameters_allocated=1, num_params=2 [140657122736256]exit extend_putdata_info=0x18911d0 [140657122736256]PGAPI_BindParameter: ipar=1, paramType=1, fCType=1, fSqlType=12, cbColDef=128, ibScale=-1,[140657122736256]rgbValue=0x7fed49ac8010(256), pcbValue=0x188bdb0 [140657122736256]2 used=-3 [140657122736256]getCharColumnSizeX: type=1043, atttypmod=32, adtsize_or=0, unknown = -1 [140657122736256]PGAPI_BindParameter: entering... [140657122736256]extend_parameter_bindings: entering ... self=0x188a380, parameters_allocated=2, num_params=3,0x188a620 [140657122736256]exit extend_parameter_bindings=0x188a620 [140657122736256]extend_putdata_info: entering ... self=0x188a4d8, parameters_allocated=2, num_params=3 [140657122736256]exit extend_putdata_info=0x18911d0 [140657122736256]PGAPI_BindParameter: ipar=2, paramType=1, fCType=1, fSqlType=12, cbColDef=32, ibScale=-1,[140657122736256]rgbValue=0x7fed49456010(256), pcbValue=0x188ca60 [140657122736256]addstr=insert into "public"."tags" ("id", "name", "type") values (?, ?, ?) returning ctid <--------- !!!HERE!!! [140657122736256]PGAPI_ExecDirect: entering...0 [140657122736256]SC_recycle_statement: self= 0x188a1c0 Additional info: This bug is fixed upstream one year ago by commit a135875d7085dd872033a6d86905db2a411943f5. See http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;f=results.c;h=a135875d7085dd872033a6d86905db2a411943f5
Thanks for the report. I tried to backport that patch to 09.01.0200, however due to #include loops, it requires additional changes, concretely the easiest is something like the following (which is not very elegant): --- a/misc.h +++ b/misc.h @@ -144,6 +144,8 @@ char *schema_strcat1(char *........ int snprintf_add(char *buf, size_t si........ size_t snprintf_len(char *buf, size_t si........ /* #define GET_SCHEMA_NAME(nspname) (stricmp(........ + +#include "descriptor.h" char *quote_table(const pgNAME schema, pgNAME table); #define GET_SCHEMA_NAME(nspname) (nspname) That changes the include hierarchy however. After spending some time on backporting trying to find cleaner solution, I think it is not worth working on it more because rebasing of postgresql-odbc to postgresql-odbc-09.03.0300 should be pretty safe. Maxim, would you agree with this resolution? Others listening this channel? Pavel
Hi Pavel, I agree that it may be much easier to just upgrade/rebase to a newer version of the driver rather than backport changes. Maxim
I'll rebase f20+ to 09.03.0400. This package does not carry a soname library, just a plugin (connector to PostgreSQL) for unixODBC. PostgreSQL and unixODBC have the same stable versions in f20, f21 and f22.
postgresql-odbc-09.03.0400-2.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/postgresql-odbc-09.03.0400-2.fc20
postgresql-odbc-09.03.0400-2.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/postgresql-odbc-09.03.0400-2.fc21
You may try the 'postgresql-odbc-tests' subpackage for regression testing.
postgresql-odbc-09.03.0400-3.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/postgresql-odbc-09.03.0400-3.fc21
postgresql-odbc-09.03.0400-3.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/postgresql-odbc-09.03.0400-3.fc20
Package postgresql-odbc-09.03.0400-3.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing postgresql-odbc-09.03.0400-3.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-15424/postgresql-odbc-09.03.0400-3.fc21 then log in and leave karma (feedback).
postgresql-odbc-09.03.0400-3.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
postgresql-odbc-09.03.0400-3.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.