[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2016-07-15 Thread Wastack
 connectivity/source/drivers/firebird/ResultSet.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit f9393f84d539814574b594e173367335fe0c42e8
Author: Wastack 
Date:   Mon Jul 11 17:25:58 2016 +0200

tdf#91324 GSoC adapt struct tm correctly

Change-Id: I645ebe888186e550b95dd072e063260bc69aa178
Reviewed-on: https://gerrit.libreoffice.org/27120
Reviewed-by: Lionel Elie Mamane 
Tested-by: Lionel Elie Mamane 
(cherry picked from commit 88346f606a16865bcf7492f67a7207d0078787a1)
Reviewed-on: https://gerrit.libreoffice.org/27235
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx 
b/connectivity/source/drivers/firebird/ResultSet.cxx
index 89145f4..b4d2472 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -480,10 +480,14 @@ DateTime OResultSet::retrieveValue(const sal_Int32 
nColumnIndex, const ISC_SHORT
 struct tm aCTime;
 isc_decode_timestamp(, );
 
-// first field is nanoseconds -- not supported in firebird or struct 
tm.
-// last field denotes UTC (true) or unknown (false)
-return DateTime(0, aCTime.tm_sec, aCTime.tm_min, aCTime.tm_hour, 
aCTime.tm_mday,
-aCTime.tm_mon, aCTime.tm_year, false);
+return DateTime(0, //nanoseconds, not supported
+aCTime.tm_sec,
+aCTime.tm_min,
+aCTime.tm_hour,
+aCTime.tm_mday,
+aCTime.tm_mon + 1, // tm is from 0 to 11
+aCTime.tm_year + 1900, //tm_year is the years since 
1900
+false); // denotes UTC (true), or unknown (false)
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2016-04-26 Thread Stephan Bergmann
 connectivity/source/parse/sqlnode.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit eadc1f93747f493278affc42f361f99f079a2fbf
Author: Stephan Bergmann 
Date:   Wed Jan 13 17:20:52 2016 +0100

-Werror=misleading-indentation (GCC 6)

Change-Id: Ide514da5b4413974e50beeb4f41881294475303c
(cherry picked from commit 39d6c6256f80a5b5c548f5e68849a1ef7140e32a)
Signed-off-by: David Tardon 
Reviewed-on: https://gerrit.libreoffice.org/24409
Tested-by: Jenkins 

diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 8111750..7f7fdeb 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2450,7 +2450,8 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, 
const SQLParseNodeParamet
 if  (   
rParam.aMetaData.getCatalogSeparator().isEmpty()
 || rString[rString.getLength() - 1] != 
rParam.aMetaData.getCatalogSeparator().toChar()
 )
-rString.append(" "); break;
+rString.append(" ");
+break;
 }
 }
 if (rParam.bQuote)
@@ -2506,7 +2507,8 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, 
const SQLParseNodeParamet
 if  (   
rParam.aMetaData.getCatalogSeparator().isEmpty()
 ||  rString[rString.getLength() - 1] != 
rParam.aMetaData.getCatalogSeparator().toChar()
 )
-rString.append(" "); break;
+rString.append(" ");
+break;
 }
 }
 rString.append(m_aNodeValue);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2016-04-14 Thread Michael Stahl
 connectivity/source/drivers/file/fcode.cxx |2 +-
 connectivity/source/drivers/file/fcomp.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2deebf81db15688abfe1db059f73da4b8e410c25
Author: Michael Stahl 
Date:   Wed Apr 13 18:18:11 2016 +0200

tdf#97853 connectivity: fix inverted condition

Also in 2 places IS_TYPE was converted to dynamic_cast instead of a
typeid check; use typeid there too, just for consistency.

(regression from ac9671f94800b647f82b12e718968311a025e87e)

