Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/connectivity/source/drivers/file/FDatabaseMetaData.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <config_fuzzers.h>
21
22
#include <file/FDatabaseMetaData.hxx>
23
#include <FDatabaseMetaDataResultSet.hxx>
24
#include <com/sun/star/sdbc/ResultSetType.hpp>
25
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
26
#include <com/sun/star/ucb/SortedDynamicResultSetFactory.hpp>
27
#include <tools/urlobj.hxx>
28
#include <sal/log.hxx>
29
#include <file/FDriver.hxx>
30
#include <file/FTable.hxx>
31
#include <comphelper/processfactory.hxx>
32
#include <comphelper/diagnose_ex.hxx>
33
#include <ucbhelper/content.hxx>
34
35
using namespace com::sun::star::ucb;
36
using namespace connectivity::file;
37
using namespace connectivity;
38
using namespace com::sun::star::uno;
39
using namespace com::sun::star::beans;
40
using namespace com::sun::star::sdbc;
41
using namespace com::sun::star::sdbcx;
42
using namespace com::sun::star::container;
43
44
19.4k
ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
45
19.4k
                        ,m_pConnection(_pCon)
46
19.4k
{
47
19.4k
}
48
49
ODatabaseMetaData::~ODatabaseMetaData()
50
19.4k
{
51
19.4k
}
52
53
Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw(  )
54
0
{
55
0
    return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTypeInfo );
56
0
}
57
58
OUString ODatabaseMetaData::impl_getCatalogSeparator_throw(  )
59
9.73k
{
60
9.73k
    return OUString();
61
9.73k
}
62
63
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
64
        const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*tableNamePattern*/,
65
        const OUString& /*columnNamePattern*/ )
66
0
{
67
0
    SAL_WARN("connectivity.drivers", "ODatabaseMetaData::getColumns() should be overridden!");
68
0
    return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns );
69
0
}
70
71
72
namespace
73
{
74
#if !ENABLE_FUZZERS
75
    sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, std::u16string_view _rDocName )
