LibreOffice Module connectivity (master) 1
pq_preparedstatement.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * Effective License of whole file:
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 *
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
21 *
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
24 *
25 * Copyright: 2000 by Sun Microsystems, Inc.
26 *
27 * Contributor(s): Joerg Budischewski
28 *
29 * All parts contributed on or after August 2011:
30 *
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
34 *
35 ************************************************************************/
36
37#include <sal/log.hxx>
39#include "pq_tools.hxx"
40#include "pq_statics.hxx"
41#include "pq_statement.hxx"
42
43#include <o3tl/safeint.hxx>
44#include <rtl/strbuf.hxx>
45#include <rtl/ustrbuf.hxx>
46
47
49
50#include <com/sun/star/sdbc/DataType.hpp>
51#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
52#include <com/sun/star/sdbc/ResultSetType.hpp>
53#include <com/sun/star/sdbc/SQLException.hpp>
54
55#include <memory>
56#include <string.h>
57#include <string_view>
58
60#include <utility>
61
62using osl::MutexGuard;
63
64
65using com::sun::star::uno::Any;
66using com::sun::star::uno::Type;
69using com::sun::star::uno::UNO_QUERY;
70
71using com::sun::star::lang::IllegalArgumentException;
72
73using com::sun::star::sdbc::XCloseable;
74using com::sun::star::sdbc::XResultSet;
75using com::sun::star::sdbc::XRef;
76using com::sun::star::sdbc::XBlob;
77using com::sun::star::sdbc::XClob;
78using com::sun::star::sdbc::XArray;
79using com::sun::star::sdbc::XConnection;
80using com::sun::star::sdbc::SQLException;
81
82using com::sun::star::beans::Property;
83using com::sun::star::beans::XPropertySetInfo;
84
85using namespace dbtools;
86
87namespace pq_sdbc_driver
88{
89static ::cppu::IPropertyArrayHelper & getPreparedStatementPropertyArrayHelper()
90{
91 static ::cppu::OPropertyArrayHelper arrayHelper(
94 "CursorName", 0,
97 "EscapeProcessing", 1,
100 "FetchDirection", 2,
102 Property(
103 "FetchSize", 3,
105 Property(
106 "MaxFieldSize", 4,
108 Property(
109 "MaxRows", 5,
111 Property(
112 "QueryTimeOut", 6,
114 Property(
115 "ResultSetConcurrency", 7,
117 Property(
118 "ResultSetType", 8,
120 true );
121 static ::cppu::IPropertyArrayHelper *pArrayHelper = &arrayHelper;
122
123 return *pArrayHelper;
124}
125
126static bool isOperator( char c )
127{
128 static const char * const operators = "<>=()!/&%.,;";
129
130 const char * w = operators;
131 while (*w && *w != c)
132 {
133 ++w;
134 }
135 return *w != 0;
136}
137
138static bool isNamedParameterStart( std::string_view o , int index )
139{
140 return o[index] == ':' && (
141 isWhitespace( o[index-1] ) || isOperator(o[index-1]) );
142}
143
144static bool isQuoted( std::string_view str )
145{
146 return str[0] == '"' || str[0] == '\'';
147}
148
150 const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
151 const Reference< XConnection > & conn,
152 struct ConnectionSettings *pSettings,
153 OString stmt )
154 : PreparedStatement_BASE(refMutex->GetMutex())
156 , m_connection(conn)
157 , m_pSettings(pSettings)
158 , m_stmt(std::move(stmt))
159 , m_xMutex(refMutex)
160 , m_multipleResultAvailable(false)
161 , m_multipleResultUpdateCount(0)
162 , m_lastOidInserted( InvalidOid )
163{
165 m_props[PREPARED_STATEMENT_MAX_ROWS] <<= sal_Int32(0);
167 css::sdbc::ResultSetConcurrency::READ_ONLY;
169 css::sdbc::ResultSetType::SCROLL_INSENSITIVE;
170
172 int elements = 0;
173 for(const OString & str : m_splittedStatement)
174 {
175 // ignore quoted strings...
176 if( ! isQuoted( str ) )
177 {
178 // the ':' cannot be the first or the last part of the
179 // token,
180 // the ? cannot be the first part of the token , so we start
181 // at one
182 for( int index = 1 ; index < str.getLength() ; index ++ )
183 {
184 if( str[index] == '?' ||
186 )
187 {
188 elements ++;
189 }
190 }
191 }
192 }
193 m_vars = std::vector< OString >( elements );
194}
195
197{
198}
199
200void PreparedStatement::checkColumnIndex( sal_Int32 parameterIndex )
201{
202 if( parameterIndex < 1 || o3tl::make_unsigned(parameterIndex) > m_vars.size() )
203 {
204 throw SQLException(
205 "pq_preparedstatement: parameter index out of range (expected 1 to "
206 + OUString::number( m_vars.size() )
207 + ", got " + OUString::number( parameterIndex )
208 + ", statement '" + OStringToOUString( m_stmt, ConnectionSettings::encoding )
209 + "')",
210 *this, OUString(), 1, Any () );
211 }
212}
214{
216 throw SQLException(
217 "pq_driver: PreparedStatement or connection has already been closed !",
218 *this, OUString(),1,Any());
219}
220
222{
223 Any aRet = PreparedStatement_BASE::queryInterface(rType);
224 return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
225}
226
227
229{
230 static Sequence< Type > collection(
231 ::comphelper::concatSequences(
232 OPropertySetHelper::getTypes(),
233 PreparedStatement_BASE::getTypes()));
234
235 return collection;
236}
237
239{
240 return css::uno::Sequence<sal_Int8>();
241}
242
244{
245 // let the connection die without acquired mutex !
247 Reference< XCloseable > resultSet;
248 {
249 MutexGuard guard( m_xMutex->GetMutex() );
250 m_pSettings = nullptr;
251 r = m_connection;
252 m_connection.clear();
253
254 resultSet = m_lastResultset;
255 m_lastResultset.clear();
256 }
257 if( resultSet.is() )
258 {
259 resultSet->close();
260 }
261}
262
263void PreparedStatement::raiseSQLException( const char * errorMsg )
264{
265 OUStringBuffer buf(128);
266 buf.append( "pq_driver: "
267 + OUString( errorMsg, strlen(errorMsg) , ConnectionSettings::encoding )
268 + " (caused by statement '" );
269 buf.appendAscii( m_executedStatement.getStr() );
270 buf.append( "')" );
271 OUString error = buf.makeStringAndClear();
272 SAL_WARN("connectivity.postgresql", error);
273 throw SQLException( error, *this, OUString(), 1, Any() );
274}
275
277{
278 if( ! execute( ) )
279 {
280 raiseSQLException( "not a query" );
281 }
282 return Reference< XResultSet > ( m_lastResultset, css::uno::UNO_QUERY );
283}
284
286{
287 if( execute( ) )
288 {
289 raiseSQLException( "not a command" );
290 }
292}
293
295{
296 osl::MutexGuard guard( m_xMutex->GetMutex() );
297
298 OStringBuffer buf( m_stmt.getLength() *2 );
299
300 std::vector< OString >::size_type vars = 0;
301 for(const OString & str : m_splittedStatement)
302 {
303 // LEM TODO: instead of this manual mucking with SQL
304 // could we use PQexecParams / PQExecPrepared / ...?
305 // Only snafu is giving the types of the parameters and
306 // that it needs $1, $2, etc instead of "?"
307
308// printf( "Split %d %s\n" , i , str.getStr() );
309 if( isQuoted( str ) )
310 {
311 buf.append( str );
312 }
313 else
314 {
315 int start = 0,index;
316 for( index = 1 ; index < str.getLength() ; index ++ )
317 {
318 if( str[index] == '?' )
319 {
320 buf.append( str.getStr()+start, index - start );
321 buf.append( m_vars[vars] );
322 vars ++;
323 start =index+1;
324 }
325 else
326 {
327 if ( isNamedParameterStart( str, index ) )
328 {
329 buf.append( str.getStr()+start, index -start );
330 buf.append( m_vars[vars] );
331
332 // skip to the end of the named parameter
333 while ( index < str.getLength()
334 && !( isWhitespace(str[index])
335 || isOperator (str[index])))
336 {
337 ++index;
338 }
339 start = index;
340 vars ++;
341 }
342 }
343 }
344// if( index +1 >= str.getLength() )
345// {
346 buf.append( str.getStr() + start, index -start );
347// }
348 }
349 }
350
351 m_executedStatement = buf.makeStringAndClear();
352
354 if( lastResultSet.is() )
355 lastResultSet->close();
356
357 m_lastResultset.clear();
358 m_lastTableInserted.clear();
359
360 struct CommandData data;
361 data.refMutex = m_xMutex;
362 data.ppSettings = &m_pSettings;
364 data.pLastQuery = &m_lastQuery;
369 data.owner = *this;
370 data.tableSupplier.set( m_connection, UNO_QUERY );
371 data.concurrency = extractIntProperty( this, getStatics().RESULT_SET_CONCURRENCY );
372
373 return executePostgresCommand( m_executedStatement , &data ); // see pq_statement.cxx
374}
375
377{
379 {
380 MutexGuard guard( m_xMutex->GetMutex() );
381 checkClosed();
382 ret = m_connection;
383 }
384 return ret;
385}
386
387
388void PreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 )
389{
390 MutexGuard guard( m_xMutex->GetMutex() );
391 checkClosed();
392 checkColumnIndex( parameterIndex );
393 m_vars[parameterIndex-1] = OString( "NULL" );
394}
395
397 sal_Int32 parameterIndex, sal_Int32, const OUString& )
398{
399 MutexGuard guard( m_xMutex->GetMutex() );
400 checkClosed();
401 checkColumnIndex( parameterIndex );
402 m_vars[parameterIndex-1] = OString( "NULL" );
403}
404
405
406void PreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
407{
408 MutexGuard guard(m_xMutex->GetMutex() );
409 checkClosed();
410 checkColumnIndex( parameterIndex );
411 if( x )
412 m_vars[parameterIndex-1] = OString( "'t'" );
413 else
414 m_vars[parameterIndex-1] = OString( "'f'" );
415}
416
417void PreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x )
418{
419 setInt(parameterIndex,x);
420}
421
422void PreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x )
423{
424 setInt(parameterIndex, x );
425}
426
427void PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x )
428{
429// printf( "setString %d %d\n ", parameterIndex, x);
430 MutexGuard guard(m_xMutex->GetMutex() );
431 checkClosed();
432 checkColumnIndex( parameterIndex );
433 m_vars[parameterIndex-1] = "'" + OString::number(x) + "'";
434}
435
436void PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x )
437{
438 MutexGuard guard(m_xMutex->GetMutex() );
439 checkClosed();
440 checkColumnIndex( parameterIndex );
441 m_vars[parameterIndex-1] = "'" + OString::number(x) + "'";
442}
443
444void PreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
445{
446 MutexGuard guard(m_xMutex->GetMutex() );
447 checkClosed();
448 checkColumnIndex( parameterIndex );
449 m_vars[parameterIndex-1] = "'" + OString::number(x) + "'";
450}
451
452void PreparedStatement::setDouble( sal_Int32 parameterIndex, double x )
453{
454 MutexGuard guard(m_xMutex->GetMutex() );
455 checkClosed();
456 checkColumnIndex( parameterIndex );
457 m_vars[parameterIndex-1] = "'" + OString::number(x) + "'";
458}
459
460void PreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x )
461{
462// printf( "setString %d %s\n ", parameterIndex,
463// OUStringToOString( x , RTL_TEXTENCODING_ASCII_US ).getStr());
464 MutexGuard guard(m_xMutex->GetMutex() );
465 checkClosed();
466 checkColumnIndex( parameterIndex );
467 OStringBuffer buf( 20 );
468 buf.append( "'" );
470 buf.ensureCapacity( y.getLength() * 2 + 2 );
471 int len = PQescapeString( const_cast<char*>(buf.getStr())+1, y.getStr() , y.getLength() );
472 buf.setLength( 1 + len );
473 buf.append( "'" );
474 m_vars[parameterIndex-1] = buf.makeStringAndClear();
475}
476
478 sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x )
479{
480 MutexGuard guard(m_xMutex->GetMutex() );
481 checkClosed();
482 checkColumnIndex( parameterIndex );
483 size_t len;
484 const std::unique_ptr<unsigned char, deleter_from_fn<PQfreemem>> escapedString(
485 PQescapeBytea( reinterpret_cast<unsigned char const *>(x.getConstArray()), x.getLength(), &len));
486 if( ! escapedString )
487 {
488 throw SQLException(
489 "pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string",
490 *this, OUString(), 1, Any() );
491 }
492 m_vars[parameterIndex-1]
493 = OString::Concat("'") + std::string_view(reinterpret_cast<char *>(escapedString.get()), len -1) + "'";
494}
495
496
497void PreparedStatement::setDate( sal_Int32 parameterIndex, const css::util::Date& x )
498{
499 setString( parameterIndex, DBTypeConversion::toDateString( x ) );
500}
501
502void PreparedStatement::setTime( sal_Int32 parameterIndex, const css::util::Time& x )
503{
504 setString( parameterIndex, DBTypeConversion::toTimeString( x ) );
505}
506
508 sal_Int32 parameterIndex, const css::util::DateTime& x )
509{
510 setString( parameterIndex, DBTypeConversion::toDateTimeString( x ) );
511}
512
514 sal_Int32,
516 sal_Int32 )
517{
518 throw SQLException(
519 "pq_preparedstatement: setBinaryStream not implemented",
520 *this, OUString(), 1, Any () );
521}
522
524 sal_Int32,
526 sal_Int32 )
527{
528 throw SQLException(
529 "pq_preparedstatement: setCharacterStream not implemented",
530 *this, OUString(), 1, Any () );
531}
532
533void PreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x )
534{
535 if( ! implSetObject( this, parameterIndex, x ))
536 {
537 throw SQLException(
538 "pq_preparedstatement::setObject: can't convert value of type " + x.getValueTypeName(),
539 *this, OUString(), 1, Any () );
540 }
541}
542
544 sal_Int32 parameterIndex,
545 const Any& x,
546 sal_Int32 targetSqlType,
547 sal_Int32 )
548{
549 if( css::sdbc::DataType::DECIMAL == targetSqlType ||
550 css::sdbc::DataType::NUMERIC == targetSqlType )
551 {
552 double myDouble = 0.0;
553 OUString myString;
554 if( x >>= myDouble )
555 {
556 myString = OUString::number( myDouble );
557 }
558 else
559 {
560 x >>= myString;
561 }
562 if( myString.isEmpty() )
563 {
564 throw SQLException(
565 "pq_preparedstatement::setObjectWithInfo: can't convert value of type "
566 + x.getValueTypeName() + " to type DECIMAL or NUMERIC",
567 *this, OUString(), 1, Any () );
568 }
569
570 setString( parameterIndex, myString );
571 }
572 else
573 {
574 setObject( parameterIndex, x );
575 }
576
577}
578
580 sal_Int32,
581 const Reference< XRef >& )
582{
583 throw SQLException(
584 "pq_preparedstatement: setRef not implemented",
585 *this, OUString(), 1, Any () );
586}
587
589 sal_Int32,
590 const Reference< XBlob >& )
591{
592 throw SQLException(
593 "pq_preparedstatement: setBlob not implemented",
594 *this, OUString(), 1, Any () );
595}
596
598 sal_Int32,
599 const Reference< XClob >& )
600{
601 throw SQLException(
602 "pq_preparedstatement: setClob not implemented",
603 *this, OUString(), 1, Any () );
604}
605
607 sal_Int32 parameterIndex,
608 const Reference< XArray >& x )
609{
610 setString( parameterIndex, array2String( x->getArray( nullptr ) ) );
611}
612
614{
615 MutexGuard guard(m_xMutex->GetMutex() );
616 m_vars = std::vector< OString >( m_vars.size() );
617}
618
620{
621 return Any();
622}
623
625{
626}
627
629{
632 if( supplier.is() )
633 ret = supplier->getMetaData();
634 return ret;
635}
636
638{
640}
641
642
644 Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue )
645{
646 bool bRet;
647 rOldValue = m_props[nHandle];
648 switch( nHandle )
649 {
651 {
652 OUString val;
653 bRet = ( rValue >>= val );
654 rConvertedValue <<= val;
655 break;
656 }
658 {
659 bool val(false);
660 bRet = ( rValue >>= val );
661 rConvertedValue <<= val;
662 break;
663 }
671 {
672 sal_Int32 val;
673 bRet = ( rValue >>= val );
674 rConvertedValue <<= val;
675 break;
676 }
677 default:
678 {
679 throw IllegalArgumentException(
680 "pq_statement: Invalid property handle ("
681 + OUString::number( nHandle ) + ")",
682 *this, 2 );
683 }
684 }
685 return bRet;
686}
687
688
690 sal_Int32 nHandle,const Any& rValue )
691{
692 m_props[nHandle] = rValue;
693}
694
695void PreparedStatement::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
696{
697 rValue = m_props[nHandle];
698}
699
701{
702 return OPropertySetHelper::createPropertySetInfo( getPreparedStatementPropertyArrayHelper() );
703}
704
706{
707 close();
708}
709
710
712{
713 return Reference< XResultSet > ( m_lastResultset, css::uno::UNO_QUERY );
714}
716{
718}
720{
722 if( lastResultSet.is() )
723 lastResultSet->close();
725 return false;
726}
727
729{
730 osl::MutexGuard guard( m_xMutex->GetMutex() );
733}
734
735
736}
737
738/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const css::util::DateTime &x) override
virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) override
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) override
virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) override
virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) override
css::uno::Reference< css::sdbc::XConnection > m_connection
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getGeneratedValues() override
virtual void SAL_CALL close() override
virtual cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual sal_Bool SAL_CALL execute() override
void checkColumnIndex(sal_Int32 parameterIndex)
virtual void SAL_CALL disposing() override
virtual void SAL_CALL setLong(sal_Int32 parameterIndex, sal_Int64 x) override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual sal_Int32 SAL_CALL executeUpdate() override
virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob > &x) override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery() override
virtual sal_Int32 SAL_CALL getUpdateCount() override
virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const css::uno::Any &x) override
virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual void SAL_CALL setString(sal_Int32 parameterIndex, const OUString &x) override
virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef > &x) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &reqType) override
virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const css::uno::Any &x, sal_Int32 targetSqlType, sal_Int32 scale) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet() override
css::uno::Reference< css::sdbc::XCloseable > m_lastResultset
::rtl::Reference< comphelper::RefCountedMutex > m_xMutex
virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) override
virtual void SAL_CALL clearParameters() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual sal_Bool SAL_CALL getMoreResults() override
virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const css::util::Time &x) override
virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString &typeName) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
std::vector< OString > m_splittedStatement
virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) override
virtual void SAL_CALL clearWarnings() override
virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray > &x) override
css::uno::Any m_props[PREPARED_STATEMENT_SIZE]
void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const css::util::Date &x) override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
PreparedStatement(const rtl::Reference< comphelper::RefCountedMutex > &refMutex, const css::uno::Reference< css::sdbc::XConnection > &con, struct ConnectionSettings *pSettings, OString stmt)
void raiseSQLException(const char *errorMsg)
virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob > &x) override
float y
float x
#define SAL_WARN(area, stream)
Type
OOO_DLLPUBLIC_DBTOOLS OUString toTimeString(const css::util::Time &rTime)
OOO_DLLPUBLIC_DBTOOLS OUString toDateString(const css::util::Date &rDate)
OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const css::util::DateTime &_rDateTime)
index
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
const sal_Int32 PREPARED_STATEMENT_FETCH_DIRECTION
bool implSetObject(const Reference< XParameters > &_rxParameters, const sal_Int32 _nColumnIndex, const Any &_rValue)
Definition: pq_tools.cxx:1157
Statics & getStatics()
Definition: pq_statics.cxx:112
bool isWhitespace(sal_Unicode c)
Definition: pq_tools.cxx:313
const sal_Int32 PREPARED_STATEMENT_MAX_FIELD_SIZE
const sal_Int32 PREPARED_STATEMENT_RESULT_SET_TYPE
OUString array2String(const css::uno::Sequence< Any > &seq)
Definition: pq_tools.cxx:569
sal_Int32 extractIntProperty(const Reference< XPropertySet > &descriptor, const OUString &name)
Definition: pq_tools.cxx:220
const sal_Int32 PREPARED_STATEMENT_QUERY_TIME_OUT
static bool isQuoted(std::string_view str)
const sal_Int32 PREPARED_STATEMENT_ESCAPE_PROCESSING
static bool isNamedParameterStart(std::string_view o, int index)
::cppu::WeakComponentImplHelper< css::sdbc::XPreparedStatement, css::sdbc::XParameters, css::sdbc::XCloseable, css::sdbc::XWarningsSupplier, css::sdbc::XMultipleResults, css::sdbc::XGeneratedResultSet, css::sdbc::XResultSetMetaDataSupplier > PreparedStatement_BASE
::cppu::IPropertyArrayHelper & getPreparedStatementPropertyArrayHelper()
const sal_Int32 PREPARED_STATEMENT_FETCH_SIZE
static bool isOperator(char c)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Definition: pq_tools.cxx:100
const sal_Int32 PREPARED_STATEMENT_RESULT_SET_CONCURRENCY
const sal_Int32 PREPARED_STATEMENT_CURSOR_NAME
Reference< XResultSet > getGeneratedValuesFromLastInsert(ConnectionSettings *pConnectionSettings, const Reference< XConnection > &connection, sal_Int32 nLastOid, std::u16string_view lastTableInserted, const OString &lastQuery)
bool executePostgresCommand(const OString &cmd, struct CommandData *data)
const sal_Int32 PREPARED_STATEMENT_MAX_ROWS
void splitSQL(const OString &sql, std::vector< OString > &vec)
Definition: pq_tools.cxx:404
sal_Int32 w
sal_Int32 nHandle
css::uno::Reference< css::uno::XInterface > owner
sal_Int32 * pMultipleResultUpdateCount
css::uno::Reference< css::sdbc::XCloseable > * pLastResultset
::rtl::Reference< comphelper::RefCountedMutex > refMutex
ConnectionSettings ** ppSettings
css::uno::Reference< css::sdbcx::XTablesSupplier > tableSupplier
static const rtl_TextEncoding encoding
unsigned char sal_Bool
signed char sal_Int8