Change-Id: I0df47a845eff660c791304c22c97704589ab999f
(cherry picked from commit 49d320c6202a569f996c27fd824239f5f1f8a036)
Reviewed-on: https://gerrit.libreoffice.org/24062
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/connectivity/source/drivers/file/fcode.cxx 
b/connectivity/source/drivers/file/fcode.cxx
index 352323b..06fdb5d 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -370,7 +370,7 @@ void ONthOperator::Exec(OCodeStack& rCodeStack)
 ::std::vector::iterator aEnd = aOperands.end();
 for (; aIter != aEnd; ++aIter)
 {
-if (typeid(OOperandResult) != typeid(*(*aIter)))
+if (typeid(OOperandResult) == typeid(*(*aIter)))
 delete *aIter;
 }
 }
diff --git a/connectivity/source/drivers/file/fcomp.cxx 
b/connectivity/source/drivers/file/fcomp.cxx
index 4503739..c0008d4 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -568,7 +568,7 @@ bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
 DBG_ASSERT(pOperand, "StackFehler");
 
 bResult = pOperand->isValid();
-if (dynamic_cast(pOperand) !=  nullptr)
+if (typeid(OOperandResult) == typeid(*pOperand))
 delete pOperand;
 return bResult;
 }
@@ -595,7 +595,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& 
rCodeList,ORowSetValueD
 DBG_ASSERT(pOperand, "StackFehler");
 
 (*_rVal) = pOperand->getValue();
-if (dynamic_cast(pOperand) !=  nullptr)
+if (typeid(OOperandResult) == typeid(*pOperand))
 delete pOperand;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2016-03-07 Thread Lionel Elie Mamane
 connectivity/source/drivers/postgresql/pq_statics.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 68fcdbae82869fd6ff49102a5b0d5a55cc581f4d
Author: Lionel Elie Mamane 
Date:   Fri Mar 4 09:20:31 2016 +0100

pgsql-sdbc: "text" dataype is *LONG*VARCHAR

Change-Id: Idd01299ef4592b43e573c3b0996d4822664c6bcf
Reviewed-on: https://gerrit.libreoffice.org/22897
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/drivers/postgresql/pq_statics.cxx 
b/connectivity/source/drivers/postgresql/pq_statics.cxx
index 98bf332..661f696 100644
--- a/connectivity/source/drivers/postgresql/pq_statics.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statics.cxx
@@ -623,7 +623,7 @@ Statics & getStatics()
 // { "serial", com::sun::star::sdbc::DataType::INTEGER },
 // { "serial4", com::sun::star::sdbc::DataType::INTEGER },
 
-{ "text", com::sun::star::sdbc::DataType::VARCHAR },
+{ "text", com::sun::star::sdbc::DataType::LONGVARCHAR },
 { "bpchar", com::sun::star::sdbc::DataType::CHAR },
 { "varchar", com::sun::star::sdbc::DataType::VARCHAR },
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2016-03-04 Thread Lionel Elie Mamane
 connectivity/source/drivers/postgresql/pq_databasemetadata.cxx |   22 
+++---
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 95b10e373d117f3ed3e53987aa40a65d1ca6d1a0
Author: Lionel Elie Mamane 
Date:   Thu Mar 3 19:41:54 2016 +0100

tdf#92538 use proper schema name for type names

Change-Id: I7e428e4530765925bd35c7f4fcde7f95ceb12243
Reviewed-on: https://gerrit.libreoffice.org/22876
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx 
b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index a742d4a..14cb74e 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -2192,6 +2192,16 @@ static sal_Int32 getMaxScale( sal_Int32 dataType )
 return ret;
 }
 
