!3 Upgrade odbc to 13.00
From: @bzhaoop Reviewed-by: @zhengzhenyu Signed-off-by: @zhengzhenyu
This commit is contained in:
commit
68c5836dd9
@ -1,30 +0,0 @@
|
|||||||
Revert "Fix regression test failures in param-convesrions-test."
|
|
||||||
|
|
||||||
As we have applied a downstream patch for reverting the money type patch,
|
|
||||||
we need to also revert upstream test cases that are not supposed to be passing
|
|
||||||
in the first place.
|
|
||||||
This reverts commit eb480e19ee71b19de7f61013bdb4d5abd1cd98e4.
|
|
||||||
|
|
||||||
Related discussion:
|
|
||||||
http://www.postgresql.org/message-id/3259874.lgiBp3an9Y@nb.usersys.redhat.com
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/test/expected/param-conversions.out b/test/expected/param-conversions.out
|
|
||||||
index 777cc94..449a398 100644
|
|
||||||
--- a/test/expected/param-conversions.out
|
|
||||||
+++ b/test/expected/param-conversions.out
|
|
||||||
@@ -72,12 +72,12 @@ Error while executing the query
|
|
||||||
|
|
||||||
Testing "SELECT 1.3 > ?" with SQL_C_CHAR -> SQL_FLOAT param "3', 'injected, BAD!', '1"...
|
|
||||||
SQLExecDirect failed
|
|
||||||
-22P02=ERROR: invalid input syntax for type numeric: "3', 'injected, BAD!', '1";
|
|
||||||
+22P02=ERROR: invalid input syntax for type double precision: "3', 'injected, BAD!', '1";
|
|
||||||
Error while executing the query
|
|
||||||
|
|
||||||
Testing "SELECT 1.4 > ?" with SQL_C_CHAR -> SQL_FLOAT param "4 \'bad', '1"...
|
|
||||||
SQLExecDirect failed
|
|
||||||
-22P02=ERROR: invalid input syntax for type numeric: "4 \'bad', '1";
|
|
||||||
+22P02=ERROR: invalid input syntax for type double precision: "4 \'bad', '1";
|
|
||||||
Error while executing the query
|
|
||||||
|
|
||||||
Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_INTEGER param "-1"...
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
From 56ca20671a9fb87d7c6ca011207e9628349c9301 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pavel Raiskup <praiskup@redhat.com>
|
|
||||||
Date: Mon, 13 Mar 2017 10:38:54 +0100
|
|
||||||
Subject: [PATCH] Revert "Fix the bug about MONEY type."
|
|
||||||
|
|
||||||
This reverts commit d5374bcc4d58556eb5cc70241c44dcad4d9b441e.
|
|
||||||
|
|
||||||
Proposed upstream:
|
|
||||||
http://www.postgresql.org/message-id/3259874.lgiBp3an9Y@nb.usersys.redhat.com
|
|
||||||
---
|
|
||||||
convert.c | 45 ++++++++-------------------------------------
|
|
||||||
pgtypes.c | 4 ++++
|
|
||||||
2 files changed, 12 insertions(+), 37 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/convert.c b/convert.c
|
|
||||||
index f118e30..00904d8 100644
|
|
||||||
--- a/convert.c
|
|
||||||
+++ b/convert.c
|
|
||||||
@@ -5363,50 +5363,21 @@ cleanup:
|
|
||||||
static BOOL
|
|
||||||
convert_money(const char *s, char *sout, size_t soutmax)
|
|
||||||
{
|
|
||||||
- char in, decp = 0;
|
|
||||||
size_t i = 0,
|
|
||||||
out = 0;
|
|
||||||
- int num_in = -1, period_in = -1, comma_in = -1;
|
|
||||||
|
|
||||||
for (i = 0; s[i]; i++)
|
|
||||||
{
|
|
||||||
- switch (in = s[i])
|
|
||||||
+ if (s[i] == '$' || s[i] == ',' || s[i] == ')')
|
|
||||||
+ ; /* skip these characters */
|
|
||||||
+ else
|
|
||||||
{
|
|
||||||
- case '.':
|
|
||||||
- if (period_in < 0)
|
|
||||||
- period_in = i;
|
|
||||||
- break;
|
|
||||||
- case ',':
|
|
||||||
- if (comma_in < 0)
|
|
||||||
- comma_in = i;
|
|
||||||
- break;
|
|
||||||
- default:
|
|
||||||
- if ('0' <= in && '9' >= in)
|
|
||||||
- num_in = i;
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- if (period_in > comma_in)
|
|
||||||
- {
|
|
||||||
- if ( period_in >= num_in - 2)
|
|
||||||
- decp = '.';
|
|
||||||
- }
|
|
||||||
- else if (comma_in >= 0 &&
|
|
||||||
- comma_in >= num_in - 2)
|
|
||||||
- decp = ',';
|
|
||||||
- for (i = 0; s[i] && out + 1 < soutmax; i++)
|
|
||||||
- {
|
|
||||||
- switch (in = s[i])
|
|
||||||
- {
|
|
||||||
- case '(':
|
|
||||||
- case '-':
|
|
||||||
+ if (out + 1 >= soutmax)
|
|
||||||
+ return FALSE; /* sout is too short */
|
|
||||||
+ if (s[i] == '(')
|
|
||||||
sout[out++] = '-';
|
|
||||||
- break;
|
|
||||||
- default:
|
|
||||||
- if (in >= '0' && in <= '9')
|
|
||||||
- sout[out++] = in;
|
|
||||||
- else if (in == decp)
|
|
||||||
- sout[out++] = '.';
|
|
||||||
+ else
|
|
||||||
+ sout[out++] = s[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sout[out] = '\0';
|
|
||||||
diff --git a/pgtypes.c b/pgtypes.c
|
|
||||||
index a58925c..d42179c 100644
|
|
||||||
--- a/pgtypes.c
|
|
||||||
+++ b/pgtypes.c
|
|
||||||
@@ -1273,6 +1273,10 @@ sqltype_to_pgcast(const ConnectionClass *conn, SQLSMALLINT fSqlType)
|
|
||||||
case SQL_DATE:
|
|
||||||
pgCast = "::date";
|
|
||||||
break;
|
|
||||||
+ case SQL_DOUBLE:
|
|
||||||
+ case SQL_FLOAT:
|
|
||||||
+ pgCast = "::float8";
|
|
||||||
+ break;
|
|
||||||
case SQL_DECIMAL:
|
|
||||||
case SQL_NUMERIC:
|
|
||||||
pgCast = "::numeric";
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
||||||
@ -1,15 +1,12 @@
|
|||||||
Name: postgresql-odbc
|
Name: postgresql-odbc
|
||||||
Summary: Official postgreSQL ODBC driver
|
Summary: Official postgreSQL ODBC driver
|
||||||
Version: 10.03.0000
|
Version: 13.00.0000
|
||||||
Release: 4
|
Release: 1
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://odbc.postgresql.org/
|
URL: https://odbc.postgresql.org/
|
||||||
Source0: http://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-%{version}.tar.gz
|
Source0: http://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-%{version}.tar.gz
|
||||||
|
|
||||||
Patch0000: postgresql-odbc-09.06.0200-revert-money-fix.patch
|
BuildRequires: unixODBC-devel postgresql-server-devel postgresql-test-rpm-macros gcc
|
||||||
Patch0001: postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch
|
|
||||||
|
|
||||||
BuildRequires: unixODBC-devel postgresql-devel postgresql-test-rpm-macros gcc
|
|
||||||
Provides: psqlodbc = %version-%release
|
Provides: psqlodbc = %version-%release
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -26,12 +23,14 @@ Obsoletes: %{name}-tests < %{version}-%{release}
|
|||||||
The package contains different files for various tests for postgresql-odbc.
|
The package contains different files for various tests for postgresql-odbc.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n psqlodbc-%{version} -p1
|
%autosetup -n psqlodbc-%{version}
|
||||||
|
|
||||||
echo "The upstream psqlodbc testsuite is distributed in '%{name}-tests'">README.rpmdist
|
echo "The upstream psqlodbc testsuite is distributed in '%{name}-tests'">README.rpmdist
|
||||||
echo "(sub)package.">>README.rpmdist
|
echo "(sub)package.">>README.rpmdist
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
CPPFLAGS="-I%{_includedir}/pgsql/internal/"
|
||||||
|
export CPPFLAGS
|
||||||
%configure --with-unixodbc --disable-dependency-tracking
|
%configure --with-unixodbc --disable-dependency-tracking
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
@ -69,6 +68,9 @@ cd test && %make_build installcheck || {
|
|||||||
%{_libdir}/postgresql-odbc/test
|
%{_libdir}/postgresql-odbc/test
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 28 2021 bzhaoop <bzhaojyathousandy@gmail.com> - 13.00.0000-1
|
||||||
|
- Bump to 13.00.0000 verion
|
||||||
|
|
||||||
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 10.03.0000-4
|
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 10.03.0000-4
|
||||||
- Completing build dependencies
|
- Completing build dependencies
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
psqlodbc-13.00.0000.tar.gz
Normal file
BIN
psqlodbc-13.00.0000.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user