76
    {
77
        sal_Int16 nIsCS = 1;
78
        try
79
        {
80
            // first get the real content for the URL
81
            INetURLObject aContentURL( _rFolderOrDoc );
82
            ::ucbhelper::Content aContent1;
83
            {
84
                ::ucbhelper::Content aFolderOrDoc( _rFolderOrDoc, Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
85
                if ( aFolderOrDoc.isDocument() )
86
                    aContent1 = std::move(aFolderOrDoc);
87
                else
88
                {
89
                    aContentURL = INetURLObject( _rFolderOrDoc, INetURLObject::EncodeMechanism::WasEncoded );
90
                    aContentURL.Append( _rDocName );
91
                    aContent1 = ::ucbhelper::Content( aContentURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
92
                }
93
            }
94
95
            // get two extensions which differ by case only
96
            OUString sExtension1(aContentURL.getExtension());
97
            OUString sExtension2(sExtension1.toAsciiLowerCase());
98
            if (sExtension2 == sExtension1)
99
            {
100
                // the extension was already in lower case
101
                sExtension2 = sExtension2.toAsciiUpperCase();
102
            }
103
104
            // the complete URL for the second extension
105
            INetURLObject aURL2( aContentURL );
106
            if (!sExtension2.isEmpty())
107
                aURL2.SetExtension( sExtension2 );
108
            if ( aURL2.GetMainURL(INetURLObject::DecodeMechanism::NONE) == aContentURL.GetMainURL(INetURLObject::DecodeMechanism::NONE) )
109
                return -1;
110
111
            // the second context
112
            bool bCanAccess = false;
113
            ::ucbhelper::Content aContent2;
114
            try
115
            {
116
                aContent2 = ::ucbhelper::Content( aURL2.GetMainURL( INetURLObject::DecodeMechanism::NONE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
117
                bCanAccess = aContent2.isDocument();
118
            }
119
            catch( const Exception& )
120
            {
121
            }
122
123
            if ( bCanAccess )
124
            {
125
                // here we have two contents whose URLs differ by case only.
126
                // Now let's check if both really refer to the same object...
127
                Reference< XContent > xContent1 = aContent1.get();
128
                Reference< XContent > xContent2 = aContent2.get();
129
                OSL_ENSURE( xContent1.is() && xContent2.is(), "isCaseSensitiveParentFolder: invalid content interfaces!" );
130
                if ( xContent1.is() && xContent2.is() )
131
                {
132
                    Reference< XContentIdentifier > xID1 = xContent1->getIdentifier();
133
                    Reference< XContentIdentifier > xID2 = xContent2->getIdentifier();
134
                    OSL_ENSURE( xID1.is() && xID2.is(), "isCaseSensitiveParentFolder: invalid ID interfaces!" );
135
                    if ( xID1.is() && xID2.is()
136
                         && ( UniversalContentBroker::create(
137
                                  comphelper::getProcessComponentContext() )->
138
                              compareContentIds( xID1, xID2 ) == 0 ) )
139
                    {
140
                        // finally, we know that the folder is not case-sensitive...
141
                        nIsCS = 0;
142
                    }
143
                }
144
            }
145
        }
146
        catch( const Exception& )
147
        {
148
            TOOLS_WARN_EXCEPTION( "connectivity.drivers", "isCaseSensitiveParentFolder" );
149
        }
150
151
        return nIsCS;
152
    }
153
#endif
154
}
155
156
157
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
158
        const Any& /*catalog*/, const OUString& /*schemaPattern*/,
159
        const OUString& tableNamePattern, const Sequence< OUString >& types )
160
57.9k
{
161
57.9k
    ::osl::MutexGuard aGuard( m_aMutex );
162
163
57.9k
    rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTables );
164
165
    // check if any type is given
166
    // when no types are given then we have to return all tables e.g. TABLE
167
168
57.9k
    static constexpr OUString aTable = u"TABLE"_ustr;
169
170
57.9k
    bool bTableFound
171
57.9k
        = !types.hasElements() || std::find(types.begin(), types.end(), aTable) != types.end();
172
57.9k
    if(!bTableFound)
173
0
        return pResult;
174
175
57.9k
    Reference<XDynamicResultSet> xContent = m_pConnection->getDir();
176
57.9k
    Reference < XSortedDynamicResultSetFactory > xSRSFac =
177
57.9k
                SortedDynamicResultSetFactory::create( m_pConnection->getDriver()->getComponentContext() );
178
179
57.9k
    Sequence< NumberedSortingInfo > aSortInfo( 1 );
180
57.9k
    NumberedSortingInfo* pInfo = aSortInfo.getArray();
181
57.9k
    pInfo[ 0 ].ColumnIndex = 1;
182
57.9k
    pInfo[ 0 ].Ascending   = true;
183
184
57.9k
    Reference < XAnyCompareFactory > xFactory;
185
57.9k
    Reference< XDynamicResultSet > xDynamicResultSet = xSRSFac->createSortedDynamicResultSet( xContent, aSortInfo, xFactory );
186
57.9k
    Reference<XResultSet> xResultSet = xDynamicResultSet->getStaticResultSet();
187
188
57.9k
    Reference<XRow> xRow(xResultSet,UNO_QUERY);
189
190
57.9k
    OUString aFilenameExtension = m_pConnection->getExtension();
191
57.9k
    OUString sThisContentExtension;
192
57.9k
    ODatabaseMetaDataResultSet::ORows aRows;
193
    // scan the directory for tables
194
57.9k
    OUString aName;
195
57.9k
    INetURLObject aURL;
196
57.9k
    xResultSet->beforeFirst();
197
198
57.9k
    bool bKnowCaseSensitivity = false;
199
57.9k
    bool bCaseSensitiveDir = true;
200
57.9k
    bool bCheckEnabled = m_pConnection->isCheckEnabled();
201
202
115k
    while(xResultSet->next())
203
57.9k
    {
204
57.9k
        aName = xRow->getString(1);
205
57.9k
        aURL.SetSmartProtocol(INetProtocol::File);
206
57.9k
        OUString sUrl = m_pConnection->getURL() + "/" + aName;
207
57.9k
        aURL.SetSmartURL( sUrl );
208
57.9k
        sThisContentExtension = aURL.getExtension();
209
210
57.9k
        ODatabaseMetaDataResultSet::ORow aRow { nullptr, nullptr, nullptr };
211
57.9k
        aRow.reserve(6);
212
57.9k
        bool bNewRow = false;
213
214
57.9k
        if ( !bKnowCaseSensitivity )
215
57.9k
        {
216
57.9k
            bKnowCaseSensitivity = true;
217
57.9k
#if ENABLE_FUZZERS
218
57.9k
            sal_Int16 nCase = 1;
219
#else
220
            sal_Int16 nCase = isCaseSensitiveParentFolder( m_pConnection->getURL(), aURL.getName() );
221
#endif
222
57.9k
            switch( nCase )
223
57.9k
            {
224
57.9k
            case 1:
225
57.9k
                bCaseSensitiveDir = true;
226
57.9k
                break;
227
0
            case -1:
228
0
                bKnowCaseSensitivity = false;
229
0
                [[fallthrough]];
230
0
            case 0:
231
0
                bCaseSensitiveDir = false;
232
57.9k
            }
233
57.9k
            if ( bKnowCaseSensitivity )
234
57.9k
            {
235
57.9k
                m_pConnection->setCaseSensitiveExtension( bCaseSensitiveDir, OConnection::GrantAccess() );
236
57.9k
                if ( !bCaseSensitiveDir )
237
0
                {
238
0
                    aFilenameExtension = aFilenameExtension.toAsciiLowerCase();
239
0
                }
240
57.9k
            }
241
57.9k
        }
242
243
57.9k
        if (!aFilenameExtension.isEmpty())
244
57.9k
        {
245
57.9k
            if ( !bCaseSensitiveDir )
246
0
            {
247
0
                sThisContentExtension = sThisContentExtension.toAsciiLowerCase();
248
0
            }
249
250
57.9k
            if ( sThisContentExtension == aFilenameExtension )
251
57.9k
            {
252
57.9k
                aName = aName.copy(0, (aName.getLength()-(aFilenameExtension.getLength()+1)));
253
57.9k
                sal_Unicode nChar = aName.toChar();
254
57.9k
                if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || (nChar < '0' || nChar > '9')) )
255
57.9k
                {
256
57.9k
                    aRow.push_back(new ORowSetValueDecorator(aName));
257
57.9k
                    bNewRow = true;
258
57.9k
                }
259
57.9k
            }
260
57.9k
        }
261
0
        else // no extension, filter myself
262
0
        {
263
0
            for (;;)
264
0
            {
265
0
                if (aURL.getExtension().isEmpty())
266
0
                {
267
0
                    sal_Unicode nChar = aURL.getBase()[0];
268
0
                    if( match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || nChar < '0' || nChar > '9' ) )
269
0
                    {
270
0
                        aRow.push_back(new ORowSetValueDecorator(aURL.getBase()));
271
0
                        bNewRow = true;
272
0
                    }
273
0
                    break;
274
0
                }
275
0
                if ( !xResultSet->next() )
276
0
                {
277
0
                    break;
278
0
                }
279
0
                aName = xRow->getString(1);
280
0
                aURL.SetSmartURL(aName);
281
0
            }
282
0
        }