+namespace
+{
+OUString construct_full_typename(OUString ns, OUString tn)
+{
+if(ns.isEmpty() || ns == "pg_catalog")
+return tn;
+else
+return ns + "." + tn;
+}
+}
 
 static void pgTypeInfo2ResultSet(
  SequenceAnyVector ,
@@ -2256,7 +2266,7 @@ static void pgTypeInfo2ResultSet(
 row[CREATE_PARAMS] <<= OUString("length, scale");
 }
 
-row[TYPE_NAME] <<= xRow->getString(1);
+row[TYPE_NAME] <<= construct_full_typename(xRow->getString(6), 
xRow->getString(1));
 row[DATA_TYPE] <<= OUString::number(dataType);
 row[PRECISION] <<= OUString::number( precision );
 sal_Int32 nullable = xRow->getBoolean(4) ?
@@ -2298,8 +2308,9 @@ static void pgTypeInfo2ResultSet(
   "pg_type.typtype AS typtype,"//2
   "pg_type.typlen AS typlen,"  //3
   "pg_type.typnotnull AS typnotnull,"  //4
-  "pg_type.typname AS typname "//5
-  "FROM pg_type "
+  "pg_type.typname AS typname, "   //5
+  "pg_namespace.nspname as typns " //6
+  "FROM pg_type LEFT JOIN pg_namespace ON 
pg_type.typnamespace=pg_namespace.oid "
   "WHERE pg_type.typtype = 'b' "
   "OR pg_type.typtype = 'p'"
 );
@@ -2313,8 +2324,9 @@ static void pgTypeInfo2ResultSet(
 "t2.typtype AS typtype,"
 "t2.typlen AS typlen,"
 "t2.typnotnull AS typnotnull,"
-"t2.typname as realtypname "
-"FROM pg_type as t1 LEFT JOIN pg_type AS t2 ON t1.typbasetype=t2.oid "
+"t2.typname as realtypname, "
+"pg_namespace.nspname as typns "
+"FROM pg_type as t1 LEFT JOIN pg_type AS t2 ON t1.typbasetype=t2.oid 
LEFT JOIN pg_namespace ON t1.typnamespace=pg_namespace.oid "
 "WHERE t1.typtype = 'd'" );
 pgTypeInfo2ResultSet( vec, rs );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2015-12-18 Thread Lionel Elie Mamane
 connectivity/source/drivers/firebird/PreparedStatement.cxx |   10 
 connectivity/source/drivers/firebird/Util.cxx  |   16 -
 2 files changed, 10 insertions(+), 16 deletions(-)

New commits:
commit 3ac3aff895ceb466934a2e22641f5340ea6d23f7
Author: Lionel Elie Mamane 
Date:   Fri Dec 18 16:54:00 2015 +0100

tdf#96572 firebird correctly transmit request for NULL

even if column is not nullable

Change-Id: I72ceda68e983125aef26c8f0aacc06320bd16b77

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx 
b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index fbc2fae..5e3758a 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -706,13 +706,13 @@ void OPreparedStatement::setParameterNull(sal_Int32 
nParameterIndex,
   bool bSetNull)
 {
 XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
-if (pVar->sqltype & 1)
+if (bSetNull)
 {
-if (bSetNull)
-*pVar->sqlind = -1;
-else
-*pVar->sqlind = 0;
+pVar->sqltype |= 1;
+*pVar->sqlind = -1;
 }
+else
+*pVar->sqlind = 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Util.cxx 
b/connectivity/source/drivers/firebird/Util.cxx
index ddb9d02..00eb4aa 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -254,11 +254,8 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda)
 assert(false);
 break;
 }
-if (pVar->sqltype & 1)
-{
-/* allocate variable to hold NULL status */
-pVar->sqlind = static_cast(malloc(sizeof(short)));
-}
+/* allocate variable to hold NULL status */
+pVar->sqlind = static_cast(malloc(sizeof(short)));
 }
 }
 
@@ -302,13 +299,10 @@ void firebird::freeSQLVAR(XSQLDA* pSqlda)
 break;
 }
 
