Blame SOURCES/0007-fdo-37167-create-statement-before-execute-wasNull-ge.patch

f0633d
From 515c6cf7a3832bfc7a6eeed65704bc9eee96adc1 Mon Sep 17 00:00:00 2001
f0633d
From: Lionel Elie Mamane <lionel@mamane.lu>
f0633d
Date: Mon, 6 Jan 2014 16:40:59 +0100
f0633d
Subject: [PATCH 7/9] fdo#37167 create statement before
f0633d
 execute/wasNull/getBoolean
f0633d
f0633d
This populates "object" member variable.
f0633d
f0633d
The "createStatement" calls were removed in:
f0633d
f0633d
 commit b9392a36645d8632b97ad79240f483b3a1683b61
f0633d
 Author: Ivo Hinkelmann <ihi@openoffice.org>
f0633d
 Date:   Thu Apr 23 10:42:05 2009 +0000
f0633d
f0633d
    CWS-TOOLING: integrate CWS dbaperf1
f0633d
f0633d
This was most probably in error since the call is not removed from the
f0633d
other modified member functions in this commit and/or failed to
f0633d
aaccount for the scenario of no parameter (and thus no setXXX call
f0633d
before execute).
f0633d
f0633d
Change-Id: Ic0e7b7b64ea496791f32c1416aa7d4416f909616
f0633d
Reviewed-on: https://gerrit.libreoffice.org/7280
f0633d
Reviewed-by: David Tardon <dtardon@redhat.com>
f0633d
Tested-by: David Tardon <dtardon@redhat.com>
f0633d
---
f0633d
 connectivity/source/drivers/jdbc/CallableStatement.cxx | 4 ++++
f0633d
 connectivity/source/drivers/jdbc/PreparedStatement.cxx | 5 +++++
f0633d
 2 files changed, 9 insertions(+)
f0633d
f0633d
diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx
f0633d
index 7ab349f..50cce64 100644
f0633d
--- a/connectivity/source/drivers/jdbc/CallableStatement.cxx
f0633d
+++ b/connectivity/source/drivers/jdbc/CallableStatement.cxx
f0633d
@@ -69,12 +69,16 @@ Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) th
f0633d
 // -------------------------------------------------------------------------
f0633d
 sal_Bool SAL_CALL java_sql_CallableStatement::wasNull(  ) throw(starsdbc::SQLException, RuntimeException)
f0633d
 {
f0633d
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
f0633d
+    createStatement(t.pEnv);
f0633d
     static jmethodID mID(NULL);
f0633d
     return callBooleanMethod( "wasNull", mID );
f0633d
 }
f0633d
 
f0633d
 sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
f0633d
 {
f0633d
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
f0633d
+    createStatement(t.pEnv);
f0633d
     static jmethodID mID(NULL);
f0633d
     return callBooleanMethodWithIntArg( "getBoolean", mID,columnIndex );
f0633d
 }
f0633d
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
f0633d
index 0458ad7..5f9dafe 100644
f0633d
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
f0633d
+++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
f0633d
@@ -96,6 +96,8 @@ sal_Bool SAL_CALL java_sql_PreparedStatement::execute(  ) throw(::com::sun::star
f0633d
     ::osl::MutexGuard aGuard( m_aMutex );
f0633d
     checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
f0633d
 
f0633d
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
f0633d
+    createStatement(t.pEnv);
f0633d
     static jmethodID mID(NULL);
f0633d
     return callBooleanMethod( "execute", mID );
f0633d
 }
f0633d
@@ -106,6 +108,9 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate(  ) throw(::com::su
f0633d
     ::osl::MutexGuard aGuard( m_aMutex );
f0633d
     checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
f0633d
     m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE );
f0633d
+
f0633d
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
f0633d
+    createStatement(t.pEnv);
f0633d
     static jmethodID mID(NULL);
f0633d
     return callIntMethod("executeUpdate",mID);
f0633d
 }
f0633d
-- 
f0633d
1.8.4.2
f0633d