diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/armadillo-2-nocmakeconfigfiles.patch | 14 | ||||
-rw-r--r-- | src/armadillo.mk | 2 | ||||
-rw-r--r-- | src/dbus-1-fixes.patch | 34 | ||||
-rw-r--r-- | src/dbus.mk | 5 | ||||
-rw-r--r-- | src/ftgl-1-gl-m4.patch | 3 | ||||
-rw-r--r-- | src/ftgl-2-obsolete-am-header.patch | 15 | ||||
-rw-r--r-- | src/glib-1-fixes.patch | 94 | ||||
-rw-r--r-- | src/hdf4.mk | 3 | ||||
-rw-r--r-- | src/libevent-1-fixes.patch | 49 | ||||
-rw-r--r-- | src/openscenegraph.mk | 12 | ||||
-rw-r--r-- | src/qtbase-1-cherrypicks.patch | 206 |
11 files changed, 354 insertions, 83 deletions
diff --git a/src/armadillo-2-nocmakeconfigfiles.patch b/src/armadillo-2-nocmakeconfigfiles.patch new file mode 100644 index 0000000..08c6ad6 --- /dev/null +++ b/src/armadillo-2-nocmakeconfigfiles.patch @@ -0,0 +1,14 @@ +This file is part of MXE. +See index.html for further information. + +--- armadillo-3.800.2/CMakeLists.txt.patched 2013-04-22 17:15:39.000000000 +0200 ++++ armadillo-3.800.2/CMakeLists.txt 2013-04-22 17:31:43.000000000 +0200 +@@ -363,7 +363,7 @@ + + # Export the package for use from the build-tree + # (this registers the build-tree with a global CMake-registry) +-if(CMAKE_VERSION VERSION_GREATER "2.7") ++if(CMAKE_VERSION VERSION_GREATER "2.7" AND NOT (MINGW AND CMAKE_TOOLCHAIN_FILE)) + export(PACKAGE armadillo) + endif() + diff --git a/src/armadillo.mk b/src/armadillo.mk index fe0030a..6fb2c45 100644 --- a/src/armadillo.mk +++ b/src/armadillo.mk @@ -16,7 +16,7 @@ define $(PKG)_UPDATE head -1 endef -define $(PKG)_BUILD_DISABLED +define $(PKG)_BUILD cd '$(1)' && cmake . -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 diff --git a/src/dbus-1-fixes.patch b/src/dbus-1-fixes.patch deleted file mode 100644 index 602f169..0000000 --- a/src/dbus-1-fixes.patch +++ /dev/null @@ -1,34 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -Contains ad hoc patches for cross building. - -From d7bc1aff67132c09d154999c282e1b391bbe7a39 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Fri, 23 Sep 2011 16:24:46 +0200 -Subject: [PATCH 1/1] add missing MemoryBarrier (MXE specific) - -Windows API has this, but it's not in MinGW. -See http://lists-archives.org/mingw-users/15935-missing-definition-of-memorybarrier.html - -diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c -index b492b09..082225f 100644 ---- a/dbus/dbus-sysdeps-win.c -+++ b/dbus/dbus-sysdeps-win.c -@@ -55,6 +55,13 @@ - #include <ws2tcpip.h> - #include <wincrypt.h> - -+__CRT_INLINE VOID MemoryBarrier(VOID) -+{ -+ LONG Barrier = 0; -+ __asm__ __volatile__("xchgl %%eax,%0 " -+ :"=r" (Barrier)); -+} -+ - /* Declarations missing in mingw's headers */ - extern BOOL WINAPI ConvertStringSidToSidA (LPCSTR StringSid, PSID *Sid); - extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid); --- -1.7.6.3 - diff --git a/src/dbus.mk b/src/dbus.mk index cd8fa82..3ae2824 100644 --- a/src/dbus.mk +++ b/src/dbus.mk @@ -3,7 +3,7 @@ PKG := dbus $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 676ba5211d85f5273ff5748e72e3b48b5104e7ea +$(PKG)_CHECKSUM := 6e1828dded661183cd5e852d2f50d1e45c23dcff $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(PKG).freedesktop.org/releases/$(PKG)/$($(PKG)_FILE) @@ -28,6 +28,7 @@ define $(PKG)_BUILD --disable-shared \ --disable-maintainer-mode \ --enable-static \ - --disable-silent-rules + --disable-silent-rules \ + CFLAGS='-DPROCESS_QUERY_LIMITED_INFORMATION=0x1000' $(MAKE) -C '$(1)' -j '$(JOBS)' install endef diff --git a/src/ftgl-1-gl-m4.patch b/src/ftgl-1-gl-m4.patch index 118a862..ba74df5 100644 --- a/src/ftgl-1-gl-m4.patch +++ b/src/ftgl-1-gl-m4.patch @@ -1,3 +1,6 @@ +This file is part of MXE. +See index.html for further information. + --- ftgl-2.1.3~rc5/m4/gl.m4 2008-05-05 16:48:57.000000000 +0200 +++ ftgl-2.1.3~rc5/m4/gl.m4.new 2010-09-20 14:55:27.000000000 +0200 @@ -63,6 +63,8 @@ diff --git a/src/ftgl-2-obsolete-am-header.patch b/src/ftgl-2-obsolete-am-header.patch new file mode 100644 index 0000000..5154066 --- /dev/null +++ b/src/ftgl-2-obsolete-am-header.patch @@ -0,0 +1,15 @@ +This file is part of MXE. +See index.html for further information. + +diff -ur ftgl-2.1.3~rc5.orig/configure.ac ftgl-2.1.3~rc5/configure.ac +--- ftgl-2.1.3~rc5.orig/configure.ac 2013-04-25 16:57:09.000000000 +1000 ++++ ftgl-2.1.3~rc5/configure.ac 2013-04-25 16:57:29.000000000 +1000 +@@ -6,7 +6,7 @@ + AC_CONFIG_SRCDIR(src/FTPoint.cpp) + AC_CONFIG_AUX_DIR(.auto) + AM_INIT_AUTOMAKE([1.6 no-define dist-zip dist-bzip2]) +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + + FTGL_PROG_CXX + diff --git a/src/glib-1-fixes.patch b/src/glib-1-fixes.patch index b6e395c..8940b6d 100644 --- a/src/glib-1-fixes.patch +++ b/src/glib-1-fixes.patch @@ -3,14 +3,14 @@ See index.html for further information. Contains ad hoc patches for cross building. -From eacb3702acc44de8e5a3c9a324cb9a81333e3737 Mon Sep 17 00:00:00 2001 -From: "a@mxe.cc" <a@mxe.cc> +From 55d5dab8f12c55064b48da8a4a42bfe8fa97f8f9 Mon Sep 17 00:00:00 2001 +From: MXE Date: Thu, 23 Sep 2010 21:41:51 +0200 -Subject: [PATCH 1/8] optional gettext +Subject: [PATCH 1/9] optional gettext diff --git a/configure.ac b/configure.ac -index 054485f..9321fbc 100644 +index ac9ca88..662fd1d 100644 --- a/configure.ac +++ b/configure.ac @@ -482,8 +482,8 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) @@ -42,13 +42,13 @@ index c710046..269bfdf 100644 #define _(String) gettext (String) -- -1.7.10.4 +1.8.2.1 -From c88a15fbac3076f772894ebcd2003786b37603d4 Mon Sep 17 00:00:00 2001 -From: "a@mxe.cc" <a@mxe.cc> +From 4dee17aeb7c45a84a44e3fe2dcca4d8bfd1916a3 Mon Sep 17 00:00:00 2001 +From: MXE Date: Thu, 23 Sep 2010 21:42:46 +0200 -Subject: [PATCH 2/8] fix tool paths +Subject: [PATCH 2/9] fix tool paths diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in @@ -69,13 +69,13 @@ index 4a8898e..5164bae 100644 Name: GLib Description: C Utility Library -- -1.7.10.4 +1.8.2.1 -From fdf03eb9fff0532fa6dea660a5665242f6ccac9e Mon Sep 17 00:00:00 2001 -From: Hans Petter Jansson <hpj@cl.no> +From 981260cfec055fbd58986d9e1b7ef27cdc036e30 Mon Sep 17 00:00:00 2001 +From: MXE Date: Fri, 15 Jun 2012 15:25:01 +0200 -Subject: [PATCH 3/8] Avoid DllMain symbol conflict when linking statically +Subject: [PATCH 3/9] Avoid DllMain symbol conflict when linking statically diff --git a/gio/giomodule.c b/gio/giomodule.c @@ -121,17 +121,17 @@ index f4edd5c..02bf678 100644 switch (fdwReason) { -- -1.7.10.4 +1.8.2.1 -From 64c337b9654441cc1b90ed3ac86f928073ec208e Mon Sep 17 00:00:00 2001 -From: Hans Petter Jansson <hpj@cl.no> +From 1b51f3ef3e38d5db3c15cde0fe4429dab1f7a6d0 Mon Sep 17 00:00:00 2001 +From: MXE Date: Fri, 15 Jun 2012 15:27:22 +0200 -Subject: [PATCH 4/8] Allow building without inotify support +Subject: [PATCH 4/9] Allow building without inotify support diff --git a/configure.ac b/configure.ac -index 9321fbc..5c6bb3e 100644 +index 662fd1d..b0c9fe7 100644 --- a/configure.ac +++ b/configure.ac @@ -1712,11 +1712,18 @@ dnl ***************************** @@ -157,18 +157,18 @@ index 9321fbc..5c6bb3e 100644 AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"]) -- -1.7.10.4 +1.8.2.1 -From c80c435bd8d92857eeb54273024ca8782fa089c6 Mon Sep 17 00:00:00 2001 -From: Hans Petter Jansson <hpj@cl.no> +From 5ec5d101cb75c096f39228da85d2caba52b9002f Mon Sep 17 00:00:00 2001 +From: MXE Date: Fri, 15 Jun 2012 15:28:14 +0200 -Subject: [PATCH 5/8] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF. +Subject: [PATCH 5/9] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF. Backported from upstream diff --git a/configure.ac b/configure.ac -index 5c6bb3e..8754c21 100644 +index b0c9fe7..923a5dd 100644 --- a/configure.ac +++ b/configure.ac @@ -455,6 +455,8 @@ fi @@ -181,13 +181,13 @@ index 5c6bb3e..8754c21 100644 dnl dnl zlib support -- -1.7.10.4 +1.8.2.1 -From e7e2c1c881813a2a17bfec7b63c673eb979b3833 Mon Sep 17 00:00:00 2001 -From: Hans Petter Jansson <hpj@cl.no> +From d5c7bf3b57ced0c6dfb416cf7b439fba210d2a8b Mon Sep 17 00:00:00 2001 +From: MXE Date: Fri, 15 Jun 2012 15:29:06 +0200 -Subject: [PATCH 6/8] Link with dnsapi +Subject: [PATCH 6/9] Link with dnsapi diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in @@ -203,13 +203,13 @@ index 9f7123f..b0d5779 100644 Libs.private: @ZLIB_LIBS@ @NETWORK_LIBS@ Cflags: -- -1.7.10.4 +1.8.2.1 -From c1f83b6ae587c99fefd482d0b1bfbe1d962320d4 Mon Sep 17 00:00:00 2001 -From: Hans Petter Jansson <hpj@cl.no> +From e0338b4fdd95e8273c84ba1daeea660c589d152a Mon Sep 17 00:00:00 2001 +From: MXE Date: Fri, 15 Jun 2012 15:29:38 +0200 -Subject: [PATCH 7/8] Ensure globals are initialized even when DllMain is not +Subject: [PATCH 7/9] Ensure globals are initialized even when DllMain is not being run @@ -583,13 +583,13 @@ index 5a9ac97..e4d1d48 100644 g_thread_xp_init (); -- -1.7.10.4 +1.8.2.1 -From f7b3f3f390131d41855da11622eb18870aec0731 Mon Sep 17 00:00:00 2001 -From: Mark Brand <mabrand@mabrand.nl> +From ce0f7354ac995f3b21cccabec880413d37f02fb6 Mon Sep 17 00:00:00 2001 +From: MXE Date: Mon, 18 Jun 2012 16:02:12 +0200 -Subject: [PATCH 8/8] kill docs and gtk-doc dependence (mxe-specific) +Subject: [PATCH 8/9] kill docs and gtk-doc dependence (mxe-specific) diff --git a/Makefile.am b/Makefile.am @@ -639,7 +639,7 @@ index 4bbc00d..bc0ab0b 100755 if test -z $AUTORECONF; then echo "*** No autoreconf found, please install it ***" diff --git a/configure.ac b/configure.ac -index 8754c21..4936f3c 100644 +index 923a5dd..661635c 100644 --- a/configure.ac +++ b/configure.ac @@ -2605,13 +2605,6 @@ AS_IF([ test $cross_compiling = yes && test x$enable_modular_tests = xyes], [ @@ -1185,5 +1185,27 @@ index 48d88f8..0000000 -gobject-docs-clean: clean - cd $(srcdir) && rm -rf xml html -- -1.7.10.4 +1.8.2.1 + + +From 71740fc6c7f38c025207b9d98bf78a3c570411c6 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Wed, 24 Apr 2013 15:09:13 +1000 +Subject: [PATCH 9/9] remove obsolete AM_PROG_CC_STDC + + +diff --git a/configure.ac b/configure.ac +index 661635c..d5557f7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -291,7 +291,6 @@ AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=) + AM_CONDITIONAL(HAVE_CXX, [test "$CXX" != ""]) + AC_LANG_RESTORE + +-AM_PROG_CC_STDC + AM_PROG_CC_C_O + AC_PROG_INSTALL + +-- +1.8.2.1 diff --git a/src/hdf4.mk b/src/hdf4.mk index 4b37b63..a03ff2f 100644 --- a/src/hdf4.mk +++ b/src/hdf4.mk @@ -18,7 +18,8 @@ endef define $(PKG)_BUILD cd '$(1)' && $(LIBTOOLIZE) --force - cd '$(1)' && autoreconf && ./configure \ + cd '$(1)' && autoreconf --install + cd '$(1)' && ./configure \ --host='$(TARGET)' \ --build="`config.guess`" \ --disable-shared \ diff --git a/src/libevent-1-fixes.patch b/src/libevent-1-fixes.patch new file mode 100644 index 0000000..97452f6 --- /dev/null +++ b/src/libevent-1-fixes.patch @@ -0,0 +1,49 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From cf3aef0903fef54aa0ae4bdf997c4bafb7128bb5 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Thu, 25 Apr 2013 18:17:52 +1000 +Subject: [PATCH 1/2] fix obsolete AM_CONFIG_HEADER + + +diff --git a/configure.in b/configure.in +index 18165f3..524d343 100644 +--- a/configure.in ++++ b/configure.in +@@ -12,7 +12,7 @@ AC_INIT(event.c) + AC_CONFIG_MACRO_DIR([m4]) + + AM_INIT_AUTOMAKE(libevent,2.0.21-stable) +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + AC_DEFINE(NUMERIC_VERSION, 0x02001500, [Numeric representation of the version]) + + dnl Initialize prefix. +-- +1.8.2.1 + + +From 9b22ff6236276fc5d8fd0c4ead9841b6b49b02c8 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Thu, 25 Apr 2013 19:02:55 +1000 +Subject: [PATCH 2/2] remove broken test specification + + +diff --git a/test/Makefile.am b/test/Makefile.am +index b10c41a..86cad83 100644 +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -19,7 +19,6 @@ endif + EXTRA_PROGRAMS = regress + noinst_HEADERS = tinytest.h tinytest_macros.h regress.h tinytest_local.h + +-TESTS = $(top_srcdir)/test/test.sh + + BUILT_SOURCES = + if BUILD_REGRESS +-- +1.8.2.1 + diff --git a/src/openscenegraph.mk b/src/openscenegraph.mk index df35861..f1315ed 100644 --- a/src/openscenegraph.mk +++ b/src/openscenegraph.mk @@ -3,15 +3,15 @@ PKG := openscenegraph $(PKG)_IGNORE := -$(PKG)_CHECKSUM := e0768e7026be239e1089f65ee0655bdda8b5949f -$(PKG)_SUBDIR := openscenegraph-osg-$($(PKG)_VERSION) -$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz -$(PKG)_URL := https://github.com/$(PKG)/osg/tarball/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_CHECKSUM := e1b80206572d681fe624b4c8076674aa5efd6b29 +$(PKG)_SUBDIR := OpenSceneGraph-$($(PKG)_VERSION) +$(PKG)_FILE := OpenSceneGraph-$($(PKG)_VERSION).zip +$(PKG)_URL := http://www.openscenegraph.org/downloads/developer_releases/$($(PKG)_FILE) $(PKG)_DEPS := gcc boost curl dcmtk ffmpeg freetype gdal giflib gta jasper jpeg libpng openal openexr poppler qt tiff xine-lib zlib define $(PKG)_UPDATE - $(WGET) -q -O- 'https://github.com/$(PKG)/osg/commits/master' | \ - $(SED) -n 's#.*<span class="sha">\([^<]\{7\}\)[^<]\{3\}<.*#\1#p' | \ + $(WGET) -q -O- 'http://www.openscenegraph.org/downloads/developer_releases/?C=M;O=D' | \ + $(SED) -n 's,.*OpenSceneGraph-\([0-9][^<]*\)\.zip.*,\1,p' | \ head -1 endef diff --git a/src/qtbase-1-cherrypicks.patch b/src/qtbase-1-cherrypicks.patch index db6afd3..93bcb06 100644 --- a/src/qtbase-1-cherrypicks.patch +++ b/src/qtbase-1-cherrypicks.patch @@ -4,7 +4,7 @@ See index.html for further information. From d04c8e88266737b6fb7ed29780905b54ee68eb5e Mon Sep 17 00:00:00 2001 From: Mark Brand <mabrand@mabrand.nl> Date: Tue, 26 Feb 2013 13:23:33 +0100 -Subject: [PATCH 1/3] use pkg-config for freetype +Subject: [PATCH 1/7] use pkg-config for freetype Change-Id: Id2f78ed9dbdcacd570eb25982cbd700d0437542a @@ -27,7 +27,7 @@ index 6b5f6d0..d21f4e3 100644 From b96f92ed207c7039d753e0ba8fffda4d676c3f38 Mon Sep 17 00:00:00 2001 From: Mark Brand <mabrand@mabrand.nl> Date: Sat, 22 Dec 2012 17:45:34 +0100 -Subject: [PATCH 2/3] WIP: qmake writeFile(): work around concurrent +Subject: [PATCH 2/7] WIP: qmake writeFile(): work around concurrent QDir::mkpath() failure This actually happened when building qtimageformats with make -j4. @@ -68,7 +68,7 @@ index f46d66b..4632cf7 100644 From 63f1f49850ac741eb604d6cae959546d73ea9a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20E=2E=20Narv=C3=A1ez?= <david.narvaez@computer.org> Date: Sat, 23 Feb 2013 23:14:50 -0500 -Subject: [PATCH 3/3] Rename qAbs Function for timeval +Subject: [PATCH 3/7] Rename qAbs Function for timeval This decouples it from qAbs which is declared as a constexpr under certain compilation flags and enables for qtbase to be compiled with @@ -104,3 +104,203 @@ index 0eee425..7a29247 100644 -- 1.8.1.4 + +From 1b78b16a6544a5002ce2dbc10c87c6195d7a0a01 Mon Sep 17 00:00:00 2001 +From: Israel Lins <israelins85@yahoo.com.br> +Date: Mon, 11 Feb 2013 16:13:24 -0300 +Subject: [PATCH 4/7] ODBC: fix loss of milliseconds when binding QDateTime + +Caused by operator precedence error. + +Follow-up to commit b8b79a0f37ec74fd5b4ad829e522a384ba3622ae + +Task-number: QTBUG-2192 +Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219 +Reviewed-by: Mark Brand <mabrand@mabrand.nl> +(cherry picked from commit 36b6d4afc970a328cced87af3d39b70d327eb3ad) + +diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp +index 9517d95..5fa4779 100644 +--- a/src/sql/drivers/odbc/qsql_odbc.cpp ++++ b/src/sql/drivers/odbc/qsql_odbc.cpp +@@ -1407,7 +1407,7 @@ bool QODBCResult::exec() + + // (How many leading digits do we want to keep? With SQL Server 2005, this should be 3: 123000000) + int keep = (int)qPow(10.0, 9 - qMin(9, precision)); +- dt->fraction /= keep * keep; ++ dt->fraction = (dt->fraction / keep) * keep; + } + + r = SQLBindParameter(d->hStmt, +diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +index 1d2a605..951d6d7 100644 +--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp ++++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +@@ -3419,14 +3419,19 @@ void tst_QSqlQuery::QTBUG_2192() + QSqlQuery q(db); + QVERIFY_SQL(q, exec(QString("CREATE TABLE " + tableName + " (dt %1)").arg(tst_Databases::dateTimeTypeName(db)))); + ++ QDateTime dt = QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999)); + QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (dt) VALUES (?)")); +- q.bindValue(0, QVariant(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999)))); ++ q.bindValue(0, dt); + QVERIFY_SQL(q, exec()); + +- // Check if value was stored with at least second precision. + QVERIFY_SQL(q, exec("SELECT dt FROM " + tableName)); + QVERIFY_SQL(q, next()); +- QVERIFY(q.value(0).toDateTime().msecsTo(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999))) < 1000 ); ++ ++ // Check if retrieved value preserves reported precision ++ int precision = qMax(0, q.record().field("dt").precision()); ++ int diff = qAbs(q.value(0).toDateTime().msecsTo(dt)); ++ int keep = qMin(1000, (int)qPow(10.0, precision)); ++ QVERIFY(diff <= 1000 - keep); + } + } + +-- +1.8.1.4 + + +From c80f315f5e21d1550140e8ac6dd682fcdf50889c Mon Sep 17 00:00:00 2001 +From: Israel Lins <israelins85@yahoo.com.br> +Date: Sun, 17 Mar 2013 23:23:15 -0300 +Subject: [PATCH 5/7] ODBC: fixed consistence of return of QODBCResult::exec() + +The QODBCResult::exec() returns false when query is an delete +with no data do delete caused by SQLExecute function returning +SQL_NO_DATA, but the false return means error on execution. + +Task-number: QTBUG-10569 +Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923 +Reviewed-by: Mark Brand <mabrand@mabrand.nl> +(cherry picked from commit 0646d1131b4bc65cdd9af29f4ce00fdd2398a3df) + +diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp +index 5fa4779..c6fd49d 100644 +--- a/src/sql/drivers/odbc/qsql_odbc.cpp ++++ b/src/sql/drivers/odbc/qsql_odbc.cpp +@@ -1592,7 +1592,7 @@ bool QODBCResult::exec() + } + } + r = SQLExecute(d->hStmt); +- if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) { ++ if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r != SQL_NO_DATA) { + qWarning() << "QODBCResult::exec: Unable to execute statement:" << qODBCWarn(d); + setLastError(qMakeError(QCoreApplication::translate("QODBCResult", + "Unable to execute statement"), QSqlError::StatementError, d)); +diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +index 951d6d7..eb5c309 100644 +--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp ++++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +@@ -1027,6 +1027,10 @@ void tst_QSqlQuery::isActive() + QVERIFY_SQL( q, exec( "delete from " + qtest + " where id = 42" ) ); + + QVERIFY( q.isActive() ); ++ ++ QVERIFY_SQL( q, exec( "delete from " + qtest + " where id = 42" ) ); ++ ++ QVERIFY( q.isActive() ); + } + + void tst_QSqlQuery::numRowsAffected() +-- +1.8.1.4 + + +From c31329e0d735e1c36c1762d0a05764c9e4a52ca2 Mon Sep 17 00:00:00 2001 +From: Israel Lins <israelins85@yahoo.com.br> +Date: Sun, 17 Mar 2013 23:20:55 -0300 +Subject: [PATCH 6/7] ODBC: lost info about column metadata on SQL_NO_DATA + +In reset() if SqlExecDirect returns SQL_NO_DATA the column metadata +is ignored. + +Change-Id: I0501fa47c42754bba42b3531da59e66c696eac53 +Reviewed-by: Mark Brand <mabrand@mabrand.nl> +(cherry picked from commit f9d856b3f5a4ceaeb8a5ac88aad2ad6b9e540abf) + +diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp +index c6fd49d..5932b57 100644 +--- a/src/sql/drivers/odbc/qsql_odbc.cpp ++++ b/src/sql/drivers/odbc/qsql_odbc.cpp +@@ -960,11 +960,6 @@ bool QODBCResult::reset (const QString& query) + return false; + } + +- if(r == SQL_NO_DATA) { +- setSelect(false); +- return true; +- } +- + SQLINTEGER bufferLength; + SQLULEN isScrollable; + r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); +-- +1.8.1.4 + + +From 8f8677970ed5ca7e333095ab48a9b2bccbfd3eb5 Mon Sep 17 00:00:00 2001 +From: Mark Brand <mabrand@mabrand.nl> +Date: Tue, 23 Apr 2013 22:46:43 +0200 +Subject: [PATCH 7/7] qsql_odbc: fix SQLGetStmtAtt usage + +Failure to initialize the variable can cause spurious non-zero +values. + +http://msdn.microsoft.com/en-us/library/windows/desktop/ms715438(v=vs.85).aspx + +"..value can either be a SQLULEN value or a null-terminated character +string. If the value is a SQLULEN value, some drivers may only write the +lower 32-bit or 16-bit of a buffer and leave the higher-order +bit unchanged. Therefore, applications should use a buffer of SQLULEN +and initialize the value to 0 before calling this function. Also, the +BufferLength and StringLengthPtr arguments are not used." + +Follow-up to 1509316a37fb2d365230d020d1dfc251c830fd56 + +Change-Id: I2e92eb845a2590bea0849c52bde8902adff1b419 +Reviewed-by: Andy Shaw <andy.shaw@digia.com> +(cherry picked from commit af35ee291a1bbbc8627f9a17f7e104898d49b138) + +diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp +index 5932b57..b05cd4d 100644 +--- a/src/sql/drivers/odbc/qsql_odbc.cpp ++++ b/src/sql/drivers/odbc/qsql_odbc.cpp +@@ -960,9 +960,8 @@ bool QODBCResult::reset (const QString& query) + return false; + } + +- SQLINTEGER bufferLength; +- SQLULEN isScrollable; +- r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); ++ SQLULEN isScrollable = 0; ++ r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0); + if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) + QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE); + +@@ -1108,7 +1107,7 @@ bool QODBCResult::fetchLast() + "Unable to fetch last"), QSqlError::ConnectionError, d)); + return false; + } +- SQLINTEGER currRow; ++ SQLULEN currRow = 0; + r = SQLGetStmtAttr(d->hStmt, + SQL_ROW_NUMBER, + &currRow, +@@ -1594,9 +1593,8 @@ bool QODBCResult::exec() + return false; + } + +- SQLINTEGER bufferLength; +- SQLULEN isScrollable; +- r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); ++ SQLULEN isScrollable = 0; ++ r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0); + if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) + QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE); + +-- +1.8.1.4 + |