283
57.9k
        if(bNewRow)
284
57.9k
        {
285
57.9k
            aRow.push_back(new ORowSetValueDecorator(aTable));
286
57.9k
            aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
287
288
57.9k
            aRows.push_back(std::move(aRow));
289
57.9k
        }
290
57.9k
    }
291
292
57.9k
    pResult->setRows(std::move(aRows));
293
294
57.9k
    return pResult;
295
57.9k
}
296
297
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength(  )
298
0
{
299
0
    return 0;
300
0
}
301
302
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize(  )
303
0
{
304
0
    return 0;
305
0
}
306
307
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength(  )
308
0
{
309
0
    return 0;
310
0
}
311
312
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength(  )
313
0
{
314
0
    return SAL_MAX_INT32;
315
0
}
316
317
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength(  )
318
0
{
319
0
    return 0;
320
0
}
321
322
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex(  )
323
0
{
324
0
    return 0;
325
0
}
326
327
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength(  )
328
0
{
329
0
    return 0;
330
0
}
331
332
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections(  )
333
0
{
334
0
    return 0;
335
0
}
336
337
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable(  )
338
0
{
339
0
    return 0;
340
0
}
341
342
sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw(  )
343
0
{
344
0
    return 0;
345
0
}
346
347
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength(  )
348
0
{
349
0
    return 0;
350
0
}
351
352
sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw(  )
353
9.73k
{
354
9.73k
    return 1;
355
9.73k
}
356
357
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
358
        const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& tableNamePattern )
359
0
{
360
0
    ::osl::MutexGuard aGuard( m_aMutex );
361
362
0
    rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
363
0
    ODatabaseMetaDataResultSet::ORows aRows;
364
365
0
    Reference< XTablesSupplier > xTabSup = m_pConnection->createCatalog();
366
0
    if( xTabSup.is())
367
0
    {
368
0
        Reference< XNameAccess> xNames      = xTabSup->getTables();
369
0
        for (const OUString& rName : xNames->getElementNames())
370
0
        {
371
0
            if (match(tableNamePattern, rName, '\0'))
372
0
            {
373
0
                ODatabaseMetaDataResultSet::ORow aRow(8);
374
375
0
                aRow[2] = new ORowSetValueDecorator(rName);
376
0
                aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
377
0
                aRow[7] = new ORowSetValueDecorator(u"NO"_ustr);
378
0
                aRows.push_back(aRow);
379
380
0
                if (auto xTable = xNames->getByName(rName).query<XPropertySet>())
381
0
                {
382
0
                    auto pTable = dynamic_cast<OFileTable*>(xTable.get());
383
0
                    if(pTable && !pTable->isReadOnly())
384
0
                    {
385
0
                        aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
386
0
                        aRows.push_back(aRow);
387
0
                        if(!m_pConnection->showDeleted())
388
0
                        {
389
0
                            aRow[6] = ODatabaseMetaDataResultSet::getDeleteValue();
390
0
                            aRows.push_back(aRow);
391
0
                        }
392
0
                        aRow[6] = ODatabaseMetaDataResultSet::getUpdateValue();
393
0
                        aRows.push_back(aRow);
394
0
                        aRow[6] = ODatabaseMetaDataResultSet::getCreateValue();
395
0
                        aRows.push_back(aRow);
396
0
                        aRow[6] = ODatabaseMetaDataResultSet::getReadValue();
397
0
                        aRows.push_back(aRow);
398
0
                        aRow[6] = ODatabaseMetaDataResultSet::getAlterValue();
399
0
                        aRows.push_back(aRow);
400
0
                        aRow[6] = ODatabaseMetaDataResultSet::getDropValue();
401
0
                        aRows.push_back(std::move(aRow));
402
0
                    }
403
0
                }
404
0
            }
405
0
        }
406
0
    }
407
408
0
    pResult->setRows(std::move(aRows));
409
0
    return pResult;
410
0
}
411
412
sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs(  )
413
0
{
414
0
    return true;
415
0
}
416
417
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers(  )
418
0
{
419
0
    return false;
420
0
}
421
422
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers(  )
423
0
{
424
0
    return false;
425
0
}
426
427
bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw(  )
428
0
{
429
0
    return false;
430
0
}
431
432
sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers(  )
433
0
{
434
0
    return false;
435
0
}
436
437
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers(  )
438
0
{
439
0
    return false;
440
0
}
441
442
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers(  )
443
0
{
444
0
    return false;
445
0
}
446
447
bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw(  )
448
0
{
449
0
    return false;
450
0
}
451
452
bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw(  )
453
0
{
454
0
    return false;
455
0
}
456
457
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength(  )
458
0
{
459
0
    return 0;
460
0
}
461
462
sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns(  )
463
0
{
464
0
    return false;
465
0
}
466
467
OUString SAL_CALL ODatabaseMetaData::getCatalogTerm(  )
468
0
{
469
0
    return OUString();
470
0
}
471
472
OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw(  )
473
9.73k
{
474
9.73k
    return u"\""_ustr;
475
9.73k
}
476
477
OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters(  )
478
0
{
479
0
    return OUString();
480
0
}
481
482
sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames(  )
483
0
{
484
0
    return true;
485
0
}
486
487
bool ODatabaseMetaData::impl_isCatalogAtStart_throw(  )
488
0
{
489
0
    return true;
490
0
}
491
492
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions(  )
493
0
{
494
0
    return true;
495
0
}
496
497
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit(  )
498
0
{
499
0
    return true;
500
0
}
501
502
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly(  )
503
0
{
504
0
    return false;
505
0
}
506
507
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions(  )
508
0
{
509
0
    return false;
510
0
}
511
512
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete(  )
513
0
{
514
0
    return false;
515
0
}
516
517
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate(  )
518
0
{
519
0
    return false;
520
0
}
521
522
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback(  )
523
0
{
524
0
    return false;
525
0
}
526
527
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit(  )
528
0
{
529
0
    return false;
530
0
}
531
532
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit(  )
533
0
{
534
0
    return false;
535
0
}
536
537
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback(  )
538
0
{
539
0
    return false;
540
0
}
541
542
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ )
543
0
{
544
0
    return false;
545
0
}
546
547
bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw(  )
548
9.73k
{
549
9.73k
    return false;
550
9.73k
}
551
552
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL(  )
553
0
{
554
0
    return false;
555
0
}
556
557
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL(  )
558
0
{
559
0
    return false;
560
0
}
561
562
sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility(  )
563
0
{
564
0
    return false;
565
0
}
566
567
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions(  )
568
0
{
569
0
    return false;
570
0
}
571
572
bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw(  )
573
0
{
574
0
    return false;
575
0
}
576
577
bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw(  )
578
0
{
579
0
    return false;
580
0
}
581
582
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions(  )
583
0
{
584
0
    return false;
585
0
}
586
587
bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw(  )
588
9.73k
{
589
9.73k
    return false;
590
9.73k
}
591
592
sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins(  )
593
0
{
594
0
    return false;
595
0
}
596
597
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes(  )
598
0
{
599
0
    rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTableTypes );
600
0
    ODatabaseMetaDataResultSet::ORows aRows;
601
0
    aRows.push_back( { ODatabaseMetaDataResultSet::getEmptyValue(), new ORowSetValueDecorator(u"TABLE"_ustr) } );
602
0
    pResult->setRows(std::move(aRows));
603
0
    return pResult;
604
0
}
605
606
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength(  )
607
0
{
608
0
    return 0;
609
0
}
610
611
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength(  )
612
0
{
613
0
    return 0;
614
0
}
615
616
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength(  )
617
0
{
618
0
    return 0;
619
0
}
620
621
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions(  )
622
0
{
623
0
    return false;
624
0
}
625
626
sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable(  )
627
0
{
628
0
    return false;
629
0
}
630
631
sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures(  )
632
0
{
633
0
    return false;
634
0
}
635
636
sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate(  )
637
0
{
638
0
    return false;
639
0
}
640
641
sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable(  )
642
0
{
643
0
    return true;
644
0
}
645
646
sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly(  )
647
0
{
648
0
    return true;
649
0
}
650
651
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles(  )
652
0
{
653
0
    return true;
654
0
}
655
656
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable(  )
657
0
{
658
0
    return true;
659
0
}
660
661
sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion(  )
662
0
{
663
0
    return false;
664
0
}
665
666
sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull(  )
667
0
{
668
0
    return true;
669
0
}
670
671
sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing(  )
672
0
{
673
0
    return true;
674
0
}
675
676
sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames(  )
677
0
{
678
0
    return true;
679
0
}
680
681
sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ )
682
0
{
683
0
    return false;
684
0
}
685
686
sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy(  )
687
0
{
688
0
    return false;
689
0
}
690
691
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy(  )
692
0
{
693
0
    return false;
694
0
}
695
696
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect(  )
697
0
{
698
0
    return false;
699
0
}
700
701
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated(  )
702
0
{
703
0
    return false;
704
0
}
705
706
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions(  )
707
0
{
708
0
    return false;
709
0
}
710
711
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets(  )
712
0
{
713
0
    return false;
714
0
}
715
716
sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause(  )
717
0
{
718
0
    return false;
719
0
}
720
721
sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated(  )
722
0
{
723
0
    return true;
724
0
}
725
726
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion(  )
727
0
{
728
0
    return false;
729
0
}
730
731
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll(  )
732
0
{
733
0
    return false;
734
0
}
735
736
sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers(  )
737
0
{
738
0
    return true;
739
0
}
740
741
bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw(  )
742
0
{
743
0
    return false;
744
0
}
745
746
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd(  )
747
0
{
748
0
    return false;
749
0
}
750
751
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart(  )
752
0
{
753
0
    return true;
754
0
}
755
756
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh(  )
757
0
{
758
0
    return false;
759
0
}
760
761
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow(  )
762
0
{
763
0
    return true;
764
0
}
765
766
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls(  )
767
0
{
768
0
    return false;
769
0
}
770
771
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions(  )
772
0
{
773
0
    return false;
774
0
}
775
776
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls(  )
777
0
{
778
0
    return false;
779
0
}
780
781
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions(  )
782
0
{
783
0
    return false;
784
0
}
785
786
sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries(  )
787
0
{
788
0
    return false;
789
0
}
790
791
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons(  )
792
0
{
793
0
    return false;
794
0
}
795
796
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists(  )
797
0
{
798
0
    return false;
799
0
}
800
801
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns(  )
802
0
{
803
0
    return false;
804
0
}
805
806
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds(  )
807
0
{
808
0
    return false;
809
0
}
810
811
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL(  )
812
0
{
813
0
    return false;
814
0
}
815
816
OUString SAL_CALL ODatabaseMetaData::getURL(  )
817
0
{
818
0
    return u"sdbc:file:"_ustr;
819
0
}
820
821
OUString SAL_CALL ODatabaseMetaData::getUserName(  )
822
0
{
823
0
    return OUString();
824
0
}
825
826
OUString SAL_CALL ODatabaseMetaData::getDriverName(  )
827
0
{
828
0
    return OUString();
829
0
}
830
831
OUString SAL_CALL ODatabaseMetaData::getDriverVersion(  )
832
0
{
833
0
    return OUString::number(1);
834
0
}
835
836
OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion(  )
837
0
{
838
0
    return OUString::number(0);
839
0
}
840
841
OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName(  )
842
0
{
843
0
    return OUString();
844
0
}
845
846
OUString SAL_CALL ODatabaseMetaData::getProcedureTerm(  )
847
0
{
848
0
    return OUString();
849
0
}
850
851
OUString SAL_CALL ODatabaseMetaData::getSchemaTerm(  )
852
0
{
853
0
    return OUString();
854
0
}
855
856
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion(  )
857
0
{
858
0
    return 0;
859
0
}
860
861
sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation(  )
862
0
{
863
0
    return 0;
864
0
}
865
866
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  )
867
0
{
868
0
    return 0;
869
0
}
870
871
OUString SAL_CALL ODatabaseMetaData::getSQLKeywords(  )
872
0
{
873
0
    return OUString();
874
0
}
875
876
OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape(  )
877
0
{
878
0
    return OUString();
879
0
}
880
881
OUString SAL_CALL ODatabaseMetaData::getStringFunctions(  )
882
0
{
883
0
    return u"UCASE,LCASE,ASCII,LENGTH,OCTET_LENGTH,CHAR_LENGTH,CHARACTER_LENGTH,CHAR,CONCAT,LOCATE,SUBSTRING,LTRIM,RTRIM,SPACE,REPLACE,REPEAT,INSERT,LEFT,RIGHT"_ustr;
884
0
}
885
886
OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions(  )
887
0
{
888
0
    return u"DAYOFWEEK,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,CURDATE,CURTIME,NOW"_ustr;
889
0
}
890
891
OUString SAL_CALL ODatabaseMetaData::getSystemFunctions(  )
892
0
{
893
0
    return OUString();
894
0
}
895
896
OUString SAL_CALL ODatabaseMetaData::getNumericFunctions(  )
897
0
{
898
0
    return u"ABS,SIGN,MOD,FLOOR,CEILING,ROUND,EXP,LN,LOG,LOG10,POWER,SQRT,PI,COS,SIN,TAN,ACOS,ASIN,ATAN,ATAN2,DEGREES,RADIANS"_ustr;
899
0
}
900
901
sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar(  )
902
0
{
903
0
    return false;
904
0
}
905
906
sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar(  )
907
0
{
908
0
    return false;
909
0
}
910
911
sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar(  )
912
0
{
913
0
    return true;
914
0
}
915
916
sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins(  )
917
0
{
918
0
    return false;
919
0
}
920
921
sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins(  )
922
0
{
923
0
    return false;
924
0
}
925
926
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy(  )
927
0
{
928
0
    return 0;
929
0
}
930
931
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy(  )
932
0
{
933
0
    return 0;
934
0
}
935
936
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect(  )
937
0
{
938
0
    return 0;
939
0
}
940
941
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength(  )
942
0
{
943
0
    return 0;
944
0
}
945
946
sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType )
947
0
{
948
0
    switch(setType)
949
0
    {
950
0
        case ResultSetType::FORWARD_ONLY:
951
0
            return true;
952
0
        case ResultSetType::SCROLL_INSENSITIVE:
953
0
        case ResultSetType::SCROLL_SENSITIVE:
954
0
            break;
955
0
    }
956
0
    return false;
957
0
}
958
959
sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 /*concurrency*/ )
960
0
{
961
0
    switch(setType)
962
0
    {
963
0
        case ResultSetType::FORWARD_ONLY:
964
0
            return true;
965
0
        case ResultSetType::SCROLL_INSENSITIVE:
966
0
        case ResultSetType::SCROLL_SENSITIVE:
967
0
            break;
968
0
    }
969
0
    return false;
970
0
}
971
972
sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ )
973
0
{
974
0
    return true;
975
0
}
976
977
sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ )
978
0
{
979
0
    return true;
980
0
}
981
982
sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ )
983
0
{
984
0
    return true;
985
0
}
986
987
sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ )
988
0
{
989
0
    return true;
990
0
}
991
992
sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ )
993
0
{
994
0
    return true;
995
0
}
996
997
sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ )
998
0
{
999
0
    return true;
1000
0
}
1001
1002
sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ )
1003
0
{
1004
0
    return false;
1005
0
}
1006
1007
sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ )
1008
0
{
1009
0
    return false;
1010
0
}
1011
1012
sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ )
1013
0
{
1014
0
    return false;
1015
0
}
1016
1017
sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates(  )
1018
0
{
1019
0
    return false;
1020
0
}
1021
1022
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ )
1023
0
{
1024
0
    return nullptr;
1025
0
}
1026
1027
1028
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */