diff options
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_databasemetadata.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_databasemetadata.cxx | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index c3280e07bf15..76157bc4c305 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -84,6 +84,7 @@ #include <com/sun/star/sdbc/IndexType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/ColumnSearch.hpp> +#include <utility> using ::osl::MutexGuard; @@ -114,13 +115,13 @@ namespace pq_sdbc_driver #define DEFERRABILITY_NONE 7 DatabaseMetaData::DatabaseMetaData( - const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, - const css::uno::Reference< css::sdbc::XConnection > & origin, + ::rtl::Reference< comphelper::RefCountedMutex > refMutex, + css::uno::Reference< css::sdbc::XConnection > origin, ConnectionSettings *pSettings ) - : m_xMutex( refMutex ), + : m_xMutex(std::move( refMutex )), m_pSettings( pSettings ), - m_origin( origin ), - m_getIntSetting_stmt ( m_origin->prepareStatement("SELECT setting FROM pg_catalog.pg_settings WHERE name=?") ) + m_origin(std::move( origin )), + m_getIntSetting_stmt ( m_origin->prepareStatement(u"SELECT setting FROM pg_catalog.pg_settings WHERE name=?"_ustr) ) { init_getReferences_stmt(); init_getPrivs_stmt(); @@ -180,7 +181,7 @@ sal_Bool DatabaseMetaData::nullsAreSortedAtEnd( ) OUString DatabaseMetaData::getDatabaseProductName( ) { - return "PostgreSQL"; + return u"PostgreSQL"_ustr; } OUString DatabaseMetaData::getDatabaseProductVersion( ) @@ -189,7 +190,7 @@ OUString DatabaseMetaData::getDatabaseProductVersion( ) } OUString DatabaseMetaData::getDriverName( ) { - return "postgresql-sdbc"; + return u"postgresql-sdbc"_ustr; } OUString DatabaseMetaData::getDriverVersion( ) @@ -210,10 +211,10 @@ sal_Int32 DatabaseMetaData::getDriverMinorVersion( ) sal_Bool DatabaseMetaData::usesLocalFiles( ) { // LEM TODO: - // http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/XDatabaseMetaData_Interface + // https://wiki.documentfoundation.org/Documentation/DevGuide/Database_Access#XDatabaseMetaData_Interface // says "Returns true when the catalog name of the // database should not appear in the DatasourceBrowser - // of OpenOffice.org API, otherwise false is returned." + // of LibreOffice API, otherwise false is returned." // So, hmmm, think about it. return false; } @@ -270,7 +271,7 @@ sal_Bool DatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) OUString DatabaseMetaData::getIdentifierQuoteString( ) { - return "\""; + return u"\""_ustr; } OUString DatabaseMetaData::getSQLKeywords( ) @@ -281,7 +282,7 @@ OUString DatabaseMetaData::getSQLKeywords( ) // See http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html // LEM TODO: consider using pg_get_keywords(), filter on catcode return - "ANALYSE," + u"ANALYSE," "ANALYZE," "ARRAY," //SQL:1999 "ASYMMETRIC," //SQL:2003 @@ -305,19 +306,19 @@ OUString DatabaseMetaData::getSQLKeywords( ) "SIMILAR," //SQL:2003 "VARIADIC," "VERBOSE," - "WINDOW" //SQL:2003 + "WINDOW"_ustr //SQL:2003 ; } OUString DatabaseMetaData::getNumericFunctions( ) { - // See http://www.postgresql.org/docs/9.1/static/functions-math.html - // LEM TODO: Err... http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Support_Scalar_Functions + // See https://www.postgresql.org/docs/9.1/static/functions-math.html + // LEM TODO: Err... https://wiki.documentfoundation.org/Documentation/DevGuide/Database_Access#Support_Scalar_Functions // says this should be "Open Group CLI" names, not PostgreSQL names. // Currently this is just a list of supported functions in PostgreSQL, with PostgreSQL names. // And it is my job to map from Open Group CLI names/syntax to PostgreSQL names/syntax. Where? By parsing the SQL??? // Should look at what the JDBC driver is doing. return - "abs," + u"abs," "cbrt," "ceil," "ceiling," @@ -345,7 +346,7 @@ OUString DatabaseMetaData::getNumericFunctions( ) "cos," "cot," "sin," - "tan" + "tan"_ustr ; } @@ -353,7 +354,7 @@ OUString DatabaseMetaData::getStringFunctions( ) { // See http://www.postgresql.org/docs/9.1/static/functions-string.html return - "bit_length," + u"bit_length," "char_length," "character_length," "lower," @@ -399,7 +400,7 @@ OUString DatabaseMetaData::getStringFunctions( ) "substr," "to_ascii," "to_hex," - "translate" + "translate"_ustr ; } @@ -408,7 +409,7 @@ OUString DatabaseMetaData::getSystemFunctions( ) // See http://www.postgresql.org/docs/9.1/static/functions-info.html // and http://www.postgresql.org/docs/9.1/static/functions-admin.html return - "current_catalog," + u"current_catalog," "current_database," "current_query," "current_schema," @@ -529,14 +530,14 @@ OUString DatabaseMetaData::getSystemFunctions( ) "pg_try_advisory_lock_shared," "pg_try_advisory_xact_lock," "pg_try_advisory_xact_lock_shared," - "pg_sleep" + "pg_sleep"_ustr ; } OUString DatabaseMetaData::getTimeDateFunctions( ) { // TODO return - "age," + u"age," "age," "clock_timestamp," "current_date," @@ -558,16 +559,16 @@ OUString DatabaseMetaData::getTimeDateFunctions( ) "now," "statement_timestamp," "timeofday," - "transaction_timestamp," + "transaction_timestamp,"_ustr ; } OUString DatabaseMetaData::getSearchStringEscape( ) { - return "\\"; + return u"\\"_ustr; } OUString DatabaseMetaData::getExtraNameCharacters( ) { - return "$"; + return u"$"_ustr; } sal_Bool DatabaseMetaData::supportsAlterTableWithAddColumn( ) @@ -722,17 +723,17 @@ sal_Bool DatabaseMetaData::supportsLimitedOuterJoins( ) OUString DatabaseMetaData::getSchemaTerm( ) { - return "SCHEMA"; + return u"SCHEMA"_ustr; } OUString DatabaseMetaData::getProcedureTerm( ) { - return "function"; + return u"function"_ustr; } OUString DatabaseMetaData::getCatalogTerm( ) { - return "DATABASE"; + return u"DATABASE"_ustr; } sal_Bool DatabaseMetaData::isCatalogAtStart( ) @@ -742,7 +743,7 @@ sal_Bool DatabaseMetaData::isCatalogAtStart( ) OUString DatabaseMetaData::getCatalogSeparator( ) { - return "."; + return u"."_ustr; } sal_Bool DatabaseMetaData::supportsSchemasInDataManipulation( ) @@ -909,7 +910,7 @@ sal_Int32 DatabaseMetaData::getIntSetting(const OUString& settingName) sal_Int32 DatabaseMetaData::getMaxNameLength() { if ( m_pSettings->maxNameLen == 0) - m_pSettings->maxNameLen = getIntSetting( "max_identifier_length" ); + m_pSettings->maxNameLen = getIntSetting( u"max_identifier_length"_ustr ); OSL_ENSURE(m_pSettings->maxNameLen, "postgresql-sdbc: maxNameLen is zero"); return m_pSettings->maxNameLen; } @@ -917,7 +918,7 @@ sal_Int32 DatabaseMetaData::getMaxNameLength() sal_Int32 DatabaseMetaData::getMaxIndexKeys() { if ( m_pSettings->maxIndexKeys == 0) - m_pSettings->maxIndexKeys = getIntSetting("max_index_keys"); + m_pSettings->maxIndexKeys = getIntSetting(u"max_index_keys"_ustr); OSL_ENSURE(m_pSettings->maxIndexKeys, "postgresql-sdbc: maxIndexKeys is zero"); return m_pSettings->maxIndexKeys; } @@ -1123,14 +1124,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables( // Take "inspiration" from JDBC driver // Ah, this is used to create a XResultSet manually... Try to do it directly in SQL Reference< XPreparedStatement > statement = m_origin->prepareStatement( - "SELECT " + u"SELECT " "DISTINCT ON (pg_namespace.nspname, relname ) " // avoid duplicates (pg_settings !) "pg_namespace.nspname, relname, relkind, pg_description.description " "FROM pg_namespace, pg_class LEFT JOIN pg_description ON pg_class.oid = pg_description.objoid " "WHERE relnamespace = pg_namespace.oid " "AND ( relkind = 'r' OR relkind = 'v') " "AND pg_namespace.nspname LIKE ? " - "AND relname LIKE ? " + "AND relname LIKE ? "_ustr // "ORDER BY pg_namespace.nspname || relname" ); @@ -1185,30 +1186,30 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables( namespace { // sort no schema first, then "public", then normal schemas, then internal schemas - int compare_schema(const OUString &nsA, std::u16string_view nsB) + int compare_schema(std::u16string_view nsA, std::u16string_view nsB) { - if (nsA.isEmpty()) + if (nsA.empty()) { return nsB.empty() ? 0 : -1; } else if (nsB.empty()) { - assert(!nsA.isEmpty()); + assert(!nsA.empty()); return 1; } - else if(nsA == "public") + else if(nsA == u"public") { return (nsB == u"public") ? 0 : -1; } else if(nsB == u"public") { - assert(nsA != "public"); + assert(nsA != u"public"); return 1; } - else if(nsA.startsWith("pg_")) + else if(o3tl::starts_with(nsA, u"pg_")) { if(o3tl::starts_with(nsB, u"pg_")) - return nsA.compareTo(nsB); + return nsA.compare(nsB); else return 1; } @@ -1218,7 +1219,7 @@ namespace } else { - return nsA.compareTo(nsB); + return nsA.compare(nsB); } } @@ -1244,7 +1245,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas( ) // <b>TABLE_SCHEM</b> string =&gt; schema name Reference< XStatement > statement = m_origin->createStatement(); Reference< XResultSet > rs = statement->executeQuery( - "SELECT nspname from pg_namespace" ); + u"SELECT nspname from pg_namespace"_ustr ); // LEM TODO: look at JDBC driver and consider doing the same // in particular, excluding temporary schemas, but maybe better through pg_is_other_temp_schema(oid) OR == pg_my_temp_schema() @@ -1364,9 +1365,9 @@ namespace { { DatabaseTypeDescription() {} - DatabaseTypeDescription( const OUString &name, const OUString & type ) : - typeName( name ), - typeType( type ) + DatabaseTypeDescription( OUString name, OUString type ) : + typeName(std::move( name )), + typeType(std::move( type )) {} DatabaseTypeDescription( const DatabaseTypeDescription &source ) : typeName( source.typeName ), @@ -1405,8 +1406,7 @@ static void columnMetaData2DatabaseTypeDescription( oidMap[row->getInt(12)] = DatabaseTypeDescription(); if( domains ) queryBuf.append( " OR " ); - queryBuf.append( "oid = " ); - queryBuf.append( row->getInt(12 ) ); + queryBuf.append( "oid = " + OUString::number( row->getInt(12 ) ) ); domains ++; } } @@ -1534,8 +1534,8 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns( columnMetaData2DatabaseTypeDescription( domainMap, rs, domainTypeStmt ); sal_uInt32 colNum(0); - OUString sSchema( "#invalid#" ); - OUString sTable( "#invalid#" ); + OUString sSchema( u"#invalid#"_ustr ); + OUString sTable( u"#invalid#"_ustr ); while( rs->next() ) { @@ -1685,14 +1685,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( << schema << "." << table); Reference< XPreparedStatement > statement = m_origin->prepareStatement( - "SELECT nmsp.nspname, " + u"SELECT nmsp.nspname, " "cl.relname, " "con.conkey, " "con.conname, " "con.conrelid " "FROM pg_constraint as con,pg_class as cl, pg_namespace as nmsp " "WHERE con.connamespace = nmsp.oid AND con.conrelid = cl.oid AND con.contype = 'p' " - "AND nmsp.nspname LIKE ? AND cl.relname LIKE ?" ); + "AND nmsp.nspname LIKE ? AND cl.relname LIKE ?"_ustr ); Reference< XParameters > parameters( statement, UNO_QUERY_THROW ); parameters->setString( 1 , schema ); @@ -1753,9 +1753,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( row[4] >>= tableOid; row[3] >>= attnum; statement = m_origin->prepareStatement( - "SELECT att.attname FROM " + u"SELECT att.attname FROM " "pg_attribute AS att, pg_class AS cl WHERE " - "att.attrelid = ? AND att.attnum = ?" ); + "att.attrelid = ? AND att.attnum = ?"_ustr ); parameters.set( statement, UNO_QUERY_THROW ); parameters->setString( 1 , tableOid ); @@ -1778,7 +1778,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( if( closeable.is() ) closeable->close(); } - ret[elements] = row; + ret[elements] = std::move(row); elements ++; } return new SequenceResultSet( @@ -1826,100 +1826,100 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( #define SQL_GET_REFERENCES_ORDER_NO_PTABLE "ORDER BY pkn.nspname, pkc.relname, conkeyseq" #define SQL_GET_REFERENCES_NONE_NONE_NONE_NONE \ - SQL_GET_REFERENCES \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + u"" SQL_GET_REFERENCES \ + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_NONE_NONE_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_SOME_NONE_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_SOME_NONE_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_PTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_NONE_SOME_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_FSCHEMA \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_NONE_NONE_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_NONE_SOME_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_FSCHEMA \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_NONE_SOME_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_FSCHEMA \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_NONE_NONE_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_NONE_SOME_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_FSCHEMA \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_NO_PTABLE + SQL_GET_REFERENCES_ORDER_NO_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_SOME_SOME_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FSCHEMA \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_SOME_NONE_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_NONE_SOME_SOME_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FSCHEMA \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_SOME_SOME_NONE \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FSCHEMA \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_SOME_NONE_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr #define SQL_GET_REFERENCES_SOME_SOME_SOME_SOME \ - SQL_GET_REFERENCES \ + u"" SQL_GET_REFERENCES \ SQL_GET_REFERENCES_PSCHEMA \ SQL_GET_REFERENCES_PTABLE \ SQL_GET_REFERENCES_FSCHEMA \ SQL_GET_REFERENCES_FTABLE \ - SQL_GET_REFERENCES_ORDER_SOME_PTABLE + SQL_GET_REFERENCES_ORDER_SOME_PTABLE ""_ustr void DatabaseMetaData::init_getReferences_stmt () { @@ -2086,45 +2086,45 @@ namespace OUString nameB; a[0 /*TYPE_NAME*/] >>= nameA; b[0 /*TYPE_NAME*/] >>= nameB; - OUString nsA, tnA, nsB, tnB; + std::u16string_view nsA, tnA, nsB, tnB; // parse typename into schema and typename sal_Int32 nIndex=0; - nsA = nameA.getToken(0, '.', nIndex); + nsA = o3tl::getToken(nameA, 0, '.', nIndex); if (nIndex<0) { tnA = nsA; - nsA.clear(); + nsA = std::u16string_view(); } else { - tnA = nameA.getToken(0, '.', nIndex); + tnA = o3tl::getToken(nameA, 0, '.', nIndex); assert(nIndex < 0); } nIndex=0; - nsB = nameB.getToken(0, '.', nIndex); + nsB = o3tl::getToken(nameB, 0, '.', nIndex); if (nIndex<0) { tnB = nsB; - nsB.clear(); + nsB = std::u16string_view(); } else { - tnB = nameB.getToken(0, '.', nIndex); + tnB = o3tl::getToken(nameB, 0, '.', nIndex); assert(nIndex < 0); } const int ns_comp = compare_schema(nsA, nsB); if(ns_comp == 0) { - if(nsA.isEmpty()) + if(nsA.empty()) { - assert(nsB.isEmpty()); + assert(nsB.empty()); // within each type category, sort privileged choice first - if( tnA == "int4" || tnA == "varchar" || tnA == "char" || tnA == "text") + if( tnA == u"int4" || tnA == u"varchar" || tnA == u"char" || tnA == u"text") return true; - if( tnB == "int4" || tnB == "varchar" || tnB == "char" || tnB == "text") + if( tnB == u"int4" || tnB == u"varchar" || tnB == u"char" || tnB == u"text") return false; } return nameA.compareTo( nameB ) < 0; @@ -2226,12 +2226,12 @@ namespace // in postgresql the upper limit is optional, no limit means unlimited // length (=1GB). precision = 0x40000000; // about 1 GB, see character type docs in postgresql - row[CREATE_PARAMS] <<= OUString("length"); + row[CREATE_PARAMS] <<= u"length"_ustr; } else if( dataType == css::sdbc::DataType::NUMERIC ) { precision = 1000; - row[CREATE_PARAMS] <<= OUString("length, scale"); + row[CREATE_PARAMS] <<= u"length, scale"_ustr; } row[TYPE_NAME] <<= construct_full_typename(xRow->getString(6), xRow->getString(1)); @@ -2243,15 +2243,15 @@ namespace row[NULLABLE] <<= OUString::number(nullable); row[CASE_SENSITIVE] <<= OUString::number(1); row[SEARCHABLE] <<= OUString::number( calcSearchable( dataType ) ); - row[UNSIGNED_ATTRIBUTE] <<= OUString("0"); + row[UNSIGNED_ATTRIBUTE] <<= u"0"_ustr; if( css::sdbc::DataType::INTEGER == dataType || css::sdbc::DataType::BIGINT == dataType ) - row[AUTO_INCREMENT] <<= OUString("1"); // TODO + row[AUTO_INCREMENT] <<= u"1"_ustr; // TODO else - row[AUTO_INCREMENT] <<= OUString("0"); // TODO - row[MINIMUM_SCALE] <<= OUString("0"); // TODO: what is this ? + row[AUTO_INCREMENT] <<= u"0"_ustr; // TODO + row[MINIMUM_SCALE] <<= u"0"_ustr; // TODO: what is this ? row[MAXIMUM_SCALE] <<= OUString::number( getMaxScale( dataType ) ); - row[NUM_PREC_RADIX] <<= OUString("10"); // TODO: what is this ? + row[NUM_PREC_RADIX] <<= u"10"_ustr; // TODO: what is this ? vec.push_back( row ); } } @@ -2267,7 +2267,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( ) Reference< XStatement > statement = m_origin->createStatement(); Reference< XResultSet > rs = statement->executeQuery( - "SELECT pg_type.typname AS typname," //1 + u"SELECT pg_type.typname AS typname," //1 "pg_type.typtype AS typtype," //2 "pg_type.typlen AS typlen," //3 "pg_type.typnotnull AS typnotnull," //4 @@ -2275,7 +2275,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( ) "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'" + "OR pg_type.typtype = 'p'"_ustr ); std::vector< std::vector<Any> > vec; @@ -2283,14 +2283,14 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( ) // check for domain types rs = statement->executeQuery( - "SELECT t1.typname as typname," + u"SELECT t1.typname as typname," "t2.typtype AS typtype," "t2.typlen AS typlen," "t2.typnotnull AS typnotnull," "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'" ); + "WHERE t1.typtype = 'd'"_ustr ); pgTypeInfo2ResultSet( vec, rs ); std::sort( vec.begin(), vec.end(), TypeInfoByDataTypeSorter() ); @@ -2362,7 +2362,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo( static const sal_Int32 R_COLUMN_NAME = 8; Reference< XPreparedStatement > stmt = m_origin->prepareStatement( - "SELECT nspname, " // 1 + u"SELECT nspname, " // 1 "pg_class.relname, " // 2 "class2.relname, " // 3 "indisclustered, " // 4 @@ -2372,7 +2372,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo( "FROM pg_index INNER JOIN pg_class ON indrelid = pg_class.oid " "INNER JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid " "INNER JOIN pg_class as class2 ON pg_index.indexrelid = class2.oid " - "WHERE nspname = ? AND pg_class.relname = ?" ); + "WHERE nspname = ? AND pg_class.relname = ?"_ustr ); Reference< XParameters > param ( stmt, UNO_QUERY_THROW ); param->setString( 1, schema ); @@ -2385,11 +2385,11 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo( { std::vector< sal_Int32 > columns = parseIntArray( xRow->getString(C_COLUMNS) ); Reference< XPreparedStatement > columnsStmt = m_origin->prepareStatement( - "SELECT attnum, attname " + u"SELECT attnum, attname " "FROM pg_attribute " " INNER JOIN pg_class ON attrelid = pg_class.oid " " INNER JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid " - " WHERE pg_namespace.nspname=? AND pg_class.relname=?" ); + " WHERE pg_namespace.nspname=? AND pg_class.relname=?"_ustr ); Reference< XParameters > paramColumn ( columnsStmt, UNO_QUERY_THROW ); OUString currentSchema = xRow->getString( C_SCHEMA ); OUString currentTable = xRow->getString( C_TABLENAME ); |