-if (pVar->sqltype & 1)
+if(pVar->sqlind)
 {
-if(pVar->sqlind)
-{
-free(pVar->sqlind);
-pVar->sqlind = nullptr;
-}
+free(pVar->sqlind);
+pVar->sqlind = nullptr;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - connectivity/source

2015-12-13 Thread Lionel Elie Mamane
 connectivity/source/drivers/odbc/OPreparedStatement.cxx |   12 +---
 connectivity/source/inc/odbc/OPreparedStatement.hxx |1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit e95e07ef3b125688d4dce47f382533a1db50479f
Author: Lionel Elie Mamane 
Date:   Sun Dec 13 19:21:30 2015 +0100

tdf#96461 ODBC SQLBindParameter: correct DecimalDigits for time(date) values

Change-Id: I33c63d2c002d9abcbadb16bcd460996ef3212f4a
Reviewed-on: https://gerrit.libreoffice.org/20686
Reviewed-by: Lionel Elie Mamane 
Tested-by: Lionel Elie Mamane 

diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx 
b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 2e8f6be..95a9f21 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -290,6 +290,12 @@ void OPreparedStatement::setParameterPre(sal_Int32 
parameterIndex)
 
 template  void OPreparedStatement::setScalarParameter(const 
sal_Int32 parameterIndex, const sal_Int32 i_nType, const SQLULEN i_nColSize, 
const T i_Value)
 {
+setScalarParameter(parameterIndex, i_nType, i_nColSize, invalid_scale, 
i_Value);
+}
+
+
+template  void OPreparedStatement::setScalarParameter(const 
sal_Int32 parameterIndex, const sal_Int32 i_nType, const SQLULEN i_nColSize, 
sal_Int32 i_nScale, const T i_Value)
+{
 ::osl::MutexGuard aGuard( m_aMutex );
 setParameterPre(parameterIndex);
 
@@ -298,7 +304,7 @@ template  void 
OPreparedStatement::setScalarParameter(const sal_Int3
 TnoRef *bindBuf = static_cast< TnoRef* >( allocBindBuf(parameterIndex, 
sizeof(i_Value)) );
 *bindBuf = i_Value;
 
-setParameter(parameterIndex, i_nType, i_nColSize, invalid_scale, bindBuf, 
sizeof(i_Value), sizeof(i_Value));
+setParameter(parameterIndex, i_nType, i_nColSize, i_nScale, bindBuf, 
sizeof(i_Value), sizeof(i_Value));
 }
 
 
@@ -442,7 +448,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 
parameterIndex, const css::
 else
 nColSize = 18;
 TIME_STRUCT x(OTools::TimeToOdbcTime(aVal));
-setScalarParameter(parameterIndex, DataType::TIME, nColSize, 
x);
+setScalarParameter(parameterIndex, DataType::TIME, nColSize, 
(nColSize == 8)? 0 : nColSize-9, x);
 }
 
 
@@ -476,7 +482,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 
parameterIndex, const
 nColSize = 29;
 
 TIMESTAMP_STRUCT x(OTools::DateTimeToTimestamp(aVal));
-setScalarParameter(parameterIndex, DataType::TIMESTAMP, 
nColSize, x);
+setScalarParameter(parameterIndex, DataType::TIMESTAMP, 
nColSize, (nColSize <= 19)? 0 : nColSize-20, x);
 }
 
 
diff --git a/connectivity/source/inc/odbc/OPreparedStatement.hxx 
b/connectivity/source/inc/odbc/OPreparedStatement.hxx
index f3ccaf7..edd9b32 100644
--- a/connectivity/source/inc/odbc/OPreparedStatement.hxx
+++ b/connectivity/source/inc/odbc/OPreparedStatement.hxx
@@ -81,6 +81,7 @@ namespace connectivity
 void initBoundParam () throw(::com::sun::star::sdbc::SQLException);
 void setParameterPre(sal_Int32 parameterIndex);
 template  void setScalarParameter(sal_Int32 
parameterIndex, sal_Int32 _nType, SQLULEN _nColumnSize, const T i_Value);
+template  void setScalarParameter(sal_Int32 
parameterIndex, sal_Int32 _nType, SQLULEN _nColumnSize, sal_Int32 _nScale, 
const T i_Value);
 void setParameter(sal_Int32 parameterIndex, sal_Int32 _nType, 
SQLULEN _nColumnSize, sal_Int32 _nScale, const void* _pData, SQLULEN _nDataLen, 
SQLLEN _nDataAllocLen);
 // Wrappers for special cases
 void setParameter(sal_Int32 parameterIndex, sal_Int32 _nType, 
sal_Int16 _nScale, const OUString &_sData);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits