LibreOffice Module connectivity (master) 1
mysqlc_databasemetadata.cxx
Go to the documentation of this file.
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 */
20#include <com/sun/star/sdbc/ResultSetType.hpp>
21#include <com/sun/star/sdbc/TransactionIsolation.hpp>
22#include <com/sun/star/sdbc/Deferrability.hpp>
23#include <com/sun/star/lang/XInitialization.hpp>
25#include <o3tl/string_view.hxx>
26
27#include <sal/log.hxx>
28#include <rtl/ustrbuf.hxx>
29#include "mysqlc_general.hxx"
30#include "mysqlc_driver.hxx"
32
33using namespace connectivity::mysqlc;
34using namespace com::sun::star::uno;
35using namespace com::sun::star::lang;
36using namespace com::sun::star::beans;
37using namespace com::sun::star::sdbc;
38
39static std::string wild("%");
40
41static void lcl_setRows_throw(const Reference<XResultSet>& _xResultSet, sal_Int32 _nType,
42 const std::vector<std::vector<Any>>& _rRows)
43{
44 Reference<XInitialization> xIni(_xResultSet, UNO_QUERY);
45
46 Sequence<Sequence<Any>> aRows(_rRows.size());
47
48 Sequence<Any>* pRowsIter = aRows.getArray();
49 for (const auto& rRow : _rRows)
50 {
51 if (!rRow.empty())
52 {
53 (*pRowsIter) = comphelper::containerToSequence(rRow);
54 }
55 ++pRowsIter;
56 }
57 Sequence<Any> aArgs{ Any(_nType), Any(aRows) };
58 xIni->initialize(aArgs);
59}
60
61ODatabaseMetaData::ODatabaseMetaData(OConnection& _rCon, MYSQL* pMySql)
62 : m_rConnection(_rCon)
63 , m_pMySql(pMySql)
64{
65}
66
68
69OUString SAL_CALL ODatabaseMetaData::getCatalogSeparator() { return OUString(); }
70
71sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength() { return 16777208L; }
72
74{
75 return 2147483647L - 8; // Max buffer size - HEADER
76}
77
78sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength() { return 32; }
79
80sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength() { return 16777208; }
81
82sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength() { return 64; }
83
84sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex() { return 16; }
85
86sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength() { return 64; }
87
89{
90 SAL_WARN("connectivity.mysqlc", "method not implemented");
91 // TODO
92 // SELECT @@max_connections
93 return 100;
94}
95
96sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable() { return 512; }
97
99{
100 SAL_WARN("connectivity.mysqlc", "method not implemented");
101 // TODO
102 // "SHOW VARIABLES LIKE 'max_allowed_packet'"
103 return 32767;
104}
105
106sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength() { return 64; }
107
108sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTablesInSelect() { return 256; }
109
111
113{
114 SAL_WARN("connectivity.mysqlc", "method not implemented");
115 // TODO
116 return false;
117}
118
120{
121 SAL_WARN("connectivity.mysqlc", "method not implemented");
122 //TODO;
123 return false;
124}
125
127{
128 SAL_WARN("connectivity.mysqlc", "method not implemented");
129 // TODO
130 return false;
131}
132
134{
135 // TODO
136 SAL_WARN("connectivity.mysqlc", "method not implemented");
137 return false;
138}
139
141{
142 // TODO
143 SAL_WARN("connectivity.mysqlc", "method not implemented");
144 return false;
145}
146
148{
149 // TODO
150 SAL_WARN("connectivity.mysqlc", "method not implemented");
151 return false;
152}
153
155
157
158sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength() { return 256; }
159
161
162OUString SAL_CALL ODatabaseMetaData::getCatalogTerm() { return "n/a"; }
163
164OUString SAL_CALL ODatabaseMetaData::getIdentifierQuoteString() { return "`"; }
165
166OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters() { return "#@"; }
167
169
171
173
175
177
179{
180 return false;
181}
182
184
186
188
190
192
194
196{
197 return true;
198}
199
201
203
205
207
209
211
213
215
217
219
220sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements() { return 0; }
221
222sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength() { return 64; }
223
224sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength() { return 64; }
225
227
229
231{
232 return m_rConnection.getMysqlVersion() >= 50000;
233}
234
236{
237 return m_rConnection.getMysqlVersion() >= 40000;
238}
239
241
242sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly() { return false; }
243
244sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles() { return false; }
245
247
249
251
253
255
256sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert(sal_Int32 /*fromType*/, sal_Int32 /*toType*/)
257{
258 // TODO
259 SAL_WARN("connectivity.mysqlc", "method not implemented");
260 return false;
261}
262
264
266
268
270
272
274
276
278
280{
281 return m_rConnection.getMysqlVersion() >= 40000;
282}
283
285{
286 return m_rConnection.getMysqlVersion() >= 40000;
287}
288
290
292
294
296{
297 return m_rConnection.getMysqlVersion() > 40001 && m_rConnection.getMysqlVersion() < 40011;
298}
299
301
303
305{
306 return m_rConnection.getMysqlVersion() >= 32200;
307}
308
310{
311 return m_rConnection.getMysqlVersion() >= 32200;
312}
313
315
317
319{
320 return m_rConnection.getMysqlVersion() >= 40100;
321}
322
324{
325 return m_rConnection.getMysqlVersion() >= 40100;
326}
327
329{
330 return m_rConnection.getMysqlVersion() >= 40100;
331}
332
334{
335 return m_rConnection.getMysqlVersion() >= 40100;
336}
337
339{
340 return m_rConnection.getMysqlVersion() >= 40100;
341}
342
344
345OUString SAL_CALL ODatabaseMetaData::getURL()
346{
348}
349
351{
352 Reference<XStatement> statement = m_rConnection.createStatement();
353 Reference<XResultSet> rs = statement->executeQuery("select user()");
354 Reference<XRow> xRow(rs, UNO_QUERY_THROW);
355 (void)rs->next(); // the first and only result
356 // e.g. root@localhost
357 OUString userWithConnection = xRow->getString(1);
358 sal_Int32 nIndexOfAt = userWithConnection.indexOf("@");
359 if (nIndexOfAt > 0)
360 {
361 OUString user = userWithConnection.copy(0, nIndexOfAt);
362 return user;
363 }
364 return userWithConnection;
365}
366
367OUString SAL_CALL ODatabaseMetaData::getDriverName() { return "MySQL Connector/OO.org"; }
368
369OUString SAL_CALL ODatabaseMetaData::getDriverVersion() { return "0.9.2"; }
370
372{
373 return OStringToOUString(mysql_get_server_info(m_pMySql),
375}
376
377OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName() { return "MySQL"; }
378
379OUString SAL_CALL ODatabaseMetaData::getProcedureTerm() { return "procedure"; }
380
381OUString SAL_CALL ODatabaseMetaData::getSchemaTerm() { return "database"; }
382
384{
385 // TODO
386 SAL_WARN("connectivity.mysqlc", "method not implemented");
387 return MARIADBC_VERSION_MAJOR;
388}
389
391{
392 return TransactionIsolation::REPEATABLE_READ;
393}
394
396{
397 // TODO
398 SAL_WARN("connectivity.mysqlc", "method not implemented");
399 return MARIADBC_VERSION_MINOR;
400}
401
403{
404 return "ACCESSIBLE, ADD, ALL,"
405 "ALTER, ANALYZE, AND, AS, ASC, ASENSITIVE, BEFORE,"
406 "BETWEEN, BIGINT, BINARY, BLOB, BOTH, BY, CALL,"
407 "CASCADE, CASE, CHANGE, CHAR, CHARACTER, CHECK,"
408 "COLLATE, COLUMN, CONDITION, CONNECTION, CONSTRAINT,"
409 "CONTINUE, CONVERT, CREATE, CROSS, CURRENT_DATE,"
410 "CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR,"
411 "DATABASE, DATABASES, DAY_HOUR, DAY_MICROSECOND,"
412 "DAY_MINUTE, DAY_SECOND, DEC, DECIMAL, DECLARE,"
413 "DEFAULT, DELAYED, DELETE, DESC, DESCRIBE,"
414 "DETERMINISTIC, DISTINCT, DISTINCTROW, DIV, DOUBLE,"
415 "DROP, DUAL, EACH, ELSE, ELSEIF, ENCLOSED,"
416 "ESCAPED, EXISTS, EXIT, EXPLAIN, FALSE, FETCH,"
417 "FLOAT, FLOAT4, FLOAT8, FOR, FORCE, FOREIGN, FROM,"
418 "FULLTEXT, GRANT, GROUP, HAVING, HIGH_PRIORITY,"
419 "HOUR_MICROSECOND, HOUR_MINUTE, HOUR_SECOND, IF,"
420 "IGNORE, IN, INDEX, INFILE, INNER, INOUT,"
421 "INSENSITIVE, INSERT, INT, INT1, INT2, INT3, INT4,"
422 "INT8, INTEGER, INTERVAL, INTO, IS, ITERATE, JOIN,"
423 "KEY, KEYS, KILL, LEADING, LEAVE, LEFT, LIKE,"
424 "LOCALTIMESTAMP, LOCK, LONG, LONGBLOB, LONGTEXT,"
425 "LOOP, LOW_PRIORITY, MATCH, MEDIUMBLOB, MEDIUMINT,"
426 "MEDIUMTEXT, MIDDLEINT, MINUTE_MICROSECOND,"
427 "MINUTE_SECOND, MOD, MODIFIES, NATURAL, NOT,"
428 "NO_WRITE_TO_BINLOG, NULL, NUMERIC, ON, OPTIMIZE,"
429 "OPTION, OPTIONALLY, OR, ORDER, OUT, OUTER,"
430 "OUTFILE, PRECISION, PRIMARY, PROCEDURE, PURGE,"
431 "RANGE, READ, READS, READ_ONLY, READ_WRITE, REAL,"
432 "REFERENCES, REGEXP, RELEASE, RENAME, REPEAT,"
433 "REPLACE, REQUIRE, RESTRICT, RETURN, REVOKE, RIGHT,"
434 "RLIKE, SCHEMA, SCHEMAS, SECOND_MICROSECOND, SELECT,"
435 "SENSITIVE, SEPARATOR, SET, SHOW, SMALLINT, SPATIAL,"
436 "SPECIFIC, SQL, SQLEXCEPTION, SQLSTATE, SQLWARNING,"
437 "SQL_BIG_RESULT, SQL_CALC_FOUND_ROWS, SQL_SMALL_RESULT,"
438 "SSL, STARTING, STRAIGHT_JOIN, TABLE, TERMINATED,"
439 "THEN, TINYBLOB, TINYINT, TINYTEXT, TO, TRAILING,"
440 "TRIGGER, TRUE, UNDO, UNION, UNIQUE, UNLOCK,"
441 "UNSIGNED, UPDATE, USAGE, USE, USING, UTC_DATE,"
442 "UTC_TIME, UTC_TIMESTAMP, VALUES, VARBINARY, VARCHAR,"
443 "VARCHARACTER, VARYING, WHEN, WHERE, WHILE, WITH,"
444 "WRITE, X509, XOR, YEAR_MONTH, ZEROFILL"
445 "GENERAL, IGNORE_SERVER_IDS, MASTER_HEARTBEAT_PERIOD,"
446 "MAXVALUE, RESIGNAL, SIGNAL, SLOW";
447}
448
449OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape() { return "\\"; }
450
452{
453 return "ASCII,BIN,BIT_LENGTH,CHAR,CHARACTER_LENGTH,CHAR_LENGTH,CONCAT,"
454 "CONCAT_WS,CONV,ELT,EXPORT_SET,FIELD,FIND_IN_SET,HEX,INSERT,"
455 "INSTR,LCASE,LEFT,LENGTH,LOAD_FILE,LOCATE,LOCATE,LOWER,LPAD,"
456 "LTRIM,MAKE_SET,MATCH,MID,OCT,OCTET_LENGTH,ORD,POSITION,"
457 "QUOTE,REPEAT,REPLACE,REVERSE,RIGHT,RPAD,RTRIM,SOUNDEX,"
458 "SPACE,STRCMP,SUBSTRING,SUBSTRING,SUBSTRING,SUBSTRING,"
459 "SUBSTRING_INDEX,TRIM,UCASE,UPPER";
460}
461
463{
464 return "DAYOFWEEK,WEEKDAY,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,"
465 "MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,PERIOD_ADD,"
466 "PERIOD_DIFF,TO_DAYS,FROM_DAYS,DATE_FORMAT,TIME_FORMAT,"
467 "CURDATE,CURRENT_DATE,CURTIME,CURRENT_TIME,NOW,SYSDATE,"
468 "CURRENT_TIMESTAMP,UNIX_TIMESTAMP,FROM_UNIXTIME,"
469 "SEC_TO_TIME,TIME_TO_SEC";
470}
471
473{
474 return "DATABASE,USER,SYSTEM_USER,"
475 "SESSION_USER,PASSWORD,ENCRYPT,LAST_INSERT_ID,VERSION";
476}
477
479{
480 return "ABS,ACOS,ASIN,ATAN,ATAN2,BIT_COUNT,CEILING,COS,"
481 "COT,DEGREES,EXP,FLOOR,LOG,LOG10,MAX,MIN,MOD,PI,POW,"
482 "POWER,RADIANS,RAND,ROUND,SIN,SQRT,TAN,TRUNCATE";
483}
484
486
488
490
492
494
495sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy() { return 64; }
496
497sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy() { return 64; }
498
499sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect() { return 256; }
500
501sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength() { return 16; }
502
504{
505 return setType == ResultSetType::SCROLL_SENSITIVE;
506}
507
509 sal_Int32 /*concurrency*/)
510{
511 return false;
512}
513
514sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible(sal_Int32 /*setType*/) { return false; }
515
516sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible(sal_Int32 /*setType*/) { return false; }
517
518sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible(sal_Int32 /*setType*/) { return false; }
519
521{
522 return false;
523}
524
526{
527 return false;
528}
529
531{
532 return false;
533}
534
535sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected(sal_Int32 /*setType*/) { return false; }
536
537sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected(sal_Int32 /*setType*/) { return false; }
538
539sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected(sal_Int32 /*setType*/) { return false; }
540
542
543Reference<XConnection> SAL_CALL ODatabaseMetaData::getConnection() { return &m_rConnection; }
544
545/*
546 Here follow all methods which return(a resultset
547 the first methods is an example implementation how to use this resultset
548 of course you could implement it on your and you should do this because
549 the general way is more memory expensive
550*/
551
552Reference<XResultSet> SAL_CALL ODatabaseMetaData::getTableTypes()
553{
554 const char* const table_types[] = { "TABLE", "VIEW" };
555 sal_Int32 const requiredVersion[] = { 0, 50000 };
556
557 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
558 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
559 UNO_QUERY);
560 std::vector<std::vector<Any>> rRows;
561 rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
562
563 for (sal_uInt32 i = 0; i < 2; i++)
564 {
565 if (m_rConnection.getMysqlVersion() >= requiredVersion[i])
566 {
567 rRows.push_back(
568 { { Any(), Any(mysqlc_sdbc_driver::convert(table_types[i], encoding)) } });
569 }
570 }
571 lcl_setRows_throw(xResultSet, 5, rRows);
572 return xResultSet;
573}
574
575Reference<XResultSet> SAL_CALL ODatabaseMetaData::getTypeInfo()
576{
577 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
578 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
579 UNO_QUERY);
580
581 std::vector<std::vector<Any>> rRows;
582
583 rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
584 unsigned int i = 0;
585 while (mysqlc_types[i].typeName)
586 {
587 rRows.push_back(
590 Any(mysqlc_sdbc_driver::convert(mysqlc_types[i].literalPrefix, encoding)),
591 Any(mysqlc_sdbc_driver::convert(mysqlc_types[i].literalSuffix, encoding)),
592 Any(mysqlc_sdbc_driver::convert(mysqlc_types[i].createParams, encoding)),
593 Any(mysqlc_types[i].nullable), Any(mysqlc_types[i].caseSensitive),
594 Any(mysqlc_types[i].searchable), Any(mysqlc_types[i].isUnsigned),
595 Any(mysqlc_types[i].fixedPrecScale), Any(mysqlc_types[i].autoIncrement),
596 Any(mysqlc_sdbc_driver::convert(mysqlc_types[i].localTypeName, encoding)),
597 Any(mysqlc_types[i].minScale), Any(mysqlc_types[i].maxScale), Any(sal_Int32(0)),
598 Any(sal_Int32(0)), Any(sal_Int32(10)) } });
599
600 i++;
601 }
602
603 lcl_setRows_throw(xResultSet, 14, rRows);
604 return xResultSet;
605}
606
607Reference<XResultSet> SAL_CALL ODatabaseMetaData::getCatalogs()
608{
609 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
610 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
611 UNO_QUERY);
612 return xResultSet;
613}
614
615Reference<XResultSet> SAL_CALL ODatabaseMetaData::getSchemas()
616{
617 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
618 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
619 UNO_QUERY);
620 std::vector<std::vector<Any>> rRows;
621
622 Reference<XStatement> statement = m_rConnection.createStatement();
623 Reference<XInterface> executed = statement->executeQuery(
624 u"SELECT SCHEMA_NAME AS TABLE_SCHEM, CATALOG_NAME AS TABLE_CATALOG FROM INFORMATION_SCHEMA.SCHEMATA \
625 WHERE SCHEMA_NAME NOT IN ('information_schema', 'mysql', 'performance_schema') \
626 ORDER BY SCHEMA_NAME");
627 Reference<XResultSet> rs(executed, UNO_QUERY_THROW);
628 Reference<XResultSetMetaDataSupplier> supp(executed, UNO_QUERY_THROW);
629 Reference<XResultSetMetaData> rs_meta = supp->getMetaData();
630
631 Reference<XRow> xRow(rs, UNO_QUERY_THROW);
632 sal_uInt32 columns = rs_meta->getColumnCount();
633 while (rs->next())
634 {
635 std::vector<Any> aRow{ Any() };
636 for (sal_uInt32 i = 1; i <= columns; i++)
637 {
638 OUString columnStringValue = xRow->getString(i);
639 aRow.push_back(Any(columnStringValue));
640 }
641 rRows.push_back(aRow);
642 }
643
644 lcl_setRows_throw(xResultSet, 1, rRows);
645 return xResultSet;
646}
647
648Reference<XResultSet>
649 SAL_CALL ODatabaseMetaData::getColumnPrivileges(const Any& /*catalog*/, const OUString& schema,
650 const OUString& table,
651 const OUString& columnNamePattern)
652{
653 OUString query("SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS "
654 "TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, NULL AS GRANTOR, "
655 "GRANTEE, PRIVILEGE_TYPE AS PRIVILEGE, IS_GRANTABLE FROM "
656 "INFORMATION_SCHEMA.COLUMN_PRIVILEGES WHERE TABLE_SCHEMA LIKE "
657 "'?' AND TABLE_NAME='?' AND COLUMN_NAME LIKE '?' ORDER BY "
658 "COLUMN_NAME, PRIVILEGE_TYPE");
659
660 query = query.replaceFirst("?", schema);
661 query = query.replaceFirst("?", table);
662 query = query.replaceFirst("?", columnNamePattern);
663
664 Reference<XStatement> statement = m_rConnection.createStatement();
665 Reference<XResultSet> rs = statement->executeQuery(query);
666 return rs;
667}
668
669Reference<XResultSet> SAL_CALL ODatabaseMetaData::getColumns(const Any& /*catalog*/,
670 const OUString& schemaPattern,
671 const OUString& tableNamePattern,
672 const OUString& columnNamePattern)
673{
674 OUStringBuffer queryBuf("SELECT TABLE_CATALOG, " // 1
675 "TABLE_SCHEMA, " // 2
676 "TABLE_NAME, " // 3
677 "COLUMN_NAME, " // 4
678 "DATA_TYPE, " // 5
679 // TYPE_NAME missing
680 "CHARACTER_MAXIMUM_LENGTH, " // 6
681 "NUMERIC_PRECISION, " // 7
682 // buffer length missing
683 "NUMERIC_SCALE AS DECIMAL_DIGITS, " // 8
684 // NUM_PREC_RADIX missing
685 // NULLABLE missing
686 "COLUMN_COMMENT AS REMARKS, " // 9
687 "COLUMN_DEFAULT AS COLUMN_DEF," // 10
688 "CHARACTER_OCTET_LENGTH, " // 11
689 "ORDINAL_POSITION, " // 12
690 "IS_NULLABLE, " // 13
691 "COLUMN_TYPE " // 14
692 "FROM INFORMATION_SCHEMA.COLUMNS "
693 "WHERE (1 = 1) ");
694 if (!tableNamePattern.isEmpty())
695 {
696 OUString sAppend;
697 if (tableNamePattern.match("%"))
698 sAppend = "AND TABLE_NAME LIKE '%' ";
699 else
700 sAppend = "AND TABLE_NAME = '%' ";
701 queryBuf.append(sAppend.replaceAll("%", tableNamePattern));
702 }
703 if (!schemaPattern.isEmpty())
704 {
705 OUString sAppend;
706 if (schemaPattern.match("%"))
707 sAppend = "AND TABLE_SCHEMA LIKE '%' ";
708 else
709 sAppend = "AND TABLE_SCHEMA = '%' ";
710 queryBuf.append(sAppend.replaceAll("%", schemaPattern));
711 }
712 if (!columnNamePattern.isEmpty())
713 {
714 OUString sAppend;
715 if (columnNamePattern.match("%"))
716 sAppend = "AND COLUMN_NAME LIKE '%' ";
717 else
718 sAppend = "AND COLUMN_NAME = '%' ";
719 queryBuf.append(sAppend.replaceAll("%", columnNamePattern));
720 }
721
722 OUString query = queryBuf.makeStringAndClear();
723 Reference<XStatement> statement = m_rConnection.createStatement();
724 Reference<XResultSet> rs = statement->executeQuery(query);
725 Reference<XRow> xRow(rs, UNO_QUERY_THROW);
726
727 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
728 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
729 UNO_QUERY);
730 std::vector<std::vector<Any>> aRows;
731 while (rs->next())
732 {
733 std::vector<Any> aRow{ Any() }; // 0. element is unused
734
735 // catalog name
736 aRow.push_back(Any(xRow->getString(1)));
737 // schema name
738 aRow.push_back(Any(xRow->getString(2)));
739 // table name
740 aRow.push_back(Any(xRow->getString(3)));
741 // column name
742 aRow.push_back(Any(xRow->getString(4)));
743 // data type
744 OUString sDataType = xRow->getString(5);
745 aRow.push_back(Any(mysqlc_sdbc_driver::mysqlStrToOOOType(sDataType)));
746 // type name
747 aRow.push_back(Any(sDataType)); // TODO
748 // column size
749 sal_Int32 nColumnSize = 0;
750 OUString sColumnType = xRow->getString(14);
751 sal_Int32 nCharMaxLen = xRow->getShort(6);
752 bool bIsCharMax = !xRow->wasNull();
753 if (sDataType.equalsIgnoreAsciiCase("year"))
754 nColumnSize = o3tl::toInt32(sColumnType.subView(6, 1)); // 'year(' length is 5
755 else if (sDataType.equalsIgnoreAsciiCase("date"))
756 nColumnSize = 10;
757 else if (sDataType.equalsIgnoreAsciiCase("time"))
758 nColumnSize = 8;
759 else if (sDataType.equalsIgnoreAsciiCase("datetime")
760 || sDataType.equalsIgnoreAsciiCase("timestamp"))
761 nColumnSize = 19;
762 else if (!bIsCharMax)
763 nColumnSize = xRow->getShort(7); // numeric precision
764 else
765 nColumnSize = nCharMaxLen;
766 aRow.push_back(Any(nColumnSize));
767 aRow.push_back(Any()); // buffer length - unused
768 // decimal digits (scale)
769 aRow.push_back(Any(xRow->getShort(8)));
770 // num_prec_radix
771 aRow.push_back(Any(sal_Int32(10)));
772 // nullable
773 OUString sIsNullable = xRow->getString(13);
774 if (xRow->wasNull())
775 aRow.push_back(Any(ColumnValue::NULLABLE_UNKNOWN));
776 else if (sIsNullable.equalsIgnoreAsciiCase("YES"))
777 aRow.push_back(Any(ColumnValue::NULLABLE));
778 else
779 aRow.push_back(Any(ColumnValue::NO_NULLS));
780 // remarks
781 aRow.push_back(Any(xRow->getString(9)));
782 // default
783 aRow.push_back(Any(xRow->getString(10)));
784
785 aRow.push_back(Any{}); // sql_data_type - unused
786 aRow.push_back(Any{}); // sql_datetime_sub - unused
787
788 // character octet length
789 aRow.push_back(Any(xRow->getString(11)));
790 // ordinal position
791 aRow.push_back(Any(xRow->getString(12)));
792 // is nullable
793 aRow.push_back(Any(sIsNullable));
794 aRows.push_back(aRow);
795 }
796 lcl_setRows_throw(xResultSet, 1, aRows);
797 return xResultSet;
798}
799
800Reference<XResultSet> SAL_CALL ODatabaseMetaData::getTables(const Any& /*catalog*/,
801 const OUString& schemaPattern,
802 const OUString& tableNamePattern,
803 const Sequence<OUString>& types)
804{
805 OUStringBuffer buffer{
806 "SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME,"
807 "IF(STRCMP(TABLE_TYPE,'BASE TABLE'), TABLE_TYPE, 'TABLE') AS TABLE_TYPE, TABLE_COMMENT AS "
808 "REMARKS "
809 "FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'mysql', "
810 "'performance_schema') AND TABLE_SCHEMA LIKE '?' AND TABLE_NAME LIKE '?' "
811 };
812
813 if (types.getLength() == 1)
814 {
815 buffer.append("AND TABLE_TYPE LIKE '" + types[0] + "'");
816 }
817 else if (types.getLength() > 1)
818 {
819 buffer.append("AND (TABLE_TYPE LIKE '" + types[0] + "'");
820 for (sal_Int32 i = 1; i < types.getLength(); ++i)
821 {
822 buffer.append(" OR TABLE_TYPE LIKE '" + types[i] + "'");
823 }
824 buffer.append(")");
825 }
826
827 buffer.append(" ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME");
828 OUString query = buffer.makeStringAndClear();
829
830 // TODO use prepared stmt instead
831 // TODO escape schema, table name ?
832 query = query.replaceFirst("?", schemaPattern);
833 query = query.replaceFirst("?", tableNamePattern);
834
836 Reference<XResultSet> rs = statement->executeQuery(query);
837 return rs;
838}
839
840Reference<XResultSet> SAL_CALL ODatabaseMetaData::getProcedureColumns(
841 const Any& /* catalog */, const OUString& /* schemaPattern */,
842 const OUString& /* procedureNamePattern */, const OUString& /* columnNamePattern */)
843{
844 // Currently there is no information available
845 return nullptr;
846}
847
848Reference<XResultSet>
849 SAL_CALL ODatabaseMetaData::getProcedures(const Any& /*catalog*/,
850 const OUString& /*schemaPattern*/,
851 const OUString& /*procedureNamePattern*/)
852{
853 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
854 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
855 UNO_QUERY);
856 std::vector<std::vector<Any>> rRows;
857 // TODO IMPL
858 SAL_WARN("connectivity.mysqlc", "method not implemented");
859 lcl_setRows_throw(xResultSet, 7, rRows);
860 return xResultSet;
861}
862
863Reference<XResultSet> SAL_CALL ODatabaseMetaData::getVersionColumns(const Any& /* catalog */,
864 const OUString& /* schema */,
865 const OUString& /* table */)
866{
867 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
868 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
869 UNO_QUERY);
870 std::vector<std::vector<Any>> rRows;
871 lcl_setRows_throw(xResultSet, 16, rRows);
872 return xResultSet;
873}
874
875Reference<XResultSet> SAL_CALL ODatabaseMetaData::getExportedKeys(const Any& /*catalog */,
876 const OUString& /*schema */,
877 const OUString& /*table */)
878{
879 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
880 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
881 UNO_QUERY);
882 std::vector<std::vector<Any>> rRows;
883 // TODO implement
884 SAL_WARN("connectivity.mysqlc", "method not implemented");
885 lcl_setRows_throw(xResultSet, 8, rRows);
886 return xResultSet;
887}
888
889Reference<XResultSet> SAL_CALL ODatabaseMetaData::getImportedKeys(const Any& /*catalog*/,
890 const OUString& schema,
891 const OUString& table)
892{
893 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
894 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
895 UNO_QUERY);
896
897 OUString query("SELECT refi.CONSTRAINT_CATALOG," // 1: foreign catalog
898 " k.COLUMN_NAME," // 2: foreign column name
899 " refi.UNIQUE_CONSTRAINT_CATALOG," // 3: primary catalog FIXME
900 " k.REFERENCED_TABLE_SCHEMA," // 4: primary schema
901 " refi.REFERENCED_TABLE_NAME," // 5: primary table name
902 " k.REFERENCED_COLUMN_NAME," // 6: primary column name
903 " refi.UPDATE_RULE, refi.DELETE_RULE," // 7,8: update, delete rule
904 " refi.CONSTRAINT_NAME, " // 9: name of constraint itself
905 " refi.TABLE_NAME, " // 10: foreign table name
906 " refi.CONSTRAINT_SCHEMA " // 11: foreign schema name FIXME
907 " FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS as refi"
908 " INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE as k ON k.CONSTRAINT_NAME = "
909 "refi.CONSTRAINT_NAME "
910 " and k.TABLE_NAME = refi.TABLE_NAME "
911 " WHERE k.REFERENCED_TABLE_SCHEMA LIKE "
912 "'?' AND refi.TABLE_NAME='?'");
913 query = query.replaceFirst("?", schema); // TODO what if schema is NULL?
914 query = query.replaceFirst("?", table);
915
916 std::vector<std::vector<Any>> aRows;
917 Reference<XStatement> statement = m_rConnection.createStatement();
918 Reference<XResultSet> rs = statement->executeQuery(query);
919 Reference<XRow> xRow(rs, UNO_QUERY_THROW);
920
921 while (rs->next())
922 {
923 std::vector<Any> aRow{ Any() }; // 0. element is unused
924
925 // primary key catalog
926 aRow.push_back(Any(xRow->getString(3)));
927 // primary key schema
928 aRow.push_back(Any(xRow->getString(4)));
929 // primary key table
930 aRow.push_back(Any(xRow->getString(5)));
931 // primary column name
932 aRow.push_back(Any(xRow->getString(6)));
933
934 // fk table catalog
935 aRow.push_back(Any(xRow->getString(1)));
936 // fk schema
937 aRow.push_back(Any(xRow->getString(11)));
938 // fk table
939 aRow.push_back(Any(xRow->getString(10)));
940 // fk column name
941 aRow.push_back(Any(xRow->getString(2)));
942 // KEY_SEQ
943 aRow.push_back(Any(sal_Int32{ 0 })); // TODO
944 // update rule
945 aRow.push_back(Any(xRow->getShort(7)));
946 // delete rule
947 aRow.push_back(Any(xRow->getShort(8)));
948 // foreign key name
949 aRow.push_back(Any(xRow->getString(9)));
950 // primary key name
951 aRow.push_back(Any(OUString{})); // TODO
952 // deferrability
953 aRow.push_back(Any(Deferrability::NONE));
954 aRows.push_back(aRow);
955 }
956 lcl_setRows_throw(xResultSet, 1, aRows);
957 return xResultSet;
958}
959
960Reference<XResultSet> SAL_CALL ODatabaseMetaData::getPrimaryKeys(const Any& /*catalog*/,
961 const OUString& schema,
962 const OUString& table)
963{
964 OUString query("SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA "
965 "AS TABLE_SCHEM, TABLE_NAME, "
966 "COLUMN_NAME, SEQ_IN_INDEX AS KEY_SEQ,"
967 "INDEX_NAME AS PK_NAME FROM INFORMATION_SCHEMA.STATISTICS "
968 "WHERE TABLE_SCHEMA LIKE '?' AND TABLE_NAME LIKE '?' AND INDEX_NAME='PRIMARY' "
969 "ORDER BY TABLE_SCHEMA, TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX");
970
971 // TODO use prepared stmt instead
972 // TODO escape schema, table name ?
973 query = query.replaceFirst("?", schema);
974 query = query.replaceFirst("?", table);
975
976 Reference<XStatement> statement = m_rConnection.createStatement();
977 Reference<XResultSet> rs = statement->executeQuery(query);
978 return rs;
979}
980
981Reference<XResultSet> SAL_CALL ODatabaseMetaData::getIndexInfo(const Any& /*catalog*/,
982 const OUString& /*schema*/,
983 const OUString& /*table*/,
984 sal_Bool /*unique*/,
985 sal_Bool /*approximate*/)
986{
987 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
988 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
989 UNO_QUERY);
990 std::vector<std::vector<Any>> rRows;
991 // TODO
992 SAL_WARN("connectivity.mysqlc", "method not implemented");
993 lcl_setRows_throw(xResultSet, 11, rRows);
994 return xResultSet;
995}
996
997Reference<XResultSet> SAL_CALL ODatabaseMetaData::getBestRowIdentifier(const Any& /*catalog*/,
998 const OUString& /*schema*/,
999 const OUString& /*table*/,
1000 sal_Int32 /*scope*/,
1001 sal_Bool /*nullable*/)
1002{
1003 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
1004 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
1005 UNO_QUERY);
1006 std::vector<std::vector<Any>> rRows;
1007 // TODO
1008 SAL_WARN("connectivity.mysqlc", "method not implemented");
1009 lcl_setRows_throw(xResultSet, 15, rRows);
1010 return xResultSet;
1011}
1012
1013Reference<XResultSet> SAL_CALL ODatabaseMetaData::getTablePrivileges(
1014 const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*tableNamePattern*/)
1015{
1016 // TODO
1017 SAL_WARN("connectivity.mysqlc", "method not implemented");
1018 throw SQLException("getTablePrivileges method not implemented", *this, "IM001", 0, Any());
1019}
1020
1021Reference<XResultSet> SAL_CALL ODatabaseMetaData::getCrossReference(
1022 const Any& /*primaryCatalog*/, const OUString& /*primarySchema_*/,
1023 const OUString& /*primaryTable_*/, const Any& /*foreignCatalog*/,
1024 const OUString& /*foreignSchema*/, const OUString& /*foreignTable*/)
1025{
1026 Reference<XResultSet> xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(
1027 "org.openoffice.comp.helper.DatabaseMetaDataResultSet"),
1028 UNO_QUERY);
1029 std::vector<std::vector<Any>> rRows;
1030 // TODO
1031 SAL_WARN("connectivity.mysqlc", "method not implemented");
1032 lcl_setRows_throw(xResultSet, 13, rRows);
1033 return xResultSet;
1034}
1035
1036Reference<XResultSet> SAL_CALL ODatabaseMetaData::getUDTs(const Any& /* catalog */,
1037 const OUString& /* schemaPattern */,
1038 const OUString& /* typeNamePattern */,
1039 const Sequence<sal_Int32>& /* types */)
1040{
1041 mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getUDTs", *this);
1042 return nullptr;
1043}
1044
1045/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
const ConnectionSettings & getConnectionSettings() const
rtl_TextEncoding getConnectionEncoding() const
css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
sal_Bool SAL_CALL ownUpdatesAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL supportsPositionedDelete() override
sal_Int32 SAL_CALL getMaxColumnsInGroupBy() override
sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions() override
sal_Bool SAL_CALL supportsAlterTableWithDropColumn() override
sal_Bool SAL_CALL supportsLikeEscapeClause() override
sal_Int32 SAL_CALL getMaxColumnsInIndex() override
sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly() override
sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit() override
sal_Bool SAL_CALL storesUpperCaseIdentifiers() override
sal_Int32 SAL_CALL getMaxCatalogNameLength() override
sal_Int32 SAL_CALL getMaxTableNameLength() override
sal_Bool SAL_CALL insertsAreDetected(sal_Int32 setType) override
sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers() override
sal_Bool SAL_CALL supportsANSI92IntermediateSQL() override
sal_Bool SAL_CALL supportsCatalogsInDataManipulation() override
sal_Bool SAL_CALL supportsConvert(sal_Int32 fromType, sal_Int32 toType) override
sal_Int32 SAL_CALL getMaxCursorNameLength() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier(const Any &catalog, const OUString &schema, const OUString &table, sal_Int32 scope, sal_Bool nullable) override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas() override
OUString SAL_CALL getExtraNameCharacters() override
sal_Int32 SAL_CALL getMaxColumnsInOrderBy() override
sal_Bool SAL_CALL supportsMixedCaseIdentifiers() override
sal_Int32 SAL_CALL getMaxUserNameLength() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes() override
sal_Int32 SAL_CALL getMaxColumnsInTable() override
sal_Bool SAL_CALL supportsMultipleTransactions() override
sal_Bool SAL_CALL supportsResultSetConcurrency(sal_Int32 setType, sal_Int32 concurrency) override
sal_Bool SAL_CALL supportsSchemasInTableDefinitions() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo() override
sal_Bool SAL_CALL supportsCatalogsInProcedureCalls() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys(const Any &catalog, const OUString &schema, const OUString &table) override
sal_Int32 SAL_CALL getMaxColumnNameLength() override
sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers() override
sal_Bool SAL_CALL supportsLimitedOuterJoins() override
OUString SAL_CALL getIdentifierQuoteString() override
sal_Int32 SAL_CALL getMaxProcedureNameLength() override
sal_Int32 SAL_CALL getMaxSchemaNameLength() override
sal_Bool SAL_CALL othersDeletesAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit() override
sal_Bool SAL_CALL supportsGroupByUnrelated() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges(const Any &catalog, const OUString &schema, const OUString &table, const OUString &columnNamePattern) override
sal_Bool SAL_CALL supportsTransactionIsolationLevel(sal_Int32 level) override
sal_Bool SAL_CALL supportsExtendedSQLGrammar() override
sal_Int32 SAL_CALL getMaxCharLiteralLength() override
sal_Bool SAL_CALL supportsPositionedUpdate() override
sal_Bool SAL_CALL supportsIntegrityEnhancementFacility() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges(const Any &catalog, const OUString &schemaPattern, const OUString &tableNamePattern) override
sal_Bool SAL_CALL nullsAreSortedAtStart() override
sal_Bool SAL_CALL storesLowerCaseIdentifiers() override
sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions() override
sal_Bool SAL_CALL supportsExpressionsInOrderBy() override
sal_Bool SAL_CALL supportsFullOuterJoins() override
sal_Bool SAL_CALL supportsSchemasInDataManipulation() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs(const Any &catalog, const OUString &schemaPattern, const OUString &typeNamePattern, const css::uno::Sequence< sal_Int32 > &types) override
sal_Bool SAL_CALL nullPlusNonNullIsNull() override
sal_Bool SAL_CALL othersInsertsAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL supportsCoreSQLGrammar() override
sal_Bool SAL_CALL allProceduresAreCallable() override
sal_Int32 SAL_CALL getMaxColumnsInSelect() override
sal_Bool SAL_CALL storesMixedCaseIdentifiers() override
sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback() override
sal_Int32 SAL_CALL getDriverMinorVersion() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys(const Any &catalog, const OUString &schema, const OUString &table) override
sal_Bool SAL_CALL ownDeletesAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL supportsANSI92EntryLevelSQL() override
sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit() override
sal_Int32 SAL_CALL getMaxStatementLength() override
sal_Bool SAL_CALL supportsANSI92FullSQL() override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns(const Any &catalog, const OUString &schemaPattern, const OUString &tableNamePattern, const OUString &columnNamePattern) override
sal_Bool SAL_CALL allTablesAreSelectable() override
sal_Bool SAL_CALL supportsSelectForUpdate() override
sal_Bool SAL_CALL supportsResultSetType(sal_Int32 setType) override
sal_Bool SAL_CALL supportsMultipleResultSets() override
sal_Int32 SAL_CALL getDefaultTransactionIsolation() override
OUString SAL_CALL getDatabaseProductVersion() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables(const Any &catalog, const OUString &schemaPattern, const OUString &tableNamePattern, const css::uno::Sequence< OUString > &types) override
sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers() override
sal_Bool SAL_CALL supportsMinimumSQLGrammar() override
sal_Bool SAL_CALL supportsGroupByBeyondSelect() override
sal_Int32 SAL_CALL getDriverMajorVersion() override
css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs() override
sal_Int32 SAL_CALL getMaxBinaryLiteralLength() override
sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback() override
sal_Bool SAL_CALL supportsTypeConversion() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns(const Any &catalog, const OUString &schemaPattern, const OUString &procedureNamePattern, const OUString &columnNamePattern) override
sal_Int32 SAL_CALL getMaxConnections() override
sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers() override
sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions() override
OUString SAL_CALL getDatabaseProductName() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns(const Any &catalog, const OUString &schema, const OUString &table) override
sal_Bool SAL_CALL supportsSubqueriesInComparisons() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo(const Any &catalog, const OUString &schema, const OUString &table, sal_Bool unique, sal_Bool approximate) override
sal_Bool SAL_CALL supportsSubqueriesInQuantifieds() override
sal_Bool SAL_CALL supportsOrderByUnrelated() override
sal_Bool SAL_CALL othersUpdatesAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL ownInsertsAreVisible(sal_Int32 setType) override
sal_Bool SAL_CALL supportsSubqueriesInIns() override
sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference(const Any &primaryCatalog, const OUString &primarySchema, const OUString &primaryTable, const Any &foreignCatalog, const OUString &foreignSchema, const OUString &foreignTable) override
sal_Bool SAL_CALL usesLocalFilePerTable() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys(const Any &catalog, const OUString &schema, const OUString &table) override
sal_Bool SAL_CALL supportsColumnAliasing() override
sal_Bool SAL_CALL deletesAreDetected(sal_Int32 setType) override
OUString SAL_CALL getCatalogSeparator() override
css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures(const Any &catalog, const OUString &schemaPattern, const OUString &procedureNamePattern) override
sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions() override
sal_Bool SAL_CALL supportsNonNullableColumns() override
sal_Bool SAL_CALL supportsDifferentTableCorrelationNames() override
sal_Bool SAL_CALL supportsCorrelatedSubqueries() override
sal_Bool SAL_CALL supportsTableCorrelationNames() override
sal_Bool SAL_CALL supportsAlterTableWithAddColumn() override
sal_Bool SAL_CALL supportsStoredProcedures() override
sal_Bool SAL_CALL supportsSchemasInProcedureCalls() override
sal_Bool SAL_CALL updatesAreDetected(sal_Int32 setType) override
sal_Bool SAL_CALL supportsSubqueriesInExists() override
sal_Int32 SAL_CALL getMaxTablesInSelect() override
sal_Bool SAL_CALL supportsCatalogsInTableDefinitions() override
sal_Bool SAL_CALL supportsSchemasInIndexDefinitions() override
OUString SAL_CALL getSearchStringEscape() override
float u
#define SAL_WARN(area, stream)
static void lcl_setRows_throw(const Reference< XResultSet > &_xResultSet, sal_Int32 _nType, const std::vector< std::vector< Any > > &_rRows)
static std::string wild("%")
TypeInfoDef const mysqlc_types[]
@ table
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
int i
OUString convert(const ::std::string &_string, const rtl_TextEncoding encoding)
sal_Int32 mysqlStrToOOOType(std::u16string_view sType)
void throwFeatureNotImplementedException(const char *_pAsciiFeatureName, const css::uno::Reference< XInterface > &_rxContext)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
store_handle_type *SAL_CALL query(OStoreObject *pHandle, store_handle_type *)
OUString typeName
sal_Int32 precision
Definition: pq_statics.cxx:61
unsigned char sal